Skip to content

Conversation

@Lucretiel
Copy link
Contributor

This pull request proposes & implements two new methods on Iterators: fold_self and try_fold_self. These are variants of fold and try_fold that use the first element in the iterator as the initial accumulator.

Let me know if a public feature like this requires an RFC, or if this pull request is sufficient as place for discussion.

@rust-highfive
Copy link
Contributor

r? @joshtriplett

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 19, 2019
/// Find the maximum value:
///
/// ```
/// fn find_max<I>(iter: I) -> Option<I::Item>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aside from the behavior for Equal, this is just Iterator::max -- maybe a different example can be provided?

/// ```
#[inline]
#[unstable(feature = "iterator_fold_self", issue = "60103")]
fn fold_self<F>(mut self, mut f: F) -> Option<Self::Item>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Co-Authored-By: Lucretiel <[email protected]>
@scottmcm scottmcm added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label Apr 24, 2019
@Dylan-DPC-zz
Copy link

ping from triage @joshtriplett any updates?

@Lucretiel
Copy link
Contributor Author

Sorry for the delay, I didn't realize my fork wasn't updated with upstream master, and so I believed it when it said I was all up to date after a pull + rebase. There was a pretty substantial refactor of the core::iter file layout so I'll need to migrate to that; I'll try to take care of it tonight.

@Dylan-DPC-zz Dylan-DPC-zz added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 27, 2019
@Dylan-DPC-zz
Copy link

ping from triage @Lucretiel any updates?

@jonas-schievink
Copy link
Contributor

Closing due to inactivity, but feel free to resubmit with the necessary changes!

@jonas-schievink jonas-schievink added S-inactive Status: Inactive and waiting on the author. This is often applied to closed PRs. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 18, 2019
@Lucretiel
Copy link
Contributor Author

Done! Will re-opening the PR automatically bring in my latest branch changes?

@jonas-schievink
Copy link
Contributor

@Lucretiel I think you'll have to open another PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-inactive Status: Inactive and waiting on the author. This is often applied to closed PRs. 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.

7 participants