Skip to content

Commit

Permalink
Update InnerVerifier_Stream.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp committed Jun 12, 2022
1 parent 350bd3f commit 52f650b
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions src/Verify/Verifier/InnerVerifier_Stream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,26 @@ async Task VerifyStream(Stream stream)
}
}

extension ??= "bin";

List<Target> targets;
if (EmptyFiles.Extensions.IsText(extension))
{
targets = new()
{
new(extension, await stream.ReadString())
};
await VerifyInner(null, null, targets);
}
else
{
targets = new()
{
new(extension, stream)
};
}
var targets = await GetTargets(stream, extension);

await VerifyInner(null, null, targets);
}
}

static async Task<List<Target>> GetTargets(Stream stream, string? extension)
{
if (extension != null &&
EmptyFiles.Extensions.IsText(extension))
{
return new()
{
new(extension, await stream.ReadString())
};
}

return new()
{
new(extension ?? "bin", stream)
};
}
}

0 comments on commit 52f650b

Please sign in to comment.