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 /Jellyfin.Server/Migrations/PreStartupRoutines/MigrateNetworkConfiguration.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 'Jellyfin.Server/Migrations/PreStartupRoutines/MigrateNetworkConfiguration.cs')
| -rw-r--r-- | Jellyfin.Server/Migrations/PreStartupRoutines/MigrateNetworkConfiguration.cs | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/Jellyfin.Server/Migrations/PreStartupRoutines/MigrateNetworkConfiguration.cs b/Jellyfin.Server/Migrations/PreStartupRoutines/MigrateNetworkConfiguration.cs index a4379197c..c6d86b8cd 100644 --- a/Jellyfin.Server/Migrations/PreStartupRoutines/MigrateNetworkConfiguration.cs +++ b/Jellyfin.Server/Migrations/PreStartupRoutines/MigrateNetworkConfiguration.cs @@ -43,10 +43,8 @@ public class MigrateNetworkConfiguration : IMigrationRoutine try { - using (var xmlReader = XmlReader.Create(path)) - { - oldNetworkConfiguration = (OldNetworkConfiguration?)oldNetworkConfigSerializer.Deserialize(xmlReader); - } + using var xmlReader = XmlReader.Create(path); + oldNetworkConfiguration = (OldNetworkConfiguration?)oldNetworkConfigSerializer.Deserialize(xmlReader); } catch (InvalidOperationException ex) { @@ -97,10 +95,8 @@ public class MigrateNetworkConfiguration : IMigrationRoutine var networkConfigSerializer = new XmlSerializer(typeof(NetworkConfiguration)); var xmlWriterSettings = new XmlWriterSettings { Indent = true }; - using (var xmlWriter = XmlWriter.Create(path, xmlWriterSettings)) - { - networkConfigSerializer.Serialize(xmlWriter, networkConfiguration); - } + using var xmlWriter = XmlWriter.Create(path, xmlWriterSettings); + networkConfigSerializer.Serialize(xmlWriter, networkConfiguration); } } |
