From 342fa7d17e13a82c04afb56dbeed52e249426251 Mon Sep 17 00:00:00 2001 From: objectinspace Date: Sat, 15 Aug 2026 23:56:15 -0400 Subject: [PATCH] Remove redundant primitive-key constraint --- Tomlet/TomlSerializationMethods.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Tomlet/TomlSerializationMethods.cs b/Tomlet/TomlSerializationMethods.cs index cee4b8e..7262a21 100644 --- a/Tomlet/TomlSerializationMethods.cs +++ b/Tomlet/TomlSerializationMethods.cs @@ -371,14 +371,13 @@ private static Deserialize> StringKeyedDictionaryDeseriali }; } - // unmanaged + IConvertible is the closest I can get to expressing "primitives only" #if MODERN_DOTNET #if NET7_0_OR_GREATER [RequiresDynamicCode("The native code for underlying implementations of deserialize helper methods may not be available for a given type.")] #endif // NET7_0_OR_GREATER - private static Deserialize> PrimitiveKeyedDictionaryDeserializerFor(TomlSerializerOptions options) where TKey : unmanaged, IConvertible + private static Deserialize> PrimitiveKeyedDictionaryDeserializerFor(TomlSerializerOptions options) #else - private static Deserialize> PrimitiveKeyedDictionaryDeserializerFor(TomlSerializerOptions options) where TKey : unmanaged, IConvertible + private static Deserialize> PrimitiveKeyedDictionaryDeserializerFor(TomlSerializerOptions options) #endif { var valueDeserializer = GetDeserializer(typeof(TValue), options); @@ -539,4 +538,4 @@ private static void RegisterDictionaryDeserializer(Deserialize deserialize .ToDictionary(kvp => kvp.Key, kvp => kvp.Value); }); } -} \ No newline at end of file +}