diff options
| author | Haraman Johal <haraman.johal@oxfordni.com> | 2020-09-15 17:29:41 +0100 |
|---|---|---|
| committer | Haraman Johal <haraman.johal@oxfordni.com> | 2020-09-15 17:29:41 +0100 |
| commit | 16b6cebaa67655a793d90d296c03e2c5496ec4ce (patch) | |
| tree | ce867c4ae5b4af7ae4590c2f9927eecd11b761f4 | |
| parent | 4d73ccaa9419b393b9c94f977ec0e158897feeb3 (diff) | |
| download | rust-16b6cebaa67655a793d90d296c03e2c5496ec4ce.tar.gz rust-16b6cebaa67655a793d90d296c03e2c5496ec4ce.zip | |
update lint docs
| -rw-r--r-- | clippy_lints/src/misc.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/clippy_lints/src/misc.rs b/clippy_lints/src/misc.rs index 81e6214f143..67a3685fd0d 100644 --- a/clippy_lints/src/misc.rs +++ b/clippy_lints/src/misc.rs @@ -99,11 +99,11 @@ declare_clippy_lint! { /// 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, @@ -242,10 +242,10 @@ declare_clippy_lint! { /// 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, |
