diff options
Diffstat (limited to 'src/nix')
-rw-r--r-- | src/nix/repl.cc | 4 | ||||
-rw-r--r-- | src/nix/upgrade-nix.cc | 12 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/nix/repl.cc b/src/nix/repl.cc index f84774a53..4723a1974 100644 --- a/src/nix/repl.cc +++ b/src/nix/repl.cc @@ -693,8 +693,8 @@ struct CmdRepl : StoreCommand, MixEvalArgs void run(ref<Store> store) override { - NixRepl repl(searchPath, openStore()); - repl.mainLoop(files); + auto repl = std::make_unique<NixRepl>(searchPath, openStore()); + repl->mainLoop(files); } }; diff --git a/src/nix/upgrade-nix.cc b/src/nix/upgrade-nix.cc index 21892c31a..e23ae7923 100644 --- a/src/nix/upgrade-nix.cc +++ b/src/nix/upgrade-nix.cc @@ -118,13 +118,13 @@ struct CmdUpgradeNix : StoreCommand auto req = DownloadRequest("https://github.com/NixOS/nixpkgs/raw/master/nixos/modules/installer/tools/nix-fallback-paths.nix"); auto res = getDownloader()->download(req); - EvalState state(Strings(), store); - auto v = state.allocValue(); - state.eval(state.parseExprFromString(*res.data, "/no-such-path"), *v); - Bindings & bindings(*state.allocBindings(0)); - auto v2 = findAlongAttrPath(state, settings.thisSystem, bindings, *v); + auto state = std::make_unique<EvalState>(Strings(), store); + auto v = state->allocValue(); + state->eval(state->parseExprFromString(*res.data, "/no-such-path"), *v); + Bindings & bindings(*state->allocBindings(0)); + auto v2 = findAlongAttrPath(*state, settings.thisSystem, bindings, *v); - return state.forceString(*v2); + return state->forceString(*v2); } }; |