Use auto with some FileIngestionMethod local variables

This commit is contained in:
John Ericson 2020-03-30 18:15:55 -04:00
parent 225e62a56a
commit bbbb7c1bc7
2 changed files with 3 additions and 3 deletions

View file

@ -563,7 +563,7 @@ static void prim_derivationStrict(EvalState & state, const Pos & pos, Value * *
std::optional<std::string> outputHash;
std::string outputHashAlgo;
FileIngestionMethod outputHashRecursive = FileIngestionMethod::Flat;
auto outputHashRecursive = FileIngestionMethod::Flat;
StringSet outputs;
outputs.insert("out");

View file

@ -174,7 +174,7 @@ static void opAdd(Strings opFlags, Strings opArgs)
store. */
static void opAddFixed(Strings opFlags, Strings opArgs)
{
FileIngestionMethod recursive = FileIngestionMethod::Flat;
auto recursive = FileIngestionMethod::Flat;
for (auto & i : opFlags)
if (i == "--recursive") recursive = FileIngestionMethod::Recursive;
@ -194,7 +194,7 @@ static void opAddFixed(Strings opFlags, Strings opArgs)
/* Hack to support caching in `nix-prefetch-url'. */
static void opPrintFixedPath(Strings opFlags, Strings opArgs)
{
FileIngestionMethod recursive = FileIngestionMethod::Flat;
auto recursive = FileIngestionMethod::Flat;
for (auto i : opFlags)
if (i == "--recursive") recursive = FileIngestionMethod::Recursive;