difftreelog
fix lazy array initialization
in: master
2 files changed
crates/jrsonnet-evaluator/src/evaluate/mod.rsdiffbeforeafterboth--- a/crates/jrsonnet-evaluator/src/evaluate/mod.rs
+++ b/crates/jrsonnet-evaluator/src/evaluate/mod.rs
@@ -18,8 +18,8 @@
throw,
typed::Typed,
val::{CachedUnbound, IndexableVal, StrValue, Thunk, ThunkValue},
- Context, GcHashMap, ObjValue, ObjValueBuilder, ObjectAssertion, Pending, Result, State,
- Unbound, Val,
+ Context, GcHashMap, ObjValue, ObjValueBuilder, ObjectAssertion, Pending, Result, ResultExt,
+ State, Unbound, Val,
};
pub mod destructure;
pub mod operator;
@@ -134,13 +134,13 @@
let fctx = Pending::new();
let mut new_bindings = GcHashMap::with_capacity(var.capacity_hint());
- let value = Thunk::evaluated(Val::Arr(ArrValue::lazy(Cc::new(vec![
+ let value = Thunk::evaluated(Val::Arr(ArrValue::lazy(vec![
Thunk::evaluated(Val::Str(StrValue::Flat(field.clone()))),
Thunk::new(ObjectFieldThunk {
field: field.clone(),
obj: obj.clone(),
}),
- ]))));
+ ])));
destruct(var, value, fctx.clone(), &mut new_bindings)?;
let ctx = ctx
.clone()
crates/jrsonnet-parser/src/expr.rsdiffbeforeafterboth26#[cfg_attr(feature = "structdump", derive(Codegen))]26#[cfg_attr(feature = "structdump", derive(Codegen))]27#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]27#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]28#[derive(Debug, Clone, Copy, PartialEq, Eq, Trace)]28#[derive(Debug, Clone, Copy, PartialEq, Eq, Trace)]29#[repr(u8)]29pub enum Visibility {30pub enum Visibility {30 /// :31 /// :31 Normal,32 Normal,