mirror of
https://github.com/NixOS/nix
synced 2025-06-27 12:41:15 +02:00
dropEmptyInitThenConcatStringsSep -> concatStringSep: diagnostics and docs
These are non-critical, so their behavior is ok to change. Dropping empty items is not needed and usually not expected.
This commit is contained in:
parent
a681d354e7
commit
ea966a70fc
9 changed files with 28 additions and 16 deletions
|
@ -9,6 +9,8 @@
|
|||
#include <iterator>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
#include "strings.hh"
|
||||
|
||||
namespace nix::flake {
|
||||
|
||||
static FlakeRef getFlakeRef(
|
||||
|
@ -61,7 +63,7 @@ static std::shared_ptr<Node> doFind(const ref<Node>& root, const InputPath & pat
|
|||
std::vector<std::string> cycle;
|
||||
std::transform(found, visited.cend(), std::back_inserter(cycle), printInputPath);
|
||||
cycle.push_back(printInputPath(path));
|
||||
throw Error("follow cycle detected: [%s]", dropEmptyInitThenConcatStringsSep(" -> ", cycle));
|
||||
throw Error("follow cycle detected: [%s]", concatStringsSep(" -> ", cycle));
|
||||
}
|
||||
visited.push_back(path);
|
||||
|
||||
|
@ -367,7 +369,7 @@ void check();
|
|||
|
||||
std::string printInputPath(const InputPath & path)
|
||||
{
|
||||
return dropEmptyInitThenConcatStringsSep("/", path);
|
||||
return concatStringsSep("/", path);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue