Skip to content

Commit

Permalink
Dispose StreamReader object (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBlubb14 authored Jan 11, 2022
1 parent f86898f commit 2b8056d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/dotVariant.Generator.Test/GeneratorTools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,9 @@ public static string LoadSample(string name)
{
var assembly = Assembly.GetExecutingAssembly();
using var stream = assembly.GetManifestResourceStream($"{assembly.GetName().Name}.samples.{name}");
using var reader = new StreamReader(stream!);

return new StreamReader(stream!).ReadToEnd();
return reader.ReadToEnd();
}

public static IEnumerable<DiagnosticExpectation> ExtractExpectations(string input)
Expand Down

0 comments on commit 2b8056d

Please sign in to comment.