Skip to content

Commit

Permalink
add a good example for the approx_const lint
Browse files Browse the repository at this point in the history
  • Loading branch information
dario23 committed Nov 19, 2019
1 parent c58a5c6 commit c6e6b29
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions clippy_lints/src/approx_const.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@ declare_clippy_lint! {
///
/// **Example:**
/// ```rust
/// // Bad
/// let x = 3.14;
/// let y = 1_f64 / x;
///
/// // Good
/// let x = std::f32::consts::PI;
/// let y = std::f64::consts::FRAC_1_PI;
/// ```
pub APPROX_CONSTANT,
correctness,
Expand Down

0 comments on commit c6e6b29

Please sign in to comment.