Skip to content

Commit d9505f0

Browse files
committed
use unsigned_abs instead of abs on signed int to silence clippy
1 parent f51c987 commit d9505f0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/core/src/num/uint_macros.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2572,7 +2572,7 @@ macro_rules! uint_impl {
25722572
if size_of::<Self>() == 1 {
25732573
// Trick LLVM into generating the psadbw instruction when SSE2
25742574
// is available and this function is autovectorized for u8's.
2575-
(self as i32).wrapping_sub(other as i32).abs() as Self
2575+
(self as i32).wrapping_sub(other as i32).unsigned_abs() as Self
25762576
} else {
25772577
if self < other {
25782578
other - self

0 commit comments

Comments
 (0)