From 866d5e6cf4f7dc213ff56941afe9621a866b2cb1 Mon Sep 17 00:00:00 2001 From: Sergei Zimmerman Date: Tue, 5 Aug 2025 02:25:40 +0300 Subject: [PATCH] treewide: Sprinkle more anonymous namespace for classes private to TUs This code should be private to the corresponding translation units. --- src/libutil/args.cc | 4 ++++ src/nix/diff-closures.cc | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/libutil/args.cc b/src/libutil/args.cc index 2e6d85afd..f4309473b 100644 --- a/src/libutil/args.cc +++ b/src/libutil/args.cc @@ -81,6 +81,8 @@ std::optional RootArgs::needsCompletion(std::string_view s) return {}; } +namespace { + /** * Basically this is `typedef std::optional Parser(std::string_view s, Strings & r);` * @@ -246,6 +248,8 @@ void ParseQuoted::operator()(std::shared_ptr & state, Strings & r) assert(false); } +} // namespace + Strings parseShebangContent(std::string_view s) { Strings result; diff --git a/src/nix/diff-closures.cc b/src/nix/diff-closures.cc index 020c3e13b..cbf842e5c 100644 --- a/src/nix/diff-closures.cc +++ b/src/nix/diff-closures.cc @@ -10,11 +10,15 @@ namespace nix { +namespace { + struct Info { std::string outputName; }; +} // namespace + // name -> version -> store paths typedef std::map>> GroupedPaths;