-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Add BufRead::skip_until
#98943
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
Add BufRead::skip_until
#98943
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @thomcc (or someone else) soon. Please see the contribution instructions for more information. |
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
@rustbot label +T-libs-api -T-libs |
Hi, thanks for the PR. As the bot mentioned, you should file an API change proposal for this. This should be done here: https://github.com/rust-lang/libs-team/issues/new?assignees=&labels=api-change-proposal%2C+T-libs-api&template=api-change-proposal.md&title=%28My+API+Change+Proposal%29 See also: https://std-dev-guide.rust-lang.org/feature-lifecycle/api-change-proposals.html, which describes the process. |
ACP here: rust-lang/libs-team#63 Do create a tracking issue though. |
Can you add some tests for this? @rustbot author |
OK - added a test. There's also the doc comment test which is already present. Is there any reason for the |
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.
One nit. Otherwise looks fine.
@rustbot author |
The extra `\0` in this commit is needed because the assertion on line 49 will fail otherwise (as `skip_until` stops reading on EOF and therefore does not read a trailing `\0`, returning 6 read bytes rather than the expected 7)
@rustbot ready |
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!
Thomcc's request to test the return value of skip_until has been addressed.
@bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (e68f935): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 675.978s -> 675.904s (-0.01%) |
Alternative version of
BufRead::read_until
that simply discards data, rather than copying it into a buffer.Useful for situations like skipping irrelevant data in a binary file format that is NUL-terminated.
Benchmark