We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0befb53 commit 2db8cfdCopy full SHA for 2db8cfd
crates/stark-felt/src/lib.rs
@@ -556,18 +556,18 @@ mod arithmetic {
556
/// Field subtraction. Never overflows/underflows.
557
#[allow(clippy::suspicious_arithmetic_impl)]
558
impl ops::Sub<Felt> for u64 {
559
- type Output = Felt;
+ type Output = Option<u64>;
560
fn sub(self, rhs: Felt) -> Self::Output {
561
- rhs.neg() + self
+ self + &rhs.neg()
562
}
563
564
565
566
567
impl ops::Sub<&Felt> for u64 {
568
569
fn sub(self, rhs: &Felt) -> Self::Output {
570
571
572
573
0 commit comments