From c3e6c4685f065020622529e7cf2ef7c9c037cb6d Mon Sep 17 00:00:00 2001 From: RoosterDragon Date: Sun, 12 Mar 2023 16:32:02 +0000 Subject: [PATCH] Fix CA1849 --- .editorconfig | 3 +++ .../Widgets/Logic/Installation/DownloadPackageLogic.cs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.editorconfig b/.editorconfig index 5f9188af73..c1765dcfb2 100644 --- a/.editorconfig +++ b/.editorconfig @@ -762,6 +762,9 @@ dotnet_diagnostic.CA1846.severity = warning # Use string.Contains(char) instead of string.Contains(string) with single characters. dotnet_diagnostic.CA1847.severity = warning +# Call async methods when in an async method. +dotnet_diagnostic.CA1849.severity = warning + # Unnecessary call to 'Dictionary.ContainsKey(key)'. dotnet_diagnostic.CA1853.severity = warning diff --git a/OpenRA.Mods.Common/Widgets/Logic/Installation/DownloadPackageLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Installation/DownloadPackageLogic.cs index 1f795a8951..6a7df20a55 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Installation/DownloadPackageLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Installation/DownloadPackageLogic.cs @@ -239,7 +239,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic using (var zz = package.GetStream(kv.Value)) using (var f = File.Create(targetPath)) - zz.CopyTo(f); + await zz.CopyToAsync(f); } package.Dispose();