document the unstable iter_order_by library feature
This commit is contained in:
parent
2b8116dced
commit
91fd8efd26
2 changed files with 12 additions and 3 deletions
9
src/doc/unstable-book/src/iter-order-by.md
Normal file
9
src/doc/unstable-book/src/iter-order-by.md
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
# `iter_order_by`
|
||||
|
||||
The tracking issue for this feature is: [#64295]
|
||||
|
||||
[#64295]: https://github.com/rust-lang/rust/issues/64295
|
||||
|
||||
------------------------
|
||||
|
||||
Add `cmp_by`, `partial_cmp_by` and `eq_by` methods to `Iterator` in the same vein as `max_by` and `min_by`.
|
||||
|
|
@ -2585,7 +2585,7 @@ pub trait Iterator {
|
|||
/// assert_eq!(xs.iter().cmp_by(&ys, |&x, &y| (x * x).cmp(&y)), Ordering::Equal);
|
||||
/// assert_eq!(xs.iter().cmp_by(&ys, |&x, &y| (2 * x).cmp(&y)), Ordering::Greater);
|
||||
/// ```
|
||||
#[unstable(feature = "iter_order_by", issue = "0")]
|
||||
#[unstable(feature = "iter_order_by", issue = "64295")]
|
||||
fn cmp_by<I, F>(mut self, other: I, mut cmp: F) -> Ordering
|
||||
where
|
||||
Self: Sized,
|
||||
|
|
@ -2668,7 +2668,7 @@ pub trait Iterator {
|
|||
/// Some(Ordering::Greater)
|
||||
/// );
|
||||
/// ```
|
||||
#[unstable(feature = "iter_order_by", issue = "0")]
|
||||
#[unstable(feature = "iter_order_by", issue = "64295")]
|
||||
fn partial_cmp_by<I, F>(mut self, other: I, mut partial_cmp: F) -> Option<Ordering>
|
||||
where
|
||||
Self: Sized,
|
||||
|
|
@ -2733,7 +2733,7 @@ pub trait Iterator {
|
|||
///
|
||||
/// assert!(xs.iter().eq_by(&ys, |&x, &y| x * x == y));
|
||||
/// ```
|
||||
#[unstable(feature = "iter_order_by", issue = "0")]
|
||||
#[unstable(feature = "iter_order_by", issue = "64295")]
|
||||
fn eq_by<I, F>(mut self, other: I, mut eq: F) -> bool
|
||||
where
|
||||
Self: Sized,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue