Skip to content

Commit aa78e78

Browse files
committed
fix unused variable
1 parent 0c80212 commit aa78e78

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

libm/src/math/support/big.rs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,7 @@ macro_rules! impl_common {
115115
fn add(self, rhs: Self) -> Self::Output {
116116
let (lo, carry) = self.lo.overflowing_add(rhs.lo);
117117
let (hi, of) = Int::carrying_add(self.hi, rhs.hi, carry);
118-
119-
#[cfg(debug_assertions)]
120-
if of {
121-
panic!("attempt to add with overflow")
122-
}
123-
118+
debug_assert!(!of, "attempt to add with overflow");
124119
Self { lo, hi }
125120
}
126121
}
@@ -131,12 +126,7 @@ macro_rules! impl_common {
131126
fn sub(self, rhs: Self) -> Self::Output {
132127
let (lo, borrow) = self.lo.overflowing_sub(rhs.lo);
133128
let (hi, of) = Int::borrowing_sub(self.hi, rhs.hi, borrow);
134-
135-
#[cfg(debug_assertions)]
136-
if of {
137-
panic!("attempt to subtract with overflow")
138-
}
139-
129+
debug_assert!(!of, "attempt to subtract with overflow");
140130
Self { lo, hi }
141131
}
142132
}

0 commit comments

Comments
 (0)