You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I try to use serde for serialization data from my structs to BytesMut (it's default buffer type for tokio encoder). For serialization [u8; 16] serde call serialize_u8 method:
thread 'tokio-runtime-worker-2' panicked at 'assertion failed: len < INLINE_CAP', /home/nnovikov/.cargo/registry/src/github.com-1ecc6299db9ec823/bytes-0.4.12/src/bytes.rs:1875:13
BytesMut crated with capacity 1024 bytes. Serialized structure have size about 50-60 bytes.
Is it possible bug in bytes? Or I am doing something wrong?
Dependence from Cargo.toml:
bytes = { version = "0.4.12", features = ["serde"] }
The text was updated successfully, but these errors were encountered:
Actually looks like this may be intentional: put_u8 is explicitly documented to panic if there is not enough remaining capacity and that's what it does (in bytes 0.4 series which did not implicitly increase capacity).
I try to use serde for serialization data from my structs to BytesMut (it's default buffer type for tokio encoder). For serialization [u8; 16] serde call serialize_u8 method:
and paniced with
BytesMut crated with capacity 1024 bytes. Serialized structure have size about 50-60 bytes.
Is it possible bug in bytes? Or I am doing something wrong?
Dependence from Cargo.toml:
The text was updated successfully, but these errors were encountered: