Skip to content

Commit

Permalink
Remove redundant scope
Browse files Browse the repository at this point in the history
  • Loading branch information
iamcarbon committed Nov 9, 2023
1 parent eb0efe8 commit 094643c
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/Zio/FileSystemExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -340,12 +340,11 @@ public static byte[] ReadAllBytes(this IFileSystem fs, UPath path)
public static string ReadAllText(this IFileSystem fs, UPath path)
{
var stream = fs.OpenFile(path, FileMode.Open, FileAccess.Read, FileShare.Read);

using (var reader = new StreamReader(stream))
{
using (var reader = new StreamReader(stream))
{
return reader.ReadToEnd();
}
}
return reader.ReadToEnd();
}
}

/// <summary>
Expand All @@ -359,11 +358,10 @@ public static string ReadAllText(this IFileSystem fs, UPath path, Encoding encod
{
if (encoding is null) throw new ArgumentNullException(nameof(encoding));
var stream = fs.OpenFile(path, FileMode.Open, FileAccess.Read, FileShare.Read);

using (var reader = new StreamReader(stream, encoding))
{
using (var reader = new StreamReader(stream, encoding))
{
return reader.ReadToEnd();
}
return reader.ReadToEnd();
}
}

Expand Down

0 comments on commit 094643c

Please sign in to comment.