Skip to content

Commit

Permalink
Return Option<u64> for u64 - Felt
Browse files Browse the repository at this point in the history
  • Loading branch information
Oppen committed Oct 4, 2023
1 parent 0befb53 commit 2db8cfd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/stark-felt/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -556,18 +556,18 @@ mod arithmetic {
/// Field subtraction. Never overflows/underflows.
#[allow(clippy::suspicious_arithmetic_impl)]
impl ops::Sub<Felt> for u64 {
type Output = Felt;
type Output = Option<u64>;
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<u64>;
fn sub(self, rhs: &Felt) -> Self::Output {
rhs.neg() + self
self + &rhs.neg()
}
}

Expand Down

0 comments on commit 2db8cfd

Please sign in to comment.