-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Keep track of initialized bytes in read_to_end #3426
Conversation
We probably want to wait for #3428 to get merged into master before merging this. |
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.
Thanks
@Darksonn a small suggestion for Perhaps a formulation like the following would be better:
Just an idea in passing ... 😄 |
Feel free to submit a PR with that! |
Ok, let me try to find a bit of time to do that 😁. Mostly wanted to run that by you in case you considered and rejected the idea for some reason. |
This keeps track of the number of initialized bytes inside
read_to_end
.Note that old implementation is actually unsound as replacing the buffer inside
ReadBuf
does not require unsafe, and it does not check whether the pointer has been changed.