From 814b5a89b5999ec5da9f9e280ea1e49f4b374ba5 Mon Sep 17 00:00:00 2001 From: mxsm Date: Mon, 11 Nov 2024 03:26:19 +0000 Subject: [PATCH] =?UTF-8?q?[ISSUE=20#31]=F0=9F=90=9BFix=20feature=20serde?= =?UTF-8?q?=20Serialize=20compile=20error=F0=9F=92=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/serde.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/serde.rs b/src/serde.rs index aa62f5c..d5b391a 100644 --- a/src/serde.rs +++ b/src/serde.rs @@ -13,12 +13,11 @@ impl Serialize for CheetahString { InnerString::StaticStr(s) => serializer.serialize_str(s), #[cfg(feature = "bytes")] InnerString::Bytes(bytes) => serializer.serialize_bytes(bytes.as_ref()), - InnerString::Empty => Ok(()), + InnerString::Empty => serializer.serialize_bytes(&[]), } } } -#[cfg(any(feature = "std", feature = "alloc"))] pub fn cheetah_string<'de: 'a, 'a, D>(deserializer: D) -> Result where D: Deserializer<'de>,