]> git.lizzy.rs Git - rust.git/commitdiff
update lint docs
authorHaraman Johal <haraman.johal@oxfordni.com>
Tue, 15 Sep 2020 16:29:41 +0000 (17:29 +0100)
committerHaraman Johal <haraman.johal@oxfordni.com>
Tue, 15 Sep 2020 16:29:41 +0000 (17:29 +0100)
clippy_lints/src/misc.rs

index 81e6214f143ec99b0300d8acf49d274d12bc2e6a..67a3685fd0dc3b07b96e3a45039e7305366afddd 100644 (file)
     /// if y != x {} // where both are floats
     ///
     /// // Good
-    /// let error = f64::EPSILON; // Use an epsilon for comparison
+    /// let error_margin = f64::EPSILON; // Use an epsilon for comparison
     /// // Or, if Rust <= 1.42, use `std::f64::EPSILON` constant instead.
-    /// // let error = std::f64::EPSILON;
-    /// if (y - 1.23f64).abs() < error { }
-    /// if (y - x).abs() > error { }
+    /// // let error_margin = std::f64::EPSILON;
+    /// if (y - 1.23f64).abs() < error_margin { }
+    /// if (y - x).abs() > error_margin { }
     /// ```
     pub FLOAT_CMP,
     correctness,
     /// if x == ONE { } // where both are floats
     ///
     /// // Good
-    /// let error = f64::EPSILON; // Use an epsilon for comparison
+    /// let error_margin = f64::EPSILON; // Use an epsilon for comparison
     /// // Or, if Rust <= 1.42, use `std::f64::EPSILON` constant instead.
-    /// // let error = std::f64::EPSILON;
-    /// if (x - ONE).abs() < error { }
+    /// // let error_margin = std::f64::EPSILON;
+    /// if (x - ONE).abs() < error_margin { }
     /// ```
     pub FLOAT_CMP_CONST,
     restriction,