]> git.lizzy.rs Git - rust.git/commitdiff
Remove std::cmp::cmp2.
authorSteven Fackler <sfackler@gmail.com>
Sun, 16 Mar 2014 04:04:56 +0000 (21:04 -0700)
committerSteven Fackler <sfackler@gmail.com>
Sun, 16 Mar 2014 04:04:56 +0000 (21:04 -0700)
It isn't used anywhere and `cmp2(a, b, c, d)` is identical to
`(a, b).cmp(&(c, d))`.

src/libstd/cmp.rs

index 023b20287039959e4bb37f02cbdfde03408005e3..5130da44ed5779859bd32481090d5e51a224bf5d 100644 (file)
@@ -130,18 +130,6 @@ fn cmp(&self, other: &$t) -> Ordering {
 
 totalord_impl!(char)
 
-/// Compares (a1, b1) against (a2, b2), where the a values are more significant.
-pub fn cmp2<A:TotalOrd,B:TotalOrd>(
-    a1: &A, b1: &B,
-    a2: &A, b2: &B) -> Ordering
-{
-    match a1.cmp(a2) {
-        Less => Less,
-        Greater => Greater,
-        Equal => b1.cmp(b2)
-    }
-}
-
 /**
 Return `o1` if it is not `Equal`, otherwise `o2`. Simulates the
 lexical ordering on a type `(int, int)`.
@@ -206,14 +194,6 @@ fn test_int_totalord() {
         assert_eq!(12.cmp(-5), Greater);
     }
 
-    #[test]
-    fn test_cmp2() {
-        assert_eq!(cmp2(1, 2, 3, 4), Less);
-        assert_eq!(cmp2(3, 2, 3, 4), Less);
-        assert_eq!(cmp2(5, 2, 3, 4), Greater);
-        assert_eq!(cmp2(5, 5, 5, 4), Greater);
-    }
-
     #[test]
     fn test_int_totaleq() {
         assert!(5.equals(&5));