From b0fa9788f4f1fc03a9fc8066ea4c2aa0f26c5400 Mon Sep 17 00:00:00 2001 From: Lucien Greathouse Date: Wed, 21 Jun 2023 18:24:47 -0400 Subject: [PATCH] Change MapKeySerializer::serialize_some to fall through instead of erroring --- src/ser.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ser.rs b/src/ser.rs index 34ca87c5f..3c08f3700 100644 --- a/src/ser.rs +++ b/src/ser.rs @@ -1043,11 +1043,12 @@ where Err(key_must_be_a_string()) } - fn serialize_some(self, _value: &T) -> Result<()> + #[inline] + fn serialize_some(self, value: &T) -> Result<()> where T: ?Sized + Serialize, { - Err(key_must_be_a_string()) + value.serialize(self) } fn serialize_seq(self, _len: Option) -> Result {