about summary refs log tree commit diff
path: root/third_party/nix/src/nix-build
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2020-05-24T21·29+0100
committerVincent Ambo <tazjin@google.com>2020-05-24T21·29+0100
commit838f86b0fd880b26539664140f04e5d16669dad8 (patch)
treec8fee2f0c136fbe5bb0735604e2f04d5b02698ba /third_party/nix/src/nix-build
parentf30b2e610d9e612504a9f6460e0cc83413b80aeb (diff)
style(3p/nix): Remove 'using std::*' from types.hh r/840
It is considered bad form to use things from includes in headers, as
these directives propagate to everywhere else and can make it
confusing.

types.hh (which is includes almost literally everywhere) had some of
these directives, which this commit removes.
Diffstat (limited to 'third_party/nix/src/nix-build')
-rw-r--r--third_party/nix/src/nix-build/nix-build.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/third_party/nix/src/nix-build/nix-build.cc b/third_party/nix/src/nix-build/nix-build.cc
index a98603f351..6906a80583 100644
--- a/third_party/nix/src/nix-build/nix-build.cc
+++ b/third_party/nix/src/nix-build/nix-build.cc
@@ -27,10 +27,10 @@ using namespace std::string_literals;
 /* Recreate the effect of the perl shellwords function, breaking up a
  * string into arguments like a shell word, including escapes
  */
-std::vector<string> shellwords(const string& s) {
+std::vector<std::string> shellwords(const std::string& s) {
   std::regex whitespace("^(\\s+).*");
   auto begin = s.cbegin();
-  std::vector<string> res;
+  std::vector<std::string> res;
   std::string cur;
   enum state { sBegin, sQuote };
   state st = sBegin;
@@ -90,14 +90,14 @@ static void _main(int argc, char** argv) {
 
   auto inShebang = false;
   std::string script;
-  std::vector<string> savedArgs;
+  std::vector<std::string> savedArgs;
 
   AutoDelete tmpDir(createTempDir("", myName));
 
   std::string outLink = "./result";
 
   // List of environment variables kept for --pure
-  std::set<string> keepVars{
+  std::set<std::string> keepVars{
       "HOME",         "USER", "LOGNAME", "DISPLAY",         "PATH", "TERM",
       "IN_NIX_SHELL", "TZ",   "PAGER",   "NIX_BUILD_SHELL", "SHLVL"};
 
@@ -405,7 +405,7 @@ static void _main(int argc, char** argv) {
     // Build or fetch all dependencies of the derivation.
     for (const auto& input : drv.inputDrvs) {
       if (std::all_of(envExclude.cbegin(), envExclude.cend(),
-                      [&](const string& exclude) {
+                      [&](const std::string& exclude) {
                         return !std::regex_search(input.first,
                                                   std::regex(exclude));
                       })) {
@@ -452,7 +452,7 @@ static void _main(int argc, char** argv) {
     for (auto& var : drv.env) {
       if (passAsFile.count(var.first) != 0u) {
         keepTmp = true;
-        string fn = ".attr-" + std::to_string(fileNr++);
+        std::string fn = ".attr-" + std::to_string(fileNr++);
         Path p = (Path)tmpDir + "/" + fn;
         writeFile(p, var.second);
         env[var.first + "Path"] = p;
@@ -489,7 +489,7 @@ static void _main(int argc, char** argv) {
             (Path)tmpDir, (pure ? "" : "p=$PATH; "),
             (pure ? "" : "PATH=$PATH:$p; unset p; "), dirOf(shell), shell,
             (getenv("TZ") != nullptr
-                 ? (string("export TZ='") + getenv("TZ") + "'; ")
+                 ? (std::string("export TZ='") + getenv("TZ") + "'; ")
                  : ""),
             envCommand));