diff options
author | Daniel Schadt <kingdread@gmx.de> | 2025-09-04 22:24:47 +0200 |
---|---|---|
committer | Daniel Schadt <kingdread@gmx.de> | 2025-09-04 22:36:33 +0200 |
commit | 7218598a96022ad4b7d98ad08f83795ec95d68c5 (patch) | |
tree | 06d3714a6832ddb91c5958f22a5ae9b70915ff27 /src/block.rs | |
parent | bf5a408e852c79f3373da59c7675c13e53434ff6 (diff) | |
download | zears-7218598a96022ad4b7d98ad08f83795ec95d68c5.tar.gz zears-7218598a96022ad4b7d98ad08f83795ec95d68c5.tar.bz2 zears-7218598a96022ad4b7d98ad08f83795ec95d68c5.zip |
Taking j as i32 was a weird choice (only for the -1), and technically
caused issues for invocations with more than u16::MAX tweaks (not that
people might use that many tweaks, but just in case...)
Diffstat (limited to 'src/block.rs')
-rw-r--r-- | src/block.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/block.rs b/src/block.rs index 2b7907a..8d6517d 100644 --- a/src/block.rs +++ b/src/block.rs @@ -115,7 +115,7 @@ impl Block { /// Computes self * 2^exponent /// /// Ensures that there's no overflow in computing 2^exponent. - pub fn exp(&self, exponent: u32) -> Block { + pub fn exp(&self, exponent: usize) -> Block { match exponent { _ if exponent < 32 => *self * (1 << exponent), _ if exponent % 2 == 0 => self.exp(exponent / 2).exp(exponent / 2), @@ -266,9 +266,9 @@ impl IndexMut<usize> for Block { } } -impl Mul<u32> for Block { +impl Mul<usize> for Block { type Output = Block; - fn mul(self, rhs: u32) -> Block { + fn mul(self, rhs: usize) -> Block { match rhs { 0 => Block::null(), 1 => self, |