mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-12-30 17:48:52 +01:00
Use await using in async methods
This commit is contained in:
@@ -322,7 +322,7 @@ namespace NzbDrone.Common.Http
|
||||
_logger.Debug("Downloading [{0}] to [{1}]", url, fileName);
|
||||
|
||||
var stopWatch = Stopwatch.StartNew();
|
||||
using (var fileStream = new FileStream(fileNamePart, FileMode.Create, FileAccess.ReadWrite))
|
||||
await using (var fileStream = new FileStream(fileNamePart, FileMode.Create, FileAccess.ReadWrite))
|
||||
{
|
||||
var request = new HttpRequest(url);
|
||||
request.AllowAutoRedirect = true;
|
||||
|
||||
@@ -179,21 +179,12 @@ namespace NzbDrone.Core.Localization
|
||||
return;
|
||||
}
|
||||
|
||||
using (var fs = File.OpenRead(resourcePath))
|
||||
{
|
||||
if (fs != null)
|
||||
{
|
||||
var dict = await JsonSerializer.DeserializeAsync<Dictionary<string, string>>(fs);
|
||||
await using var fs = File.OpenRead(resourcePath);
|
||||
var dict = await JsonSerializer.DeserializeAsync<Dictionary<string, string>>(fs);
|
||||
|
||||
foreach (var key in dict.Keys)
|
||||
{
|
||||
dictionary[key] = dict[key];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_logger.Error("Missing translation/culture resource: {0}", resourcePath);
|
||||
}
|
||||
foreach (var key in dict.Keys)
|
||||
{
|
||||
dictionary[key] = dict[key];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user