From 264a7dedd42e27cd9e604037640cf0594b2ec46b Mon Sep 17 00:00:00 2001 From: Laurenz Date: Fri, 19 Mar 2021 17:57:31 +0100 Subject: =?UTF-8?q?Scheduled=20maintenance=20=F0=9F=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - New naming scheme - TextNode instead of NodeText - CallExpr instead of ExprCall - ... - Less glob imports - Removes Value::Args variant - Removes prelude - Renames Layouted to Fragment - Moves font into env - Moves shaping into layout - Moves frame into separate module --- src/eval/ops.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/eval/ops.rs') diff --git a/src/eval/ops.rs b/src/eval/ops.rs index c4adf587..bef4dd58 100644 --- a/src/eval/ops.rs +++ b/src/eval/ops.rs @@ -1,4 +1,5 @@ -use super::*; +use super::{ArrayValue, DictValue, TemplateNode, Value}; +use crate::syntax::Span; use Value::*; /// Apply the plus operator to a value. @@ -189,12 +190,12 @@ fn value_eq(lhs: &Value, rhs: &Value) -> bool { } /// Compute whether two arrays are equal. -fn array_eq(a: &ValueArray, b: &ValueArray) -> bool { +fn array_eq(a: &ArrayValue, b: &ArrayValue) -> bool { a.len() == b.len() && a.iter().zip(b).all(|(x, y)| value_eq(x, y)) } /// Compute whether two dictionaries are equal. -fn dict_eq(a: &ValueDict, b: &ValueDict) -> bool { +fn dict_eq(a: &DictValue, b: &DictValue) -> bool { a.len() == b.len() && a.iter().all(|(k, x)| b.get(k).map_or(false, |y| value_eq(x, y))) } -- cgit v1.2.3