Skip to content

Commit 1647f53

Browse files
committed
Use int assoc consts in MANUAL_SATURATING_ARITHMETIC
1 parent 4726daa commit 1647f53

File tree

1 file changed

+2
-2
lines changed
  • clippy_lints/src/methods

1 file changed

+2
-2
lines changed

clippy_lints/src/methods/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1138,8 +1138,8 @@ declare_clippy_lint! {
11381138
/// ```rust
11391139
/// # let y: u32 = 0;
11401140
/// # let x: u32 = 100;
1141-
/// let add = x.checked_add(y).unwrap_or(u32::max_value());
1142-
/// let sub = x.checked_sub(y).unwrap_or(u32::min_value());
1141+
/// let add = x.checked_add(y).unwrap_or(u32::MAX);
1142+
/// let sub = x.checked_sub(y).unwrap_or(u32::MIN);
11431143
/// ```
11441144
///
11451145
/// can be written using dedicated methods for saturating addition/subtraction as:

0 commit comments

Comments
 (0)