Skip to content

Commit be1168e

Browse files
committed
fixed error causing Div function to expect a different type
1 parent 9adc5e9 commit be1168e

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

primitives/src/targeting/eval.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -208,17 +208,17 @@ fn eval(input: &Input, output: &mut Output, rule: &Rule) -> Result<Option<Value>
208208
let product = eval(
209209
input,
210210
output,
211-
&Rule::Function(Function::Mul(*first_rule, *second_rule)),
211+
&Rule::Function(Function::Mul(first_rule.clone(), second_rule.clone())),
212212
)?
213-
.ok_or(Error::TypeError);
214-
let value = match product {
215-
Ok(product) => {
216-
let product_rule = Rule::Value(product);
217-
let boxed_rule = Box::new(product_rule);
218-
eval(input, output, &Rule::Function(Function::Div(boxed_rule, *third_rule)))
219-
},
220-
_ => return Err(Error::TypeError),
221-
};
213+
.ok_or(Error::TypeError)?;
214+
let product_rule = Rule::Value(product);
215+
let boxed_rule = Box::new(product_rule);
216+
let value = eval(
217+
input,
218+
output,
219+
&Rule::Function(Function::Div(boxed_rule, third_rule.clone())),
220+
)?
221+
.ok_or(Error::TypeError)?;
222222

223223
Some(value)
224224
}

0 commit comments

Comments
 (0)