Skip to content

Commit

Permalink
update lint docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Haraman Johal committed Sep 15, 2020
1 parent 4d73cca commit 16b6ceb
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions clippy_lints/src/misc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 16b6ceb

Please sign in to comment.