serde-rs / bytes

Wrapper types to enable optimized handling of &[u8] and Vec<u8>
Apache License 2.0
317 stars 37 forks source link

fix: actually use optimizations for deserializing &[u8] #31

Closed Xiretza closed 2 years ago

Xiretza commented 2 years ago

The Deserialize impl for &[u8] needs to forward to the specialized one for Bytes, not the other way around. Fixes #30.

erickt commented 2 years ago

As I explained in https://github.com/serde-rs/bytes/issues/30#issuecomment-1139761834, I don't think this is necessary, since calling the serde::Deserializeimpl for&'a [u8]should be equivalent to callingserde_bytes::Bytes::deserialize`.

erickt commented 2 years ago

Please feel free to reopen if I missed anything though!