upgrade dependency ByteSize

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2025-03-31 04:23:47 +00:00
parent 3f0f89cddb
commit 5768ca8442
3 changed files with 49 additions and 62 deletions

View file

@ -17,15 +17,13 @@ pub fn from_str(str: &str) -> Result<usize> {
Ok(bytes)
}
/// Output a human-readable size string w/ si-unit suffix
/// Output a human-readable size string w/ iec-unit suffix
#[inline]
#[must_use]
pub fn pretty(bytes: usize) -> String {
const SI_UNITS: bool = true;
let bytes: u64 = bytes.try_into().expect("failed to convert usize to u64");
bytesize::to_string(bytes, SI_UNITS)
ByteSize::b(bytes).display().iec().to_string()
}
#[inline]