Skip to content
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 Stdin::lines, Stdin::split forwarder methods #86847

Merged
merged 1 commit into from
Jul 21, 2021

Conversation

tlyu
Copy link
Contributor

@tlyu tlyu commented Jul 3, 2021

Add forwarder methods Stdin::lines and Stdin::split, which consume
and lock a Stdin handle, and forward on to the corresponding BufRead
methods. This should make it easier for beginners to use those iterator
constructors without explicitly dealing with locks or lifetimes.

Replaces #86412.
Based on #86846 to get the tracking issue number for the stdio_locked feature. Rebased after merge, so it's only one commit now.

r? @joshtriplett
@rustbot label +A-io +C-enhancement +D-newcomer-roadblock +T-libs-api

@rustbot rustbot added A-io Area: `std::io`, `std::fs`, `std::net` and `std::path` C-enhancement Category: An issue proposing an enhancement or a PR with one. D-newcomer-roadblock Diagnostics: Confusing error or lint; hard to understand for new users. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Jul 3, 2021
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 3, 2021
@tlyu
Copy link
Contributor Author

tlyu commented Jul 3, 2021

@joshtriplett leaving this as draft in case you think I should first file a tracking issue for this one as well.

Add forwarder methods `Stdin::lines` and `Stdin::split`, which consume
and lock a `Stdin` handle, and forward on to the corresponding `BufRead`
methods. This should make it easier for beginners to use those iterator
constructors without explicitly dealing with locks or lifetimes.
@tlyu tlyu marked this pull request as ready for review July 13, 2021 04:45
@joshtriplett
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Jul 21, 2021

📌 Commit 339ce4f has been approved by joshtriplett

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 21, 2021
@bors
Copy link
Contributor

bors commented Jul 21, 2021

⌛ Testing commit 339ce4f with merge cf932aa...

@bors
Copy link
Contributor

bors commented Jul 21, 2021

☀️ Test successful - checks-actions
Approved by: joshtriplett
Pushing cf932aa to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jul 21, 2021
@bors bors merged commit cf932aa into rust-lang:master Jul 21, 2021
@rustbot rustbot added this to the 1.55.0 milestone Jul 21, 2021
@tlyu tlyu deleted the stdin-forwarders branch July 22, 2021 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-io Area: `std::io`, `std::fs`, `std::net` and `std::path` C-enhancement Category: An issue proposing an enhancement or a PR with one. D-newcomer-roadblock Diagnostics: Confusing error or lint; hard to understand for new users. merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants