]> 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 c8edba32219eb06b663198e28c091a414fe53a53..856a430ba2b55012c413b2506862addb039a23c7 100644 (file)
@@ -1,15 +1,3 @@
-// Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-
-#![feature(tool_lints)]
-
 //! This test case utilizes `f64` an easy example for `PartialOrd` only types
 //! but the lint itself actually validates any expression where the left
 //! operand implements `PartialOrd` but not `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);
 
@@ -37,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) {
@@ -58,10 +42,8 @@ fn main() {
         _ => false,
     };
 
-
     // --- Should not trigger ---
 
-
     let _ = a_value < another_value;
     let _ = a_value <= another_value;
     let _ = a_value > another_value;