Skip to content

Commit

Permalink
Refactor: Use await using for packageVersionStream to ensure prop…
Browse files Browse the repository at this point in the history
…er disposal of async resources
  • Loading branch information
dexcompiler authored Aug 29, 2024
1 parent e9cc7e1 commit 43d9a65
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/dotnet-grpc/Commands/CommandBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public async Task EnsureNugetPackagesAsync(Services services)
}*/
try
{
using var packageVersionStream = await _httpClient.GetStreamAsync(PackageVersionUrl);
await using var packageVersionStream = await _httpClient.GetStreamAsync(PackageVersionUrl);
using var packageVersionDocument = await JsonDocument.ParseAsync(packageVersionStream);
var packageVersionsElement = packageVersionDocument.RootElement.GetProperty("Packages");
var packageVersionsDictionary = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
Expand Down

0 comments on commit 43d9a65

Please sign in to comment.