From 2c372201d447cbf4d3e1e2d675d1776e765f3b65 Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Sat, 15 Mar 2014 21:04:56 -0700 Subject: [PATCH] Remove std::cmp::cmp2. It isn't used anywhere and `cmp2(a, b, c, d)` is identical to `(a, b).cmp(&(c, d))`. --- src/libstd/cmp.rs | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/src/libstd/cmp.rs b/src/libstd/cmp.rs index 023b20287039..5130da44ed57 100644 --- a/src/libstd/cmp.rs +++ b/src/libstd/cmp.rs @@ -130,18 +130,6 @@ totalord_impl!(uint) totalord_impl!(char) -/// Compares (a1, b1) against (a2, b2), where the a values are more significant. -pub fn cmp2( - 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 @@ mod test { 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));