mirror of
https://github.com/NixOS/nix
synced 2025-06-27 21:01: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
|
@ -1641,4 +1641,11 @@ AutoCloseFD createUnixDomainSocket(const Path & path, mode_t mode)
|
|||
return fdSocket;
|
||||
}
|
||||
|
||||
|
||||
string showBytes(uint64_t bytes)
|
||||
{
|
||||
return fmt("%.2f MiB", bytes / (1024.0 * 1024.0));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -573,4 +573,7 @@ template<class... Ts> struct overloaded : Ts... { using Ts::operator()...; };
|
|||
template<class... Ts> overloaded(Ts...) -> overloaded<Ts...>;
|
||||
|
||||
|
||||
std::string showBytes(uint64_t bytes);
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue