Skip to content

Commit 28e9a88

Browse files
committed
du: use div_ceil() from std
1 parent c94b2e9 commit 28e9a88

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/uu/du/src/du.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ impl StatPrinter {
555555
size,
556556
uucore::format::human::SizeFormat::Binary,
557557
),
558-
SizeFormat::BlockSize(block_size) => div_ceil(size, block_size).to_string(),
558+
SizeFormat::BlockSize(block_size) => size.div_ceil(block_size).to_string(),
559559
}
560560
}
561561

@@ -576,13 +576,6 @@ impl StatPrinter {
576576
}
577577
}
578578

579-
// This can be replaced with u64::div_ceil once it is stabilized.
580-
// This implementation approach is optimized for when `b` is a constant,
581-
// particularly a power of two.
582-
pub fn div_ceil(a: u64, b: u64) -> u64 {
583-
(a + b - 1) / b
584-
}
585-
586579
// Read file paths from the specified file, separated by null characters
587580
fn read_files_from(file_name: &str) -> Result<Vec<PathBuf>, std::io::Error> {
588581
let reader: Box<dyn BufRead> = if file_name == "-" {

0 commit comments

Comments
 (0)