Skip to content

Commit

Permalink
Remove operations with usize, expect fixed width operands
Browse files Browse the repository at this point in the history
  • Loading branch information
Oppen committed Oct 4, 2023
1 parent 13fab09 commit 0befb53
Showing 1 changed file with 0 additions and 34 deletions.
34 changes: 0 additions & 34 deletions crates/stark-felt/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -503,24 +503,6 @@ mod arithmetic {
}
}

/// Field addition. Never overflows/underflows.
impl ops::Add<usize> for Felt {
type Output = Felt;

fn add(self, rhs: usize) -> Self::Output {
self + rhs as u64
}
}

/// Field addition. Never overflows/underflows.
impl ops::Add<usize> for &Felt {
type Output = Felt;

fn add(self, rhs: usize) -> Self::Output {
self + rhs as u64
}
}

/// Field subtraction. Never overflows/underflows.
impl ops::SubAssign<Felt> for Felt {
fn sub_assign(&mut self, rhs: Felt) {
Expand Down Expand Up @@ -589,22 +571,6 @@ mod arithmetic {
}
}

/// 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<&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<u64> for Felt {
type Output = Felt;
Expand Down

0 comments on commit 0befb53

Please sign in to comment.