1
0
Fork 0
mirror of synced 2025-09-24 04:40:05 +00:00

use string instead of cloning

This commit is contained in:
dark64 2021-04-19 11:32:11 +02:00
parent a271993832
commit 41a1b5f661

View file

@ -657,12 +657,13 @@ impl<'ast, 'a, T: Field> ResultFolder<'ast, T> for Propagator<'ast, 'a, T> {
Ok(statements)
}
TypedStatement::Assertion(ref e) => {
let expr = self.fold_boolean_expression(e.clone())?;
TypedStatement::Assertion(e) => {
let e_str = e.to_string();
let expr = self.fold_boolean_expression(e)?;
match expr {
BooleanExpression::Value(v) if !v => Err(Error::Type(format!(
"Assertion failed on expression `{}`",
e
e_str
))),
_ => Ok(vec![TypedStatement::Assertion(expr)]),
}