diff --git a/crates/stark-felt/src/lib.rs b/crates/stark-felt/src/lib.rs index 0093636..43ee8ae 100644 --- a/crates/stark-felt/src/lib.rs +++ b/crates/stark-felt/src/lib.rs @@ -556,18 +556,18 @@ mod arithmetic { /// Field subtraction. Never overflows/underflows. #[allow(clippy::suspicious_arithmetic_impl)] impl ops::Sub for u64 { - type Output = Felt; + type Output = Option; fn sub(self, rhs: Felt) -> Self::Output { - rhs.neg() + self + self + &rhs.neg() } } /// Field subtraction. Never overflows/underflows. #[allow(clippy::suspicious_arithmetic_impl)] impl ops::Sub<&Felt> for u64 { - type Output = Felt; + type Output = Option; fn sub(self, rhs: &Felt) -> Self::Output { - rhs.neg() + self + self + &rhs.neg() } }