Skip to content

Commit fc3ba5e

Browse files
committed
Added a bunch of usings and removed an unnecessary flush to address comments
1 parent 5a7146c commit fc3ba5e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/Microsoft.OpenApi.Hidi/OpenApiService.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ public static async Task ValidateOpenApiDocument(
265265
{
266266
throw new ArgumentNullException(nameof(openapi));
267267
}
268-
var stream = await GetStream(openapi, logger, cancellationToken);
268+
using var stream = await GetStream(openapi, logger, cancellationToken);
269269

270270
OpenApiDocument document;
271271
Stopwatch stopwatch = Stopwatch.StartNew();
@@ -546,7 +546,7 @@ internal static async Task ShowOpenApiDocument(string openapi, FileInfo output,
546546
{
547547
throw new ArgumentNullException(nameof(openapi));
548548
}
549-
var stream = await GetStream(openapi, logger, cancellationToken);
549+
using var stream = await GetStream(openapi, logger, cancellationToken);
550550

551551
OpenApiDocument document;
552552
Stopwatch stopwatch = Stopwatch.StartNew();
@@ -584,7 +584,6 @@ internal static async Task ShowOpenApiDocument(string openapi, FileInfo output,
584584
using var file = new FileStream(output.FullName, FileMode.Create);
585585
using var writer = new StreamWriter(file);
586586
WriteTreeDocument(openapi, document, writer);
587-
writer.Flush();
588587

589588
logger.LogTrace("Finished walking through the OpenApi document. ");
590589
}

0 commit comments

Comments
 (0)