1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-09 12:06:01 +01:00

libutil: Make CanonPath::root const

By all means CanonPath::root must be immutable. Let's enforce this with
in the code.
This commit is contained in:
Sergei Zimmerman 2025-10-14 02:24:03 +03:00
parent b56cc1808d
commit edf9163c22
No known key found for this signature in database
2 changed files with 2 additions and 2 deletions

View file

@ -5,7 +5,7 @@
namespace nix { namespace nix {
CanonPath CanonPath::root = CanonPath("/"); const CanonPath CanonPath::root = CanonPath("/");
static std::string absPathPure(std::string_view path) static std::string absPathPure(std::string_view path)
{ {

View file

@ -69,7 +69,7 @@ public:
*/ */
CanonPath(const std::vector<std::string> & elems); CanonPath(const std::vector<std::string> & elems);
static CanonPath root; static const CanonPath root;
/** /**
* If `raw` starts with a slash, return * If `raw` starts with a slash, return