diff --git a/asg/src/statement/assign.rs b/asg/src/statement/assign.rs index b3842d3f30..e1f44b8210 100644 --- a/asg/src/statement/assign.rs +++ b/asg/src/statement/assign.rs @@ -213,7 +213,7 @@ impl<'a> FromAst<'a, leo_ast::AssignStatement> for &'a Statement<'a> { let statement = scope.context.alloc_statement(Statement::Assign(AssignStatement { parent: Cell::new(None), span: Some(statement.span.clone()), - operation: statement.operation.clone(), + operation: statement.operation, target_variable: Cell::new(variable), target_accesses, value: Cell::new(value), @@ -231,7 +231,7 @@ impl<'a> FromAst<'a, leo_ast::AssignStatement> for &'a Statement<'a> { impl<'a> Into for &AssignStatement<'a> { fn into(self) -> leo_ast::AssignStatement { leo_ast::AssignStatement { - operation: self.operation.clone(), + operation: self.operation, assignee: leo_ast::Assignee { identifier: self.target_variable.get().borrow().name.clone(), accesses: self diff --git a/ast/src/reducer/canonicalization.rs b/ast/src/reducer/canonicalization.rs index 0ad3ce4e12..218e90a740 100644 --- a/ast/src/reducer/canonicalization.rs +++ b/ast/src/reducer/canonicalization.rs @@ -347,7 +347,7 @@ impl Canonicalizer { Statement::Assign(AssignStatement { assignee, value, - operation: assign.operation.clone(), + operation: assign.operation, span: assign.span.clone(), }) } diff --git a/ast/src/reducer/reconstructing_reducer.rs b/ast/src/reducer/reconstructing_reducer.rs index 6be99ef978..8cf5c30bb7 100644 --- a/ast/src/reducer/reconstructing_reducer.rs +++ b/ast/src/reducer/reconstructing_reducer.rs @@ -325,7 +325,7 @@ pub trait ReconstructingReducer { value: Expression, ) -> Result { Ok(AssignStatement { - operation: assign.operation.clone(), + operation: assign.operation, assignee, value, span: assign.span.clone(), diff --git a/compiler/src/statement/assign/assignee/array_index.rs b/compiler/src/statement/assign/assignee/array_index.rs index 5f6485c885..14cee72017 100644 --- a/compiler/src/statement/assign/assignee/array_index.rs +++ b/compiler/src/statement/assign/assignee/array_index.rs @@ -65,7 +65,7 @@ impl<'a, F: PrimeField, G: GroupType> ConstrainedProgram<'a, F, G> { } } } else { - for (i, item) in input.into_iter().enumerate() { + for (i, item) in input.iter_mut().enumerate() { let namespace_string = format!( "evaluate dyn array assignment eq {} {}:{}", i, context.span.line_start, context.span.col_start diff --git a/test-framework/src/runner.rs b/test-framework/src/runner.rs index 26fa0a59e7..79dcdb9447 100644 --- a/test-framework/src/runner.rs +++ b/test-framework/src/runner.rs @@ -67,10 +67,8 @@ pub fn run_tests(runner: &T, expectation_category: &str) { let mut outputs = vec![]; for (path, content) in tests.into_iter() { - if !filter.is_empty() { - if !path.contains(filter) { - continue; - } + if !filter.is_empty() && !path.contains(filter) { + continue; } let config = extract_test_config(&content); if config.is_none() {