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:
Matthias Krüger 2024-06-29 22:10:59 +02:00 committed by GitHub
commit c79e08d3a6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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