Use int assoc consts in MANUAL_SATURATING_ARITHMETIC

This commit is contained in:
Linus Färnstrand 2020-04-08 00:24:18 +02:00
parent 4726daad52
commit 1647f53fb3

View file

@ -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: