mirror of
https://github.com/NixOS/nix
synced 2025-06-27 04:21:16 +02:00
Factor out common showBytes()
This commit is contained in:
parent
d0bb544128
commit
6691256e79
4 changed files with 16 additions and 18 deletions
|
@ -386,18 +386,12 @@ RunPager::~RunPager()
|
|||
}
|
||||
|
||||
|
||||
string showBytes(uint64_t bytes)
|
||||
{
|
||||
return (format("%.2f MiB") % (bytes / (1024.0 * 1024.0))).str();
|
||||
}
|
||||
|
||||
|
||||
PrintFreed::~PrintFreed()
|
||||
{
|
||||
if (show)
|
||||
std::cout << format("%1% store paths deleted, %2% freed\n")
|
||||
% results.paths.size()
|
||||
% showBytes(results.bytesFreed);
|
||||
std::cout << fmt("%d store paths deleted, %s freed\n",
|
||||
results.paths.size(),
|
||||
showBytes(results.bytesFreed));
|
||||
}
|
||||
|
||||
Exit::~Exit() { }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue