mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-21 16:25:28 +03:00
Removed nesting levels through block-scoped using statement (#10025)
Co-authored-by: John Doe <john@doe> Co-authored-by: Lehonti Ramos <lehonti@ramos>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user