Skip to content

Commit 16b6ceb

Browse files
author
Haraman Johal
committed
update lint docs
1 parent 4d73cca commit 16b6ceb

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

clippy_lints/src/misc.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,11 @@ declare_clippy_lint! {
9999
/// if y != x {} // where both are floats
100100
///
101101
/// // Good
102-
/// let error = f64::EPSILON; // Use an epsilon for comparison
102+
/// let error_margin = f64::EPSILON; // Use an epsilon for comparison
103103
/// // Or, if Rust <= 1.42, use `std::f64::EPSILON` constant instead.
104-
/// // let error = std::f64::EPSILON;
105-
/// if (y - 1.23f64).abs() < error { }
106-
/// if (y - x).abs() > error { }
104+
/// // let error_margin = std::f64::EPSILON;
105+
/// if (y - 1.23f64).abs() < error_margin { }
106+
/// if (y - x).abs() > error_margin { }
107107
/// ```
108108
pub FLOAT_CMP,
109109
correctness,
@@ -242,10 +242,10 @@ declare_clippy_lint! {
242242
/// if x == ONE { } // where both are floats
243243
///
244244
/// // Good
245-
/// let error = f64::EPSILON; // Use an epsilon for comparison
245+
/// let error_margin = f64::EPSILON; // Use an epsilon for comparison
246246
/// // Or, if Rust <= 1.42, use `std::f64::EPSILON` constant instead.
247-
/// // let error = std::f64::EPSILON;
248-
/// if (x - ONE).abs() < error { }
247+
/// // let error_margin = std::f64::EPSILON;
248+
/// if (x - ONE).abs() < error_margin { }
249249
/// ```
250250
pub FLOAT_CMP_CONST,
251251
restriction,

0 commit comments

Comments
 (0)