Skip to content

Commit

Permalink
Use integer assoc consts in more lint example code
Browse files Browse the repository at this point in the history
  • Loading branch information
faern committed Apr 7, 2020
1 parent 518568a commit c2f67e1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions clippy_lints/src/neg_cmp_op_on_partial_ord.rs
Expand Up @@ -25,13 +25,13 @@ declare_clippy_lint! {
///
/// // Bad
/// let a = 1.0;
/// let b = std::f64::NAN;
/// let b = f64::NAN;
///
/// let _not_less_or_equal = !(a <= b);
///
/// // Good
/// let a = 1.0;
/// let b = std::f64::NAN;
/// let b = f64::NAN;
///
/// let _not_less_or_equal = match a.partial_cmp(&b) {
/// None | Some(Ordering::Greater) => true,
Expand Down
6 changes: 3 additions & 3 deletions clippy_lints/src/types.rs
Expand Up @@ -837,7 +837,7 @@ declare_clippy_lint! {
///
/// **Example:**
/// ```rust
/// let x = std::u64::MAX;
/// let x = u64::MAX;
/// x as f64;
/// ```
pub CAST_PRECISION_LOSS,
Expand Down Expand Up @@ -904,7 +904,7 @@ declare_clippy_lint! {
///
/// **Example:**
/// ```rust
/// std::u32::MAX as i32; // will yield a value of `-1`
/// u32::MAX as i32; // will yield a value of `-1`
/// ```
pub CAST_POSSIBLE_WRAP,
pedantic,
Expand Down Expand Up @@ -1752,7 +1752,7 @@ declare_clippy_lint! {
/// ```rust
/// let vec: Vec<isize> = Vec::new();
/// if vec.len() <= 0 {}
/// if 100 > std::i32::MAX {}
/// if 100 > i32::MAX {}
/// ```
pub ABSURD_EXTREME_COMPARISONS,
correctness,
Expand Down

0 comments on commit c2f67e1

Please sign in to comment.