]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/neg_cmp_op_on_partial_ord.rs
iterate List by value
[rust.git] / tests / ui / neg_cmp_op_on_partial_ord.rs
index 483972bb41b3ba982128898f497b5db55725b3bc..856a430ba2b55012c413b2506862addb039a23c7 100644 (file)
@@ -4,18 +4,16 @@
 
 use std::cmp::Ordering;
 
-#[warn(neg_cmp_op_on_partial_ord)]
+#[warn(clippy::neg_cmp_op_on_partial_ord)]
 fn main() {
-
     let a_value = 1.0;
     let another_value = 7.0;
 
     // --- Bad ---
 
-
     // Not Less but potentially Greater, Equal or Uncomparable.
     let _not_less = !(a_value < another_value);
-    
+
     // Not Less or Equal but potentially Greater or Uncomparable.
     let _not_less_or_equal = !(a_value <= another_value);
 
@@ -25,12 +23,10 @@ fn main() {
     // Not Greater or Equal but potentially Less or Uncomparable.
     let _not_greater_or_equal = !(a_value >= another_value);
 
-
     // --- Good ---
 
-
     let _not_less = match a_value.partial_cmp(&another_value) {
-        None | Some(Ordering::Greater) | Some(Ordering::Equal)  => true,
+        None | Some(Ordering::Greater) | Some(Ordering::Equal) => true,
         _ => false,
     };
     let _not_less_or_equal = match a_value.partial_cmp(&another_value) {
@@ -46,10 +42,8 @@ fn main() {
         _ => false,
     };
 
-
     // --- Should not trigger ---
 
-
     let _ = a_value < another_value;
     let _ = a_value <= another_value;
     let _ = a_value > another_value;
@@ -59,9 +53,9 @@ fn main() {
 
     // Issue 2856: False positive on assert!()
     //
-    // The macro always negates the result of the given comparision in its
+    // The macro always negates the result of the given comparison in its
     // internal check which automatically triggered the lint. As it's an
-    // external macro there was no chance to do anything about it which lead
+    // external macro there was no chance to do anything about it which led
     // to a whitelisting of all external macros.
     assert!(a_value < another_value);
 }