@@ -1369,7 +1369,7 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
1369
1369
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1370
1370
#[ rustc_diagnostic_item = "cmp_partialord_lt" ]
1371
1371
fn lt ( & self , other : & Rhs ) -> bool {
1372
- matches ! ( self . partial_cmp( other) , Some ( Less ) )
1372
+ self . partial_cmp ( other) . is_some_and ( Ordering :: is_lt )
1373
1373
}
1374
1374
1375
1375
/// Tests less than or equal to (for `self` and `other`) and is used by the
@@ -1387,7 +1387,7 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
1387
1387
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1388
1388
#[ rustc_diagnostic_item = "cmp_partialord_le" ]
1389
1389
fn le ( & self , other : & Rhs ) -> bool {
1390
- matches ! ( self . partial_cmp( other) , Some ( Less | Equal ) )
1390
+ self . partial_cmp ( other) . is_some_and ( Ordering :: is_le )
1391
1391
}
1392
1392
1393
1393
/// Tests greater than (for `self` and `other`) and is used by the `>`
@@ -1405,7 +1405,7 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
1405
1405
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1406
1406
#[ rustc_diagnostic_item = "cmp_partialord_gt" ]
1407
1407
fn gt ( & self , other : & Rhs ) -> bool {
1408
- matches ! ( self . partial_cmp( other) , Some ( Greater ) )
1408
+ self . partial_cmp ( other) . is_some_and ( Ordering :: is_gt )
1409
1409
}
1410
1410
1411
1411
/// Tests greater than or equal to (for `self` and `other`) and is used by
@@ -1423,7 +1423,7 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
1423
1423
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1424
1424
#[ rustc_diagnostic_item = "cmp_partialord_ge" ]
1425
1425
fn ge ( & self , other : & Rhs ) -> bool {
1426
- matches ! ( self . partial_cmp( other) , Some ( Greater | Equal ) )
1426
+ self . partial_cmp ( other) . is_some_and ( Ordering :: is_ge )
1427
1427
}
1428
1428
}
1429
1429
0 commit comments