diff options
| author | Federico Stra <stra.federico@gmail.com> | 2023-09-28 10:43:41 +0200 |
|---|---|---|
| committer | Federico Stra <stra.federico@gmail.com> | 2023-09-28 11:39:17 +0200 |
| commit | 17dfb18bd1ad15ce4437bb44ba30b0c82aad3e07 (patch) | |
| tree | 52614bb2b938dea230dde740189afe43052cf573 /library/core/src/num | |
| parent | d49da0fe54251fbee190dc2adcdbffe787aecae7 (diff) | |
| download | rust-17dfb18bd1ad15ce4437bb44ba30b0c82aad3e07.tar.gz rust-17dfb18bd1ad15ce4437bb44ba30b0c82aad3e07.zip | |
fixup! isqrt: initial implementation
Fix C-ism and type inference.
Diffstat (limited to 'library/core/src/num')
| -rw-r--r-- | library/core/src/num/uint_macros.rs | 8 |
1 files 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; |
