We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2b5970f commit acf0a0cCopy full SHA for acf0a0c
library/core/src/num/saturating.rs
@@ -141,7 +141,7 @@ macro_rules! sh_impl_unsigned {
141
142
#[inline]
143
fn shl(self, other: $f) -> Saturating<$t> {
144
- Saturating(self.0.shl((other & self::shift_max::$t as $f) as u32))
+ Saturating(self.0.wrapping_shl(other as u32))
145
}
146
147
forward_ref_binop! { impl Shl, shl for Saturating<$t>, $f,
@@ -162,7 +162,7 @@ macro_rules! sh_impl_unsigned {
162
163
164
fn shr(self, other: $f) -> Saturating<$t> {
165
- Saturating(self.0.shr((other & self::shift_max::$t as $f) as u32))
+ Saturating(self.0.wrapping_shr(other as u32))
166
167
168
forward_ref_binop! { impl Shr, shr for Saturating<$t>, $f,
0 commit comments