1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 03:27:44 +00:00

cksum: use div_ceil() from std

This commit is contained in:
Daniel Hofstetter 2024-11-20 09:17:14 +01:00
parent 7fb0f8a29d
commit fc2f73b16c

View file

@ -22,7 +22,7 @@ use uucore::{
format_usage, help_about, help_section, help_usage, format_usage, help_about, help_section, help_usage,
line_ending::LineEnding, line_ending::LineEnding,
os_str_as_bytes, show, os_str_as_bytes, show,
sum::{div_ceil, Digest}, sum::Digest,
}; };
const USAGE: &str = help_usage!("cksum.md"); const USAGE: &str = help_usage!("cksum.md");
@ -124,7 +124,7 @@ where
format!( format!(
"{} {}{}", "{} {}{}",
sum.parse::<u16>().unwrap(), sum.parse::<u16>().unwrap(),
div_ceil(sz, options.output_bits), sz.div_ceil(options.output_bits),
if not_file { "" } else { " " } if not_file { "" } else { " " }
), ),
!not_file, !not_file,
@ -134,7 +134,7 @@ where
format!( format!(
"{:0bsd_width$} {:bsd_width$}{}", "{:0bsd_width$} {:bsd_width$}{}",
sum.parse::<u16>().unwrap(), sum.parse::<u16>().unwrap(),
div_ceil(sz, options.output_bits), sz.div_ceil(options.output_bits),
if not_file { "" } else { " " } if not_file { "" } else { " " }
), ),
!not_file, !not_file,