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
Hi,
I created a BytesBuf with some data and removed the leading n bytes with advance(n). After some more computations I converted the result to an immutable Bytes value. My expectation was that the content of the BytesMut and Bytes would be identical. Instead the Bytes still contained the discared bytes.
Oh yea, that seems like a bug in freeze. Looking at the source, it seems to grab the original size so it can properly create a Bytes, but forgets to advance it forward if need be.
Hi,
I created a
BytesBuf
with some data and removed the leading n bytes withadvance(n)
. After some more computations I converted the result to an immutableBytes
value. My expectation was that the content of theBytesMut
andBytes
would be identical. Instead theBytes
still contained the discared bytes.Example program:
https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=ffaabad67256d03d04f6478d60b93381
As a work-around I use
split_to
instead ofadvance
and ignore the return value.The text was updated successfully, but these errors were encountered: