diff options
Diffstat (limited to 'src/libcore/iter.rs')
| -rw-r--r-- | src/libcore/iter.rs | 84 |
1 files changed, 0 insertions, 84 deletions
diff --git a/src/libcore/iter.rs b/src/libcore/iter.rs index 959b6a97c5c..f063c6b0676 100644 --- a/src/libcore/iter.rs +++ b/src/libcore/iter.rs @@ -4750,87 +4750,3 @@ impl<T> ExactSizeIterator for Once<T> { pub fn once<T>(value: T) -> Once<T> { Once { inner: Some(value).into_iter() } } - -/// Functions for lexicographical ordering of sequences. -/// -/// Lexicographical ordering through `<`, `<=`, `>=`, `>` requires -/// that the elements implement both `PartialEq` and `PartialOrd`. -/// -/// If two sequences are equal up until the point where one ends, -/// the shorter sequence compares less. -#[rustc_deprecated(since = "1.4.0", reason = "use the equivalent methods on `Iterator` instead")] -#[unstable(feature = "iter_order_deprecated", reason = "needs review and revision", - issue = "27737")] -pub mod order { - use cmp; - use cmp::{Eq, Ord, PartialOrd, PartialEq}; - use option::Option; - use super::Iterator; - - /// Compare `a` and `b` for equality using `Eq` - pub fn equals<A, L, R>(a: L, b: R) -> bool where - A: Eq, - L: Iterator<Item=A>, - R: Iterator<Item=A>, - { - a.eq(b) - } - - /// Order `a` and `b` lexicographically using `Ord` - pub fn cmp<A, L, R>(a: L, b: R) -> cmp::Ordering where - A: Ord, - L: Iterator<Item=A>, - R: Iterator<Item=A>, - { - a.cmp(b) - } - - /// Order `a` and `b` lexicographically using `PartialOrd` - pub fn partial_cmp<L: Iterator, R: Iterator>(a: L, b: R) -> Option<cmp::Ordering> where - L::Item: PartialOrd<R::Item> - { - a.partial_cmp(b) - } - - /// Compare `a` and `b` for equality (Using partial equality, `PartialEq`) - pub fn eq<L: Iterator, R: Iterator>(a: L, b: R) -> bool where - L::Item: PartialEq<R::Item>, - { - a.eq(b) - } - - /// Compares `a` and `b` for nonequality (Using partial equality, `PartialEq`) - pub fn ne<L: Iterator, R: Iterator>(a: L, b: R) -> bool where - L::Item: PartialEq<R::Item>, - { - a.ne(b) - } - - /// Returns `a` < `b` lexicographically (Using partial order, `PartialOrd`) - pub fn lt<L: Iterator, R: Iterator>(a: L, b: R) -> bool where - L::Item: PartialOrd<R::Item>, - { - a.lt(b) - } - - /// Returns `a` <= `b` lexicographically (Using partial order, `PartialOrd`) - pub fn le<L: Iterator, R: Iterator>(a: L, b: R) -> bool where - L::Item: PartialOrd<R::Item>, - { - a.le(b) - } - - /// Returns `a` > `b` lexicographically (Using partial order, `PartialOrd`) - pub fn gt<L: Iterator, R: Iterator>(a: L, b: R) -> bool where - L::Item: PartialOrd<R::Item>, - { - a.gt(b) - } - - /// Returns `a` >= `b` lexicographically (Using partial order, `PartialOrd`) - pub fn ge<L: Iterator, R: Iterator>(a: L, b: R) -> bool where - L::Item: PartialOrd<R::Item>, - { - a.ge(b) - } -} |
