Skip to content

Commit

Permalink
Use 'await using'
Browse files Browse the repository at this point in the history
  • Loading branch information
jnm2 committed Aug 12, 2023
1 parent c357343 commit 412964c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/YouTubeDownloadTool/Utils/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public static async Task<RefCountedFileLock> GetOrDownloadFileAsync(string fileP

using var tempFile = new TempFile();

using (var file = tempFile.OpenStream())
await using (var file = tempFile.OpenStream())
await stream.CopyToAsync(file, cancellationToken).ConfigureAwait(false);

do
Expand Down
2 changes: 1 addition & 1 deletion src/YouTubeDownloadTool/YTDlpTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public async Task<DownloadResult> DownloadToDirectoryAsync(
process.BeginOutputReadLine();
process.BeginErrorReadLine();

using (cancellationToken.Register(process.Kill))
await using (cancellationToken.Register(process.Kill))
await process.WaitForExitAsync(CancellationToken.None);

cancellationToken.ThrowIfCancellationRequested();
Expand Down

0 comments on commit 412964c

Please sign in to comment.