about summary refs log tree commit diff
path: root/third_party/nix/src/nix/why-depends.cc
diff options
context:
space:
mode:
authorKane York <kanepyork@gmail.com>2020-11-28T00·31-0800
committerkanepyork <rikingcoding@gmail.com>2020-11-28T00·59+0000
commit516c046ed984ba74da9a36f21e356dae9e227ca3 (patch)
tree14daaf1ff037440025caa12ca60888b9cefbb3bb /third_party/nix/src/nix/why-depends.cc
parent363dbeae95ce46be2b716506de90717998391a57 (diff)
refactor(tvix): remove all 'using namespace' from nix command r/1949
clang-tidy: google-build-using-namespace
Change-Id: I07ea10b03a6d9582c0508747698038f7106e8f63
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2181
Tested-by: BuildkiteCI
Reviewed-by: glittershark <grfn@gws.fyi>
Diffstat (limited to '')
-rw-r--r--third_party/nix/src/nix/why-depends.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/third_party/nix/src/nix/why-depends.cc b/third_party/nix/src/nix/why-depends.cc
index e18314e7fd..954d619ef3 100644
--- a/third_party/nix/src/nix/why-depends.cc
+++ b/third_party/nix/src/nix/why-depends.cc
@@ -7,8 +7,7 @@
 #include "libstore/store-api.hh"
 #include "nix/command.hh"
 
-using namespace nix;
-
+namespace {
 static std::string hilite(const std::string& s, size_t pos, size_t len,
                           const std::string& colour = ANSI_RED) {
   return std::string(s, 0, pos) + colour + std::string(s, pos, len) +
@@ -22,7 +21,9 @@ static std::string filterPrintable(const std::string& s) {
   }
   return res;
 }
+}  // namespace
 
+namespace nix {
 struct CmdWhyDepends final : SourceExprCommand {
   std::string _package, _dependency;
   bool all = false;
@@ -263,5 +264,6 @@ struct CmdWhyDepends final : SourceExprCommand {
     }
   }
 };
+}  // namespace nix
 
-static RegisterCommand r1(make_ref<CmdWhyDepends>());
+static nix::RegisterCommand r1(nix::make_ref<nix::CmdWhyDepends>());