diff options
| author | Ashley Mannix <ashleymannix@live.com.au> | 2019-09-09 08:02:26 +1000 |
|---|---|---|
| committer | Ashley Mannix <ashleymannix@live.com.au> | 2019-09-09 08:05:32 +1000 |
| commit | 91fd8efd265b60a635aff89d1c2d0a8aea45fdf9 (patch) | |
| tree | 53becc19526de413917de44ec1c96fd6468d61df /src | |
| parent | 2b8116dced2c6c5d02e1c4359e89dc0919d6001b (diff) | |
| download | rust-91fd8efd265b60a635aff89d1c2d0a8aea45fdf9.tar.gz rust-91fd8efd265b60a635aff89d1c2d0a8aea45fdf9.zip | |
document the unstable iter_order_by library feature
Diffstat (limited to 'src')
| -rw-r--r-- | src/doc/unstable-book/src/iter-order-by.md | 9 | ||||
| -rw-r--r-- | src/libcore/iter/traits/iterator.rs | 6 |
2 files changed, 12 insertions, 3 deletions
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 00000000000..1ed97872c88 --- /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 c09df3f7f22..266f1e6a781 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<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, |
