diff --git a/src/serdey.rs b/src/serdey.rs index 8a54640..386abce 100644 --- a/src/serdey.rs +++ b/src/serdey.rs @@ -31,8 +31,10 @@ impl ::serde_crate::Serialize for $t { impl<'d> ::serde_crate::Deserialize<'d> for $t { fn deserialize(deserializer: D) -> Result where D: ::serde_crate::Deserializer<'d> { cfg_if::cfg_if!{ - if #[cfg(any(feature = "alloc", feature = "std"))] { - let bytes = <::serde_bytes::ByteBuf>::deserialize(deserializer)?; + if #[cfg(feature = "std")] { + let bytes = >::deserialize(deserializer)?; + } else if #[cfg(feature = "alloc")] { + let bytes = >::deserialize(deserializer)?; } else { let bytes = <&::serde_bytes::Bytes>::deserialize(deserializer)?; }