mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-14 00:47:16 +00:00
Use int assoc consts in MANUAL_SATURATING_ARITHMETIC
This commit is contained in:
parent
4726daad52
commit
1647f53fb3
1 changed files with 2 additions and 2 deletions
|
@ -1138,8 +1138,8 @@ declare_clippy_lint! {
|
|||
/// ```rust
|
||||
/// # let y: u32 = 0;
|
||||
/// # let x: u32 = 100;
|
||||
/// let add = x.checked_add(y).unwrap_or(u32::max_value());
|
||||
/// let sub = x.checked_sub(y).unwrap_or(u32::min_value());
|
||||
/// let add = x.checked_add(y).unwrap_or(u32::MAX);
|
||||
/// let sub = x.checked_sub(y).unwrap_or(u32::MIN);
|
||||
/// ```
|
||||
///
|
||||
/// can be written using dedicated methods for saturating addition/subtraction as:
|
||||
|
|
Loading…
Reference in a new issue