-
Notifications
You must be signed in to change notification settings - Fork 304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
copy_to_bytes consumes &mut self #473
Comments
copy_to_bytes
consumes &self
They can't just be renamed due to backwards compatibility. The most we could do is deprecate and |
Oh I see, thanks a lot for your reply! Edit: do you think deprecation / renaming is worth pursuing ? |
That is pretty unfortunate... we will probably need to add an alternative :'( |
Actually, wait... it takes |
Given that |
Yea, the question of the name for this method came up when it was renamed, and back then we noticed the same: the name isn't great, but there weren't any other better names. |
Yeah that makes sense, it is documented already so I guess there's not much more we can do then ^^' |
|
Hey everyone,
first of all I'd like to thank you for the tremendous work it took to reach 1.0 🎉
I was quite confused during a webapp's tokio upgrade path because one of my proxies would return empty (warp) response bodies after the migration.
After longer than I'd like to admit ( 😅 ) I zeroed in on the fact that
copy_to_bytes()
took&mut self
, and had a look at the documentation:Consumes len bytes inside self and returns new instance of Bytes with this data.
It confused me quite a bit because that's not the behavior I would expect from
copy_to*
methods.There's probably a rationale behind that, and if you might have already considered
move_to
transfer_to
and other variants, and decided otherwise, feel free to close the issue.The fact it might confuse others as well prompted me to open this issue, and I'd gladly help rename the functions if it makes sense!
Thank's again for your time :)
The text was updated successfully, but these errors were encountered: