From a3f8aeede562249e46a240f183274a567b0491c5 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 03:41:34 +0000 Subject: [PATCH] style: format code with dotnet-format This commit fixes the style issues introduced in 2174731 according to the output from dotnet-format. Details: None --- Redis/EndPointCollectionJsonConverter.cs | 38 ++++++++++++------------ 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/Redis/EndPointCollectionJsonConverter.cs b/Redis/EndPointCollectionJsonConverter.cs index dc006e1..400dfe8 100644 --- a/Redis/EndPointCollectionJsonConverter.cs +++ b/Redis/EndPointCollectionJsonConverter.cs @@ -315,23 +315,23 @@ public override void Write(Utf8JsonWriter writer, EndPointCollection value, Jso public class EndPointSerializerContext(Jso options) : JsonSerializerContext(options) { - protected override Jso GeneratedSerializerOptions => Options; - - public override JsonTypeInfo? GetTypeInfo(type type) - { - return type switch - { - { Name: nameof(EndPoint) } => CreateJsonTypeInfo(Options), - _ => throw new NotImplementedException() - }; - } - } - - protected static JsonTypeInfo CreateJsonTypeInfo(Jso jso) - { - var typeInfo = JsonTypeInfo.CreateJsonTypeInfo(jso); - typeInfo.PolymorphismOptions.DerivedTypes.Add(new JsonDerivedType(typeof(DnsEndPoint))); - typeInfo.PolymorphismOptions.DerivedTypes.Add(new JsonDerivedType(typeof(IPEndPoint))); - return typeInfo; - } + protected override Jso GeneratedSerializerOptions => Options; + + public override JsonTypeInfo? GetTypeInfo(type type) + { + return type switch + { + { Name: nameof(EndPoint) } => CreateJsonTypeInfo(Options), + _ => throw new NotImplementedException() + }; + } +} + +protected static JsonTypeInfo CreateJsonTypeInfo(Jso jso) +{ + var typeInfo = JsonTypeInfo.CreateJsonTypeInfo(jso); + typeInfo.PolymorphismOptions.DerivedTypes.Add(new JsonDerivedType(typeof(DnsEndPoint))); + typeInfo.PolymorphismOptions.DerivedTypes.Add(new JsonDerivedType(typeof(IPEndPoint))); + return typeInfo; +} }