difftreelog
fix lazy object comprehension
in: master
2 files changed
cmds/jrsonnet/Cargo.tomldiffbeforeafterboth15 "exp-object-iteration",15 "exp-object-iteration",16 "exp-bigint",16 "exp-bigint",17 "exp-apply",17 "exp-apply",18 "exp-regex",18]19]19# Use mimalloc as allocator20# Use mimalloc as allocator20mimalloc = ["mimallocator"]21mimalloc = ["mimallocator"]crates/jrsonnet-evaluator/src/evaluate/mod.rsdiffbeforeafterboth596 ArrComp(expr, comp_specs) => {596 ArrComp(expr, comp_specs) => {597 let mut out = Vec::new();597 let mut out = Vec::new();598 evaluate_comp(ctx, comp_specs, &mut |ctx| {598 evaluate_comp(ctx, comp_specs, &mut |ctx| {599 #[derive(Trace)]600 struct EvaluateThunk {601 ctx: Context,602 expr: LocExpr,603 }604 impl ThunkValue for EvaluateThunk {605 type Output = Val;606 fn get(self: Box<Self>) -> Result<Val> {607 evaluate(self.ctx, &self.expr)608 }609 }599 out.push(evaluate(ctx, expr)?);610 out.push(Thunk::new(EvaluateThunk {611 ctx,612 expr: expr.clone(),613 }));600 Ok(())614 Ok(())601 })?;615 })?;602 Val::Arr(ArrValue::eager(out))616 Val::Arr(ArrValue::lazy(out))603 }617 }604 Obj(body) => Val::Obj(evaluate_object(ctx, body)?),618 Obj(body) => Val::Obj(evaluate_object(ctx, body)?),605 ObjExtend(a, b) => evaluate_add_op(619 ObjExtend(a, b) => evaluate_add_op(