File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -99,11 +99,11 @@ declare_clippy_lint! {
99
99
/// if y != x {} // where both are floats
100
100
///
101
101
/// // Good
102
- /// let error = f64::EPSILON; // Use an epsilon for comparison
102
+ /// let error_margin = f64::EPSILON; // Use an epsilon for comparison
103
103
/// // 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 { }
107
107
/// ```
108
108
pub FLOAT_CMP ,
109
109
correctness,
@@ -242,10 +242,10 @@ declare_clippy_lint! {
242
242
/// if x == ONE { } // where both are floats
243
243
///
244
244
/// // Good
245
- /// let error = f64::EPSILON; // Use an epsilon for comparison
245
+ /// let error_margin = f64::EPSILON; // Use an epsilon for comparison
246
246
/// // 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 { }
249
249
/// ```
250
250
pub FLOAT_CMP_CONST ,
251
251
restriction,
You can’t perform that action at this time.
0 commit comments