diff options
| author | Lehonti Ramos <17771375+Lehonti@users.noreply.github.com> | 2023-09-11 12:12:40 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-11 12:12:40 +0200 |
| commit | bc959270b762d1a6f68fc4f46a7c42138b39710c (patch) | |
| tree | 83ad06db60af1226a313423ea4bacc36a63e67a7 /tests/Jellyfin.Model.Tests/Dlna/StreamBuilderTests.cs | |
| parent | c79c59a32be47b9dde5360a6c56c02defd714d03 (diff) | |
Removed nesting levels through block-scoped `using` statement (#10025)
Co-authored-by: John Doe <john@doe>
Co-authored-by: Lehonti Ramos <lehonti@ramos>
Diffstat (limited to 'tests/Jellyfin.Model.Tests/Dlna/StreamBuilderTests.cs')
| -rw-r--r-- | tests/Jellyfin.Model.Tests/Dlna/StreamBuilderTests.cs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/Jellyfin.Model.Tests/Dlna/StreamBuilderTests.cs b/tests/Jellyfin.Model.Tests/Dlna/StreamBuilderTests.cs index c30dad6f9..4c727428b 100644 --- a/tests/Jellyfin.Model.Tests/Dlna/StreamBuilderTests.cs +++ b/tests/Jellyfin.Model.Tests/Dlna/StreamBuilderTests.cs @@ -488,16 +488,16 @@ namespace Jellyfin.Model.Tests private static async ValueTask<T> TestData<T>(string name) { var path = Path.Join("Test Data", typeof(T).Name + "-" + name + ".json"); - using (var stream = File.OpenRead(path)) - { - var value = await JsonSerializer.DeserializeAsync<T>(stream, JsonDefaults.Options); - if (value is not null) - { - return value; - } - throw new SerializationException("Invalid test data: " + name); + using var stream = File.OpenRead(path); + + var value = await JsonSerializer.DeserializeAsync<T>(stream, JsonDefaults.Options); + if (value is not null) + { + return value; } + + throw new SerializationException("Invalid test data: " + name); } private StreamBuilder GetStreamBuilder() |
