Skip to content

Commit 357ada1

Browse files
committed
Restore signed isqrt implementation to original, but using panic function
1 parent 5e5963d commit 357ada1

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

library/core/src/num/int_macros.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2832,10 +2832,9 @@ macro_rules! int_impl {
28322832
#[inline]
28332833
#[track_caller]
28342834
pub const fn isqrt(self) -> Self {
2835-
if let Some(sqrt) = self.checked_isqrt() {
2836-
sqrt
2837-
} else {
2838-
crate::num::int_sqrt::panic_for_negative_argument()
2835+
match self.checked_isqrt() {
2836+
Some(sqrt) => sqrt,
2837+
None => crate::num::int_sqrt::panic_for_negative_argument(),
28392838
}
28402839
}
28412840

0 commit comments

Comments
 (0)