Skip to content

Commit 7423494

Browse files
committed
cargo clippy
1 parent 1161ca9 commit 7423494

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/lib.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -600,12 +600,10 @@ impl BigDecimal {
600600

601601
if digit <= 4 {
602602
self.with_scale(round_digits)
603+
} else if bigint.is_negative() {
604+
self.with_scale(round_digits) - BigDecimal::new(BigInt::from(1), round_digits)
603605
} else {
604-
if bigint.is_negative() {
605-
self.with_scale(round_digits) - BigDecimal::new(BigInt::from(1), round_digits)
606-
} else {
607-
self.with_scale(round_digits) + BigDecimal::new(BigInt::from(1), round_digits)
608-
}
606+
self.with_scale(round_digits) + BigDecimal::new(BigInt::from(1), round_digits)
609607
}
610608
}
611609

0 commit comments

Comments
 (0)