git.delta.rocks / jrsonnet / refs/commits / 9268ff4f09ce

difftreelog

fix use new ArrValue variants

Yaroslav Bolyukin2021-01-24parent: #00b4f05.patch.diff
in: master

2 files changed

modifiedcrates/jrsonnet-evaluator/src/builtin/mod.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/builtin/mod.rs
+++ b/crates/jrsonnet-evaluator/src/builtin/mod.rs
@@ -379,7 +379,7 @@
 		1, to: ty!(number) => Val::Num;
 	], {
 		if to < from {
-			return Ok(Val::Arr(Rc::new(Vec::new())))
+			return Ok(Val::Arr(ArrValue::new_eager()))
 		}
 		let mut out = Vec::with_capacity((1+to as usize-from as usize).max(0));
 		for i in from as usize..=to as usize {
modifiedcrates/jrsonnet-evaluator/src/val.rsdiffbeforeafterboth
179 Extended(Box<(Self, Self)>),179 Extended(Box<(Self, Self)>),
180}180}
181impl ArrValue {181impl ArrValue {
182 pub fn new_eager() -> Self {
183 Self::Eager(Rc::new(Vec::new()))
184 }
185
182 pub fn len(&self) -> usize {186 pub fn len(&self) -> usize {
183 match self {187 match self {