Skip to content

Commit fa0fef3

Browse files
committed
Restore signed isqrt implementation to original, but using panic function
1 parent 9e43469 commit fa0fef3

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
@@ -2800,10 +2800,9 @@ macro_rules! int_impl {
28002800
#[inline]
28012801
#[track_caller]
28022802
pub const fn isqrt(self) -> Self {
2803-
if let Some(sqrt) = self.checked_isqrt() {
2804-
sqrt
2805-
} else {
2806-
crate::num::int_sqrt::panic_for_negative_argument()
2803+
match self.checked_isqrt() {
2804+
Some(sqrt) => sqrt,
2805+
None => crate::num::int_sqrt::panic_for_negative_argument(),
28072806
}
28082807
}
28092808

0 commit comments

Comments
 (0)