Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Commit

Permalink
Merge pull request #108 from IEvangelist/aot-warning-and-cleanup
Browse files Browse the repository at this point in the history
Move Cast<T> call when in .NET Standard.
  • Loading branch information
baywet authored Jan 31, 2024
2 parents 1788aaf + 7bc8d20 commit 3d09cf9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/FormSerializationWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,11 @@ public void WriteEnumValue<T>(string? key, T? value) where T : struct, Enum
Enum.GetValues<T>()
#else
Enum.GetValues(typeof(T))
.Cast<T>()
#endif
.Cast<T>()
.Where(x => value.Value.HasFlag(x))
.Select(static x => Enum.GetName(typeof(T),x))
.Select(static x => x.ToFirstCharacterLowerCase())));
.Where(x => value.Value.HasFlag(x))
.Select(static x => Enum.GetName(typeof(T),x))
.Select(static x => x.ToFirstCharacterLowerCase())));
else WriteStringValue(key, value.Value.ToString().ToFirstCharacterLowerCase());
}
}
Expand Down

0 comments on commit 3d09cf9

Please sign in to comment.