-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Tracking issue Iterator map_while #68537
Comments
@ollie27 noticed in #66577 (comment) that How do we choose? Remove the Personally I would prefer removing the |
@WaffleLapkin So the reasoning that it shouldn't impl Btw, since |
@Boscop Yes, one of the reasons is that user might want to continue. But it is a rare case, so it's not so important. Not sure if we need unfused
|
…_while, r=LukasKalbertodt Remove `finished` flag from `MapWhile` This PR removes `finished` flag from `MapWhile` as been proposed in rust-lang#66577 (comment). This also resolves open questions of the tracking issue (rust-lang#68537): - `MapWhile` can't implement both + `DoubleEndedIterator` (discussed in rust-lang#66577 (comment) and following comments) + `FusedIterator` (this pr removes `finished` flag, so `MapWhile` isn't fused anymore) - Debug output (this pr removes `finished` flag, so there is no question in including it in debug output) r? @Mark-Simulacrum
Ready to stabilize? |
This method overall is very, very similar to // These two yield the same items.
iter.map_while(predicate)
iter.scan((), |(), item| predicate(item)).fuse() Is there any impl ( |
Wow, I haven't thought that there is such a similar adapter... @HeroicKatora please note that after #68820 However, I'm still in favour of adding |
Oh, by the way, @Mark-Simulacrum , as #68820 is merged, could you remove current "open questions" from the issue?
|
I agree with @WaffleLapkin that the |
Is there any status update on stabilization? This would be such a valuable function for some cases: I currently have the exact same case that is in the documentation:
and I am not comfortable having |
@kamulos since this method was added almost a year ago and all unresolved questions were since resolved, I believe we can start the stabilization process. Someone from the libs team needs to start an FCP. |
@rfcbot merge |
Team member @m-ou-se has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), 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. 🔔 |
|
@kamulos BY the way |
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. The RFC will be merged soon. |
So, I'd say |
…le, r=kennytm Stabilize `Iterator::map_while` Per the FCP: rust-lang#68537 (comment) This PR stabilizes `Iterator::map_while` and `iter::MapWhile` in Rust 1.57.
Stabilized in #89086. |
Added in #66577.
Open questions:
The text was updated successfully, but these errors were encountered: