Skip to content

Commit 2c37220

Browse files
committed
Remove std::cmp::cmp2.
It isn't used anywhere and `cmp2(a, b, c, d)` is identical to `(a, b).cmp(&(c, d))`.
1 parent 352c5e7 commit 2c37220

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

src/libstd/cmp.rs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -130,18 +130,6 @@ totalord_impl!(uint)
130130

131131
totalord_impl!(char)
132132

133-
/// Compares (a1, b1) against (a2, b2), where the a values are more significant.
134-
pub fn cmp2<A:TotalOrd,B:TotalOrd>(
135-
a1: &A, b1: &B,
136-
a2: &A, b2: &B) -> Ordering
137-
{
138-
match a1.cmp(a2) {
139-
Less => Less,
140-
Greater => Greater,
141-
Equal => b1.cmp(b2)
142-
}
143-
}
144-
145133
/**
146134
Return `o1` if it is not `Equal`, otherwise `o2`. Simulates the
147135
lexical ordering on a type `(int, int)`.
@@ -206,14 +194,6 @@ mod test {
206194
assert_eq!(12.cmp(-5), Greater);
207195
}
208196

209-
#[test]
210-
fn test_cmp2() {
211-
assert_eq!(cmp2(1, 2, 3, 4), Less);
212-
assert_eq!(cmp2(3, 2, 3, 4), Less);
213-
assert_eq!(cmp2(5, 2, 3, 4), Greater);
214-
assert_eq!(cmp2(5, 5, 5, 4), Greater);
215-
}
216-
217197
#[test]
218198
fn test_int_totaleq() {
219199
assert!(5.equals(&5));

0 commit comments

Comments
 (0)