mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 00:34:06 +00:00
Rollup merge of #127122 - TDecking:div_ceil, r=Nilstrieb
Remove uneccessary condition in `div_ceil` Previously, `div_ceil` for unsigned integers had a `rhs > 0` for rounding. That condition however is always fulfilled, since `rhs == 0` would mean a division by zero earlier.
This commit is contained in:
commit
c79e08d3a6
@ -2726,7 +2726,7 @@ macro_rules! uint_impl {
|
||||
pub const fn div_ceil(self, rhs: Self) -> Self {
|
||||
let d = self / rhs;
|
||||
let r = self % rhs;
|
||||
if r > 0 && rhs > 0 {
|
||||
if r > 0 {
|
||||
d + 1
|
||||
} else {
|
||||
d
|
||||
|
Loading…
Reference in New Issue
Block a user