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 (#2521)
  • Loading branch information
dexcompiler authored Dec 9, 2024
1 parent cacf59d commit 6a3c977
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 6a3c977

Please sign in to comment.