-
Notifications
You must be signed in to change notification settings - Fork 13.4k
std::io::Take should have into_inner() method #23755
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
triage: I-nominated A lot of library types have |
triage: P-medium @sfackler indicated that he was interested in making a PR for this and limiting it to the I/O adaptors for now. |
@sfackler Are you still working on this? Or can I take this? |
@frewsxcv you got it. |
Opened a PR: #36019. |
Introduce `into_inner` method on `std::io::Take`. #23755
Shouldn't this be closed? |
Tracking issues (like this one) stay upon until the feature has stabilized. Right now, |
Looks like the |
Yep, was just about to ping the |
Misread what you wrote the first time I read your comment. Added the issue number to the |
@rfcbot fcp merge |
Team member @alexcrichton has proposed to merge this. The next step is review by the rest of the tagged teams: No concerns currently listed. Once these reviewers reach consensus, this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
🔔 This is now entering its final comment period, as per the review above. 🔔 psst @alexcrichton, I wasn't able to add the |
The final comment period is now complete. |
Library stabilizations/deprecations for 1.15 release Stabilized: - `std::iter::Iterator::{min_by, max_by}` - `std::os::*::fs::FileExt` - `std::sync::atomic::Atomic*::{get_mut, into_inner}` - `std::vec::IntoIter::{as_slice, as_mut_slice}` - `std::sync::mpsc::Receiver::try_iter` - `std::os::unix::process::CommandExt::before_exec` - `std::rc::Rc::{strong_count, weak_count}` - `std::sync::Arc::{strong_count, weak_count}` - `std::char::{encode_utf8, encode_utf16}` - `std::cell::Ref::clone` - `std::io::Take::into_inner` Deprecated: - `std::rc::Rc::{would_unwrap, is_unique}` - `std::cell::RefCell::borrow_state` Closes #23755 Closes #27733 Closes #27746 Closes #27784 Closes #28356 Closes #31398 Closes #34931 Closes #35601 Closes #35603 Closes #35918 Closes #36105
It seems like a reasonably obvious thing to do and would be trivial to implement. The only alternative right now is to always use
.by_ref()
before calling.take()
, and that's not always viable (e.g. because theio::Take
needs to be kept around without borrowing the owner of the underlying reader).An example usage would be implementing a message-based protocol on top of a stream protocol, where the messages either have fixed-length frames or have length indicators, I might want to call
.take()
to be able to work with a single message and then.into_inner()
when I'm done to recover the underlying reader.The text was updated successfully, but these errors were encountered: