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>,