From 17dfb18bd1ad15ce4437bb44ba30b0c82aad3e07 Mon Sep 17 00:00:00 2001 From: Federico Stra Date: Thu, 28 Sep 2023 10:43:41 +0200 Subject: [PATCH] fixup! isqrt: initial implementation Fix C-ism and type inference. --- library/core/src/num/uint_macros.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/library/core/src/num/uint_macros.rs b/library/core/src/num/uint_macros.rs index f8005694ceb..b232d5d50cb 100644 --- a/library/core/src/num/uint_macros.rs +++ b/library/core/src/num/uint_macros.rs @@ -1997,11 +1997,11 @@ macro_rules! uint_impl { return self; } - let mut x: Self = self; - let mut c: Self = 0; - let mut d: Self = 1 << (self.ilog2() & !1); + let mut x = self; + let mut c = 0; + let mut d = 1 << (self.ilog2() & !1); - while (d != 0) { + while d != 0 { if x >= c + d { x -= c + d; c = (c >> 1) + d;