From 0befb5378b1364872c23271483fa2b53c1fb7145 Mon Sep 17 00:00:00 2001 From: Mario Rugiero Date: Wed, 4 Oct 2023 14:39:37 -0300 Subject: [PATCH] Remove operations with usize, expect fixed width operands --- crates/stark-felt/src/lib.rs | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/crates/stark-felt/src/lib.rs b/crates/stark-felt/src/lib.rs index b5cb609..0093636 100644 --- a/crates/stark-felt/src/lib.rs +++ b/crates/stark-felt/src/lib.rs @@ -503,24 +503,6 @@ mod arithmetic { } } - /// Field addition. Never overflows/underflows. - impl ops::Add for Felt { - type Output = Felt; - - fn add(self, rhs: usize) -> Self::Output { - self + rhs as u64 - } - } - - /// Field addition. Never overflows/underflows. - impl ops::Add for &Felt { - type Output = Felt; - - fn add(self, rhs: usize) -> Self::Output { - self + rhs as u64 - } - } - /// Field subtraction. Never overflows/underflows. impl ops::SubAssign for Felt { fn sub_assign(&mut self, rhs: Felt) { @@ -589,22 +571,6 @@ mod arithmetic { } } - /// Field subtraction. Never overflows/underflows. - impl ops::Sub for usize { - type Output = Felt; - fn sub(self, rhs: Felt) -> Self::Output { - self as u64 - rhs - } - } - - /// Field subtraction. Never overflows/underflows. - impl ops::Sub<&Felt> for usize { - type Output = Felt; - fn sub(self, rhs: &Felt) -> Self::Output { - self as u64 - rhs - } - } - /// Field subtraction. Never overflows/underflows. impl ops::Sub for Felt { type Output = Felt;