Lines Matching defs:cmp

3299 use std::cmp::PartialEq;
3495 use std::cmp::Ordering::{Equal, Greater, Less};
4583 assert_eq!("1234".cmp("123"), Greater);
4584 assert_eq!("123".cmp("1234"), Less);
4585 assert_eq!("1234".cmp("1234"), Equal);
4586 assert_eq!("12345555".cmp("123456"), Less);
4587 assert_eq!("22".cmp("1234"), Greater);
7000 let cmp: &[isize] = &[1, 2, 3, 4, 5];
7001 assert_eq!(&x[..], cmp);
7002 let cmp: &[isize] = &[3, 4, 5];
7003 assert_eq!(&x[2..], cmp);
7004 let cmp: &[isize] = &[1, 2, 3];
7005 assert_eq!(&x[..3], cmp);
7006 let cmp: &[isize] = &[2, 3, 4];
7007 assert_eq!(&x[1..4], cmp);
7010 let cmp: &[isize] = &[1, 2, 3, 4, 5];
7011 assert_eq!(&x[..], cmp);
7012 let cmp: &[isize] = &[3, 4, 5];
7013 assert_eq!(&x[2..], cmp);
7014 let cmp: &[isize] = &[1, 2, 3];
7015 assert_eq!(&x[..3], cmp);
7016 let cmp: &[isize] = &[2, 3, 4];
7017 assert_eq!(&x[1..4], cmp);
9056 use std::cmp::PartialEq;
9248 use std::cmp::Ordering::{self, Equal, Greater, Less};
9654 v.sort_by(|a, b| a.cmp(b));
9659 v.sort_by(|a, b| b.cmp(a));
9737 v.sort_by(|&(a, _), &(b, _)| a.cmp(&b));
9928 assert_eq!($a.cmp($b), Greater);
9932 assert_eq!($a.cmp($b), Less);
9936 assert_eq!($a.cmp($b), Equal);
10907 fn cmp(&self, other: &Self) -> Ordering {
10928 a.cmp(b)
10949 a.cmp(b)
12894 assert_eq!(deque.binary_search_by(|&(v,)| v.cmp(&3)), Ok(2));
12895 assert_eq!(deque.binary_search_by(|&(v,)| v.cmp(&4)), Err(3));
13701 use std::cmp;
13718 fn partial_cmp(&self, other: &Self) -> Option<cmp::Ordering> {
14427 use core::cmp;
14847 let cap = cmp::max(self.cap * 2, required_cap);
14848 let cap = cmp::max(Self::MIN_NON_ZERO_CAP, cap);
18820 use core::cmp::Ordering;
19164 fn cmp(&self, other: &Self) -> Ordering {
19165 Ord::cmp(&**self, &**other)
19748 use core::cmp::Ordering;
21074 /// use std::cmp::Ordering;
21162 /// The two are compared by calling `cmp()` on their inner values.
21168 /// use std::cmp::Ordering;
21172 /// assert_eq!(Ordering::Less, five.cmp(&Rc::new(6)));
21175 fn cmp(&self, other: &Rc<T>) -> Ordering {
21176 (**self).cmp(&**other)
22057 use core::cmp::Ordering::{self, Less};
22271 /// v.sort_by(|a, b| a.cmp(b));
22275 /// v.sort_by(|a, b| b.cmp(a));
23279 use core::cmp::Ordering;
25403 /// use std::cmp::Ordering;
25485 /// The two are compared by calling `cmp()` on their inner values.
25491 /// use std::cmp::Ordering;
25495 /// assert_eq!(Ordering::Less, five.cmp(&Arc::new(6)));
25497 fn cmp(&self, other: &Arc<T>) -> Ordering {
25498 (**self).cmp(&**other)
26959 use core::cmp::Ordering;
28672 fn cmp(&self, other: &Self) -> Ordering {
28673 self.iter().cmp(other)
29284 let (a_next, b_next) = self.0.nexts(|a: &(K, V), b: &(K, V)| K::cmp(&a.0, &b.0));
29289 use std::cmp::Ordering;
29395 fn cmp(&self, other: &Self) -> Ordering {
29396 self.id().cmp(&other.id())
29436 use std::cmp::Ordering::{self, *};
29450 Some(self.cmp(other))
29455 fn cmp(&self, other: &Self) -> Ordering {
29466 self.cmp(&other) == Equal
29496 Some(self.cmp(other))
29501 fn cmp(&self, other: &Self) -> Ordering {
29503 let ord = self.0.cmp(&other.0);
29520 use core::cmp::Ordering;
29729 match key.cmp(k.borrow()) {
29794 use core::cmp::Ordering;
31793 fn cmp(&self, other: &BTreeMap<K, V>) -> Ordering {
31794 self.iter().cmp(other.iter())
32171 use core::cmp::Ordering::{Equal, Greater, Less};
32172 use core::cmp::{max, min};
32195 /// [`Ord`]: core::cmp::Ord
32484 inner: match (self_min.cmp(other_max), self_max.cmp(other_min)) {
32573 inner: match (self_min.cmp(other_max), self_max.cmp(other_min)) {
32744 match self_min.cmp(other_min) {
32751 match self_max.cmp(other_max) {
32770 match other_iter.next().map_or(Less, |other1| self1.cmp(other1)) {
33582 match other_iter.peek().map_or(Less, |other_next| self_next.cmp(other_next)) {
33635 let (a_next, b_next) = self.0.nexts(Self::Item::cmp);
33684 match a_next.cmp(b_next) {
33729 let (a_next, b_next) = self.0.nexts(Self::Item::cmp);
34291 use std::cmp::Ordering;
34781 fn cmp(&self, other: &Self) -> Ordering {
34782 self.0.cmp(&other.0)
35568 use std::cmp::Ordering;
36354 Some(self.cmp(other))
36360 fn cmp(&self, other: &Self) -> Ordering {
36361 let ord = self.0.cmp(&other.0);
36959 fn cmp(&self, _: &Self) -> Ordering {
37824 use core::cmp::Ordering;
37879 cmp: Cmp,
37901 match cmp(a1, b1) {
40293 use core::cmp::{self};
40339 let part = cmp::min(self.a0.len(), self.b0.len());
40367 use core::cmp::{self, Ordering};
40635 cmp::min(diff(dst, src), self.cap() - diff(dst, src)) + len <= self.cap(),
40834 let cap = cmp::max(capacity + 1, MINIMUM_CAPACITY + 1).next_power_of_two();
41139 let min_capacity = cmp::min(min_capacity, self.capacity());
41142 let target_cap = cmp::max(cmp::max(min_capacity, self.len()) + 1, MINIMUM_CAPACITY + 1)
42526 /// buf.make_contiguous().sort_by(|a, b| b.cmp(a));
42807 self.binary_search_by(|e| e.cmp(x))
42841 /// assert_eq!(deque.binary_search_by(|x| x.cmp(&13)), Ok(9));
42842 /// assert_eq!(deque.binary_search_by(|x| x.cmp(&4)), Err(7));
42843 /// assert_eq!(deque.binary_search_by(|x| x.cmp(&100)), Err(13));
42844 /// let r = deque.binary_search_by(|x| x.cmp(&1));
42910 self.binary_search_by(|k| f(k).cmp(b))
43061 fn cmp(&self, other: &VecDeque<A>) -> Ordering {
43062 self.iter().cmp(other.iter())
43219 let min_cap = cmp::max(MINIMUM_CAPACITY, len) + 1;
43220 let cap = cmp::max(min_cap, other.capacity()).next_power_of_two();
44287 //! use std::cmp::Ordering;
44300 //! fn cmp(&self, other: &Self) -> Ordering {
44304 //! other.cost.cmp(&self.cost)
44305 //! .then_with(|| self.position.cmp(&other.position))
44312 //! Some(self.cmp(other))
44481 /// Either `std::cmp::Reverse` or a custom `Ord` implementation can be used to
44487 /// use std::cmp::Reverse;
46864 use core::cmp::{self, Ordering};
47745 self.buf.shrink_to_fit(cmp::max(self.len, min_capacity));
49447 /// Implements comparison of vectors, [lexicographically](core::cmp::Ord#lexicographical-comparison).
49459 /// Implements ordering of vectors, [lexicographically](core::cmp::Ord#lexicographical-comparison).
49463 fn cmp(&self, other: &Self) -> Ordering {
49464 Ord::cmp(&**self, &**other)
50307 use core::cmp::Ordering;
51295 fn cmp(&self, other: &Self) -> Ordering {
51296 Ord::cmp(&**self, &**other)