From 91fd8efd265b60a635aff89d1c2d0a8aea45fdf9 Mon Sep 17 00:00:00 2001 From: Ashley Mannix Date: Mon, 9 Sep 2019 08:02:26 +1000 Subject: [PATCH] document the unstable iter_order_by library feature --- src/doc/unstable-book/src/iter-order-by.md | 9 +++++++++ src/libcore/iter/traits/iterator.rs | 6 +++--- 2 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 src/doc/unstable-book/src/iter-order-by.md diff --git a/src/doc/unstable-book/src/iter-order-by.md b/src/doc/unstable-book/src/iter-order-by.md new file mode 100644 index 000000000000..1ed97872c881 --- /dev/null +++ b/src/doc/unstable-book/src/iter-order-by.md @@ -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`. diff --git a/src/libcore/iter/traits/iterator.rs b/src/libcore/iter/traits/iterator.rs index c09df3f7f22c..266f1e6a7810 100644 --- a/src/libcore/iter/traits/iterator.rs +++ b/src/libcore/iter/traits/iterator.rs @@ -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(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(mut self, other: I, mut partial_cmp: F) -> Option 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(mut self, other: I, mut eq: F) -> bool where Self: Sized,