difftreelog
refactor! rename with_super to extend_from
in: master
2 files changed
crates/jrsonnet-evaluator/src/evaluate.rsdiffbeforeafterboth92 (Val::Str(s), o) => Val::Str(format!("{}{}", s, o.clone().to_string()?).into()),92 (Val::Str(s), o) => Val::Str(format!("{}{}", s, o.clone().to_string()?).into()),93 (o, Val::Str(s)) => Val::Str(format!("{}{}", o.clone().to_string()?, s).into()),93 (o, Val::Str(s)) => Val::Str(format!("{}{}", o.clone().to_string()?, s).into()),949495 (Val::Obj(v1), Val::Obj(v2)) => Val::Obj(v2.with_super(v1.clone())),95 (Val::Obj(v1), Val::Obj(v2)) => Val::Obj(v2.extend_from(v1.clone())),96 (Val::Arr(a), Val::Arr(b)) => {96 (Val::Arr(a), Val::Arr(b)) => {97 let mut out = Vec::with_capacity(a.len() + b.len());97 let mut out = Vec::with_capacity(a.len() + b.len());98 out.extend(a.iter_lazy());98 out.extend(a.iter_lazy());crates/jrsonnet-evaluator/src/obj.rsdiffbeforeafterboth62 pub fn new_empty() -> Self {62 pub fn new_empty() -> Self {63 Self::new(None, Rc::new(FxHashMap::default()))63 Self::new(None, Rc::new(FxHashMap::default()))64 }64 }65 pub fn with_super(&self, super_obj: Self) -> Self {65 pub fn extend_from(&self, super_obj: Self) -> Self {66 match &self.0.super_obj {66 match &self.0.super_obj {67 None => Self::new(Some(super_obj), self.0.this_entries.clone()),67 None => Self::new(Some(super_obj), self.0.this_entries.clone()),68 Some(v) => Self::new(Some(v.with_super(super_obj)), self.0.this_entries.clone()),68 Some(v) => Self::new(Some(v.extend_from(super_obj)), self.0.this_entries.clone()),69 }69 }70 }70 }71 pub fn with_this(&self, this_obj: Self) -> Self {71 pub fn with_this(&self, this_obj: Self) -> Self {