mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-14 08:57:30 +00:00
Use integer assoc consts in more lint example code
This commit is contained in:
parent
518568ae0a
commit
c2f67e1e19
2 changed files with 5 additions and 5 deletions
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue