diff --git a/System.IO.Abstractions/FileWrapper.cs b/System.IO.Abstractions/FileWrapper.cs index 96ec34f88..a7d0bbeab 100644 --- a/System.IO.Abstractions/FileWrapper.cs +++ b/System.IO.Abstractions/FileWrapper.cs @@ -30,14 +30,12 @@ public override void AppendAllLines(string path, IEnumerable contents, E #if NETCOREAPP2_0 public override Task AppendAllLinesAsync(string path, IEnumerable contents, CancellationToken cancellationToken) { - File.AppendAllLinesAsync(path, contents, cancellationToken); - return Task.CompletedTask; + return File.AppendAllLinesAsync(path, contents, cancellationToken); } public override Task AppendAllLinesAsync(string path, IEnumerable contents, Encoding encoding, CancellationToken cancellationToken) { - File.AppendAllLinesAsync(path, contents, encoding, cancellationToken); - return Task.CompletedTask; + return File.AppendAllLinesAsync(path, contents, encoding, cancellationToken); } #endif @@ -54,14 +52,12 @@ public override void AppendAllText(string path, string contents, Encoding encodi #if NETCOREAPP2_0 public override Task AppendAllTextAsync(string path, string contents, CancellationToken cancellationToken) { - File.AppendAllTextAsync(path, contents, cancellationToken); - return Task.CompletedTask; + return File.AppendAllTextAsync(path, contents, cancellationToken); } public override Task AppendAllTextAsync(string path, string contents, Encoding encoding, CancellationToken cancellationToken) { - File.AppendAllTextAsync(path, contents, encoding, cancellationToken); - return Task.CompletedTask; + return File.AppendAllTextAsync(path, contents, encoding, cancellationToken); } #endif @@ -378,8 +374,7 @@ public override void WriteAllBytes(string path, byte[] bytes) #if NETCOREAPP2_0 public override Task WriteAllBytesAsync(string path, byte[] bytes, CancellationToken cancellationToken) { - File.WriteAllBytesAsync(path, bytes, cancellationToken); - return Task.CompletedTask; + return File.WriteAllBytesAsync(path, bytes, cancellationToken); } #endif @@ -553,26 +548,22 @@ public override void WriteAllLines(string path, string[] contents, Encoding enco #if NETCOREAPP2_0 public override Task WriteAllLinesAsync(string path, IEnumerable contents, CancellationToken cancellationToken) { - File.WriteAllLinesAsync(path, contents, cancellationToken); - return Task.CompletedTask; + return File.WriteAllLinesAsync(path, contents, cancellationToken); } public override Task WriteAllLinesAsync(string path, IEnumerable contents, Encoding encoding, CancellationToken cancellationToken) { - File.WriteAllLinesAsync(path, contents, encoding, cancellationToken); - return Task.CompletedTask; + return File.WriteAllLinesAsync(path, contents, encoding, cancellationToken); } public override Task WriteAllLinesAsync(string path, string[] contents, CancellationToken cancellationToken) { - File.WriteAllLinesAsync(path, contents, cancellationToken); - return Task.CompletedTask; + return File.WriteAllLinesAsync(path, contents, cancellationToken); } public override Task WriteAllLinesAsync(string path, string[] contents, Encoding encoding, CancellationToken cancellationToken) { - File.WriteAllLinesAsync(path, contents, encoding, cancellationToken); - return Task.CompletedTask; + return File.WriteAllLinesAsync(path, contents, encoding, cancellationToken); } #endif @@ -651,14 +642,12 @@ public override void WriteAllText(string path, string contents, Encoding encodin #if NETCOREAPP2_0 public override Task WriteAllTextAsync(string path, string contents, CancellationToken cancellationToken) { - File.WriteAllTextAsync(path, contents, cancellationToken); - return Task.CompletedTask; + return File.WriteAllTextAsync(path, contents, cancellationToken); } public override Task WriteAllTextAsync(string path, string contents, Encoding encoding, CancellationToken cancellationToken) { - File.WriteAllTextAsync(path, contents, encoding, cancellationToken); - return Task.CompletedTask; + return File.WriteAllTextAsync(path, contents, encoding, cancellationToken); } #endif }