Skip to content

Commit 4ee291c

Browse files
committed
Cleanup code
1 parent eed51e4 commit 4ee291c

4 files changed

Lines changed: 0 additions & 20 deletions

File tree

src/Scarlet.System.Text.Json.DateTimeConverter/Converters/DateOnlyNullableConverter.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,6 @@ internal sealed class DateOnlyNullableConverter : JsonConverter<DateOnly?>
2626
/// <returns>The converted nullable <see cref="DateOnly"/> object, or null if the JSON token is null.</returns>
2727
public override DateOnly? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
2828
{
29-
if (reader.TokenType == JsonTokenType.Null)
30-
{
31-
return null;
32-
}
33-
3429
if (reader.TokenType == JsonTokenType.String)
3530
{
3631
if (DateOnly.TryParseExact(reader.GetString(), _format, CultureInfo.InvariantCulture, DateTimeStyles.None, out DateOnly date))

src/Scarlet.System.Text.Json.DateTimeConverter/Converters/DateTimeNullableConverter.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,6 @@ internal sealed class DateTimeNullableConverter : JsonConverter<DateTime?>
2626
/// <returns>The converted nullable <see cref="DateTime"/> object, or null if the JSON token is null.</returns>
2727
public override DateTime? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
2828
{
29-
if (reader.TokenType == JsonTokenType.Null)
30-
{
31-
return null;
32-
}
33-
3429
if (reader.TokenType == JsonTokenType.String)
3530
{
3631
if (DateTime.TryParseExact(reader.GetString(), _format, CultureInfo.InvariantCulture, DateTimeStyles.None, out DateTime date))

src/Scarlet.System.Text.Json.DateTimeConverter/Converters/DateTimeOffsetNullableConverter.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,6 @@ internal sealed class DateTimeOffsetNullableConverter : JsonConverter<DateTimeOf
2626
/// <returns>The converted nullable <see cref="DateTimeOffset"/> object, or null if the JSON token is null.</returns>
2727
public override DateTimeOffset? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
2828
{
29-
if (reader.TokenType == JsonTokenType.Null)
30-
{
31-
return null;
32-
}
33-
3429
if (reader.TokenType == JsonTokenType.String)
3530
{
3631
if (DateTimeOffset.TryParseExact(reader.GetString(), _format, CultureInfo.InvariantCulture, DateTimeStyles.None, out DateTimeOffset date))

src/Scarlet.System.Text.Json.DateTimeConverter/Converters/TimeOnlyNullableConverter.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,6 @@ internal sealed class TimeOnlyNullableConverter : JsonConverter<TimeOnly?>
2626
/// <returns>The converted nullable <see cref="TimeOnly"/> object, or null if the JSON token is null.</returns>
2727
public override TimeOnly? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
2828
{
29-
if (reader.TokenType == JsonTokenType.Null)
30-
{
31-
return null;
32-
}
33-
3429
if (reader.TokenType == JsonTokenType.String)
3530
{
3631
if (TimeOnly.TryParseExact(reader.GetString(), _format, CultureInfo.InvariantCulture, DateTimeStyles.None, out TimeOnly time))

0 commit comments

Comments
 (0)