mirror of
https://github.com/NixOS/nix
synced 2025-06-26 20:01:15 +02:00
Remove FormatOrString and remaining uses of format()
This commit is contained in:
parent
b9370fd7a0
commit
29abc8e764
40 changed files with 102 additions and 125 deletions
|
@ -523,7 +523,7 @@ void deletePath(const Path & path)
|
|||
|
||||
void deletePath(const Path & path, uint64_t & bytesFreed)
|
||||
{
|
||||
//Activity act(*logger, lvlDebug, format("recursively deleting path '%1%'") % path);
|
||||
//Activity act(*logger, lvlDebug, "recursively deleting path '%1%'", path);
|
||||
bytesFreed = 0;
|
||||
_deletePath(path, bytesFreed);
|
||||
}
|
||||
|
@ -1394,14 +1394,14 @@ std::string statusToString(int status)
|
|||
{
|
||||
if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) {
|
||||
if (WIFEXITED(status))
|
||||
return (format("failed with exit code %1%") % WEXITSTATUS(status)).str();
|
||||
return fmt("failed with exit code %1%", WEXITSTATUS(status));
|
||||
else if (WIFSIGNALED(status)) {
|
||||
int sig = WTERMSIG(status);
|
||||
#if HAVE_STRSIGNAL
|
||||
const char * description = strsignal(sig);
|
||||
return (format("failed due to signal %1% (%2%)") % sig % description).str();
|
||||
return fmt("failed due to signal %1% (%2%)", sig, description);
|
||||
#else
|
||||
return (format("failed due to signal %1%") % sig).str();
|
||||
return fmt("failed due to signal %1%", sig);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
|
@ -1470,7 +1470,7 @@ bool shouldANSI()
|
|||
&& !getEnv("NO_COLOR").has_value();
|
||||
}
|
||||
|
||||
std::string filterANSIEscapes(const std::string & s, bool filterAll, unsigned int width)
|
||||
std::string filterANSIEscapes(std::string_view s, bool filterAll, unsigned int width)
|
||||
{
|
||||
std::string t, e;
|
||||
size_t w = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue