Skip to content
This repository was archived by the owner on Jun 10, 2024. It is now read-only.

Commit 7c5486c

Browse files
committed
fix: improper shl behavior
1 parent ecbffc5 commit 7c5486c

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

library/number/src/integer.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -637,13 +637,10 @@ impl Shl<u32> for Integer {
637637
type Output = Integer;
638638
fn shl(self, y: u32) -> Self::Output {
639639
match self {
640-
Self::Small(x) => match x.checked_shl(y) {
641-
None => {
642-
let x = BigInt::from(x);
643-
(x << y).into()
644-
}
645-
Some(result) => result.into(),
646-
},
640+
Self::Small(x) => {
641+
let x = BigInt::from(x);
642+
(x << y).into()
643+
}
647644
Self::Big(x) => Self::Big(x << y),
648645
}
649646
}

0 commit comments

Comments
 (0)