1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-08 19:46:02 +01:00

refactor(libutil): remove showBytes() in favor of renderSize()

The `showBytes()` function was redundant with `renderSize()` as the
latter automatically selects the appropriate unit (KiB, MiB, GiB, etc.)
based on the value, whereas `showBytes()` always formatted as MiB
regardless of size.

Co-authored-by: Bernardo Meurer Costa <beme@anthropic.com>
(cherry picked from commit f234633e27)
This commit is contained in:
Marcel 2025-10-27 00:55:40 +01:00 committed by github-actions[bot]
parent 1a22674806
commit 0c6585707a
5 changed files with 2 additions and 11 deletions

View file

@ -406,7 +406,7 @@ RunPager::~RunPager()
PrintFreed::~PrintFreed()
{
if (show)
std::cout << fmt("%d store paths deleted, %s freed\n", results.paths.size(), showBytes(results.bytesFreed));
std::cout << fmt("%d store paths deleted, %s freed\n", results.paths.size(), renderSize(results.bytesFreed));
}
} // namespace nix