Change:
<!-- Thank you for creating a tracking issue! Tracking issues are for tracking a feature from implementation to stabilisation. Make sure to include the relevant RFC for the feature if it has one. Otherwise provide a short summary of the feature and link any relevant PRs or issues, and remove any sections that are not relevant to the feature. Remember to add team labels to the tracking issue. For a language team feature, this would e.g., be . Such a feature should also be labeled with e.g., . This label is used to associate issues (e.g., bugs and design questions) to the feature. --This is a tracking issue for the feature (). The feature gate for the issue is . Tracking issues are used to record the overall progress of implementation. They are also uses as hubs connecting to other relevant issues, e.g., bugs or open design questions. A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature. Instead, open a dedicated issue for the specific matter and add the relevant feature gate label. <!-- Include each step required to complete the feature. Typically this is a PR implementing a feature, followed by a PR that stabilises the feature. However for larger features an implementation could be broken up into multiple PRs. --- [x] Implement the RFC [ ] Adjust documentation ([see instructions on rustc-dev-guide][doc-guide]) [ ] Stabilization PR ([see instructions on rustc-dev-guide][stabilization-guide]) [stabilization-guide]: https://rustc-dev- [doc-guide]: https://rustc-dev- <!-- Include any open questions that need to be answered before the feature can be stabilised. --- Should be named or ? Should be named or ?
modify labels: T-libs
I don't think the methods should be renamed to something else, becuase also has a method, and should use the same name but with the component. Also, if these questions are resolved and there are no other blockers, I would like to go ahead and stabilize this feature.

Discussion:
/// # Examples /// Consume a number if it's equal to 0. /// ``` <del> /// #![feature(peekable_next_if)] </del> /// let mut iter = (0..5).peekable(); /// // The first item of the iterator is 0; consume it. /// assert_eq!(iter.next_if(|&x| x == 0), Some(0));

/// /// Consume any number less than 10. /// ``` <del> /// #![feature(peekable_next_if)] </del> /// let mut iter = (1..20).peekable(); /// // Consume all numbers less than 10 /// while iter.next_if(|&x| x < 10).is_some() {} /// // The next value returned will be 10 /// assert_eq!(iter.next(), Some(10)); /// ``` <del> #[unstable(feature = "peekable_next_if", issue = "72480")] </del> <ins> #[stable(feature = "peekable_next_if", since = "1.51.0")] </ins> pub fn next_if(&mut self, func: impl FnOnce(&I::Item) -> bool) -> Option<I::Item> { match self.next() { Some(matched) if func(&matched) => Some(matched),

/// # Example /// Consume a number if it's equal to 0. /// ``` <del> /// #![feature(peekable_next_if)] </del> /// let mut iter = (0..5).peekable(); /// // The first item of the iterator is 0; consume it. /// assert_eq!(iter.next_if_eq(&0), Some(0));

/// // `next_if_eq` saves the value of the next item if it was not equal to `expected`. /// assert_eq!(iter.next(), Some(1)); /// ``` <del> #[unstable(feature = "peekable_next_if", issue = "72480")] </del> <ins> #[stable(feature = "peekable_next_if", since = "1.51.0")] </ins> pub fn next_if_eq<T>(&mut self, expected: &T) -> Option<I::Item> where T: ?Sized,

#![feature(never_type)] #![feature(unwrap_infallible)] #![feature(option_unwrap_none)] <del> #![feature(peekable_next_if)] </del> #![feature(peekable_peek_mut)] #![feature(partition_point)] #![feature(once_cell)]

#![feature(in_band_lifetimes)] #![feature(nll)] #![feature(or_patterns)] <del> #![feature(peekable_next_if)] </del> #![feature(test)] #![feature(crate_visibility_modifier)] #![feature(never_type)]