Skip to content

Commit d25e199

Browse files
committed
fix: make it short on checked_add
1 parent b40a2dd commit d25e199

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/transcendental.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -244,11 +244,7 @@ where
244244
};
245245

246246
let operand = D::from(operand);
247-
let mut result = if let Some(r) = operand.checked_add(D::from_num(1)) {
248-
r
249-
} else {
250-
return Err(());
251-
};
247+
let mut result = operand.checked_add(D::from_num(1)).ok_or(())?;
252248
let mut term = operand;
253249

254250
for i in 2..D::frac_nbits() {

0 commit comments

Comments
 (0)