nix-eval-jobs: Remove Value default construction from releaseExprTopLevelValue

Change-Id: I7461323771a50729c66d9e3160c4768f6a6a6964
This commit is contained in:
skye
2026-04-22 08:37:17 -04:00
parent c40afdea73
commit cda9e01053
+12 -11
View File
@@ -45,17 +45,18 @@
static nix::Value releaseExprTopLevelValue(nix::EvalState &state,
nix::Bindings &autoArgs,
MyArgs &args) {
nix::Value vTop;
if (args.fromArgs) {
nix::Expr &e = state.ctx.parseExprFromString(args.releaseExpr,
nix::CanonPath::fromCwd());
vTop = state.eval(e);
} else {
vTop = state.evalFile(
state.aio.blockOn(nix::lookupFileArg(state.ctx, args.releaseExpr))
.unwrap());
}
nix::Value vTop = [&]() {
if (args.fromArgs) {
nix::Expr &e = state.ctx.parseExprFromString(
args.releaseExpr, nix::CanonPath::fromCwd());
return state.eval(e);
} else {
return state.evalFile(
state.aio
.blockOn(nix::lookupFileArg(state.ctx, args.releaseExpr))
.unwrap());
}
}();
return state.autoCallFunction(autoArgs, vTop, {});
}