From 075b2697e47e9370dcf2d38f01469b38bd4d903e Mon Sep 17 00:00:00 2001 From: Tim Vermeulen Date: Mon, 18 Mar 2019 17:08:53 +0100 Subject: Simplify Iterator::{lt, gt} --- src/libcore/iter/traits/iterator.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/libcore') diff --git a/src/libcore/iter/traits/iterator.rs b/src/libcore/iter/traits/iterator.rs index 84db233c630..6df4a457655 100644 --- a/src/libcore/iter/traits/iterator.rs +++ b/src/libcore/iter/traits/iterator.rs @@ -2451,10 +2451,7 @@ pub trait Iterator { Self::Item: PartialOrd, Self: Sized, { - match self.partial_cmp(other) { - Some(Ordering::Less) => true, - _ => false, - } + self.partial_cmp(other) == Some(Ordering::Less) } /// Determines if the elements of this `Iterator` are lexicographically @@ -2479,10 +2476,7 @@ pub trait Iterator { Self::Item: PartialOrd, Self: Sized, { - match self.partial_cmp(other) { - Some(Ordering::Greater) => true, - _ => false, - } + self.partial_cmp(other) == Some(Ordering::Greater) } /// Determines if the elements of this `Iterator` are lexicographically -- cgit 1.4.1-3-g733a5