-
Notifications
You must be signed in to change notification settings - Fork 329
Conversation
The following sequence:
let v1: Vec<u8> = b1.into();
Would fail to drop owner (the expectation for the vtable *_to_vec is that it takes ownership of the instance, but owned_to_vec was not). Since owned_to_mut depended on owned_to_vec and was correctly dropping, the fix was to move the drop logic from owned_to_mut to owned_to_vec.
This change adds an appropriate test for ::into() for Bytes::from_owner.
Darksonn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you.
Should the I also wonder if the |
|
Yes, that's an excellent idea. Do you want to submit a PR to rename them? I did run the test locally before merging this, and the test failed without this fix. |
Will do.
The new |
consume `self`, as referred to in the following clippy lint:
<https://rust-lang.github.io/rust-clippy/stable/index.html#wrong_self_convention>
The hope is by following convention we avoid bugs such as that fixed
in tokio-rs#773.
consume `self`, as referred to in the following clippy lint:
<https://rust-lang.github.io/rust-clippy/stable/index.html#wrong_self_convention>
This may help avoid bugs such as that fixed in tokio-rs#773.
The patch to tests/test_bytes.rs is no longer necessary because the
change has been sent upstream.
Link: tokio-rs/bytes#773
Change-Id: I9d0d6289769fb07b378ad030d269d3edbe52b7b3