tokio-rs / bytes

Utilities for working with bytes
MIT License
1.86k stars 278 forks source link

Correct is_unique for Bytes from shared BytesMut #718

Closed zyxw59 closed 1 month ago

zyxw59 commented 2 months ago

The is_unique entry in the vtable for Bytes created from a shared BytesMut just called the shared_is_unique function from the bytes module. However, that function dereferences the data argument as crate::bytes::Shared, but the actual underlying type is crate::bytes_mut::Shared.

Darksonn commented 2 months ago

Thanks. Is there any chance we could have a test that would have caught this?

Darksonn commented 1 month ago

Thank you for fixing this issue!

I'm updating this PR to merge it directly onto the 1.6.0 tag so that I can make a 1.6.1 release with just this change.