Skip to content

Commit

Permalink
[ISSUE #31]🐛Fix feature serde Serialize compile error💚 (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
mxsm authored Nov 11, 2024
1 parent dfcbe06 commit 3735fec
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/serde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<CheetahString, D::Error>
where
D: Deserializer<'de>,
Expand Down

0 comments on commit 3735fec

Please sign in to comment.