Skip to content

Commit 17dfb18

Browse files
committed
fixup! isqrt: initial implementation
Fix C-ism and type inference.
1 parent d49da0f commit 17dfb18

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

library/core/src/num/uint_macros.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1997,11 +1997,11 @@ macro_rules! uint_impl {
19971997
return self;
19981998
}
19991999

2000-
let mut x: Self = self;
2001-
let mut c: Self = 0;
2002-
let mut d: Self = 1 << (self.ilog2() & !1);
2000+
let mut x = self;
2001+
let mut c = 0;
2002+
let mut d = 1 << (self.ilog2() & !1);
20032003

2004-
while (d != 0) {
2004+
while d != 0 {
20052005
if x >= c + d {
20062006
x -= c + d;
20072007
c = (c >> 1) + d;

0 commit comments

Comments
 (0)