Skip to content

Commit

Permalink
fix: make it short on checked_add
Browse files Browse the repository at this point in the history
  • Loading branch information
XuJiandong committed Dec 5, 2024
1 parent b40a2dd commit d25e199
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/transcendental.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,7 @@ where
};

let operand = D::from(operand);
let mut result = if let Some(r) = operand.checked_add(D::from_num(1)) {
r
} else {
return Err(());
};
let mut result = operand.checked_add(D::from_num(1)).ok_or(())?;
let mut term = operand;

for i in 2..D::frac_nbits() {
Expand Down

0 comments on commit d25e199

Please sign in to comment.