From dc91b07e5cf77fcacb62b602f7f2b9ad144a65da Mon Sep 17 00:00:00 2001 From: Protryon Date: Fri, 4 Jun 2021 06:03:59 -0700 Subject: [PATCH] clippy --- asg/src/statement/assign.rs | 4 ++-- ast/src/reducer/canonicalization.rs | 2 +- ast/src/reducer/reconstructing_reducer.rs | 2 +- compiler/src/statement/assign/assignee/array_index.rs | 2 +- test-framework/src/runner.rs | 6 ++---- 5 files changed, 7 insertions(+), 9 deletions(-) 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() {