mirror of
https://github.com/NixOS/nix.git
synced 2025-11-12 05:26:02 +01:00
Refactor: rename C++ concatStringsSep -> dropEmptyInitThenConcatStringsSep
This commit is contained in:
parent
b1effc9649
commit
1a8defd06f
33 changed files with 70 additions and 70 deletions
|
|
@ -42,7 +42,7 @@ void NixMultiCommand::run()
|
|||
for (auto & [name, _] : commands)
|
||||
subCommandTextLines.insert(fmt("- `%s`", name));
|
||||
std::string markdownError = fmt("`nix %s` requires a sub-command. Available sub-commands:\n\n%s\n",
|
||||
commandName, concatStringsSep("\n", subCommandTextLines));
|
||||
commandName, dropEmptyInitThenConcatStringsSep("\n", subCommandTextLines));
|
||||
throw UsageError(renderMarkdownToTerminal(markdownError));
|
||||
}
|
||||
command->second->run();
|
||||
|
|
|
|||
|
|
@ -374,7 +374,7 @@ void completeFlakeRefWithFragment(
|
|||
auto attrPath2 = (*attr)->getAttrPath(attr2);
|
||||
/* Strip the attrpath prefix. */
|
||||
attrPath2.erase(attrPath2.begin(), attrPath2.begin() + attrPathPrefix.size());
|
||||
completions.add(flakeRefS + "#" + prefixRoot + concatStringsSep(".", evalState->symbols.resolve(attrPath2)));
|
||||
completions.add(flakeRefS + "#" + prefixRoot + dropEmptyInitThenConcatStringsSep(".", evalState->symbols.resolve(attrPath2)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -630,7 +630,7 @@ static void throwBuildErrors(
|
|||
}
|
||||
failedPaths.insert(failedResult->path.to_string(store));
|
||||
}
|
||||
throw Error("build of %s failed", concatStringsSep(", ", quoteStrings(failedPaths)));
|
||||
throw Error("build of %s failed", dropEmptyInitThenConcatStringsSep(", ", quoteStrings(failedPaths)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -625,7 +625,7 @@ ProcessLineResult NixRepl::processLine(std::string line)
|
|||
|
||||
markdown +=
|
||||
"**Synopsis:** `builtins." + (std::string) (*doc->name) + "` "
|
||||
+ concatStringsSep(" ", args) + "\n\n";
|
||||
+ dropEmptyInitThenConcatStringsSep(" ", args) + "\n\n";
|
||||
}
|
||||
|
||||
markdown += stripIndentation(doc->doc);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue