From 3906fa5d2f6f30ab7e8d4ce9e86af1382625bc7d Mon Sep 17 00:00:00 2001 From: Tom French Date: Thu, 10 Aug 2023 11:45:00 +0100 Subject: [PATCH] chore: clippy fixes --- .../noirc_frontend/src/hir/resolution/resolver.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/crates/noirc_frontend/src/hir/resolution/resolver.rs b/crates/noirc_frontend/src/hir/resolution/resolver.rs index 6c154aade06..6b3ea3eed69 100644 --- a/crates/noirc_frontend/src/hir/resolution/resolver.rs +++ b/crates/noirc_frontend/src/hir/resolution/resolver.rs @@ -1570,7 +1570,7 @@ mod test { let mut all_captures: Vec> = Vec::new(); for func in program.functions { let id = interner.push_fn(HirFunction::empty()); - interner.push_function_definition(func.name().clone().to_string(), id); + interner.push_function_definition(func.name().to_string(), id); path_resolver.insert_func(func.name().to_owned(), id); let resolver = Resolver::new(&mut interner, &path_resolver, &def_maps, file); @@ -1613,7 +1613,7 @@ mod test { } HirStatement::Error => panic!("Invalid HirStatement!"), } - get_lambda_captures(expr, &interner, result); // TODO: dyn filter function as parameter + get_lambda_captures(expr, interner, result); // TODO: dyn filter function as parameter } } @@ -1632,7 +1632,7 @@ mod test { // Check for other captures recursively within the lambda body let hir_body_expr = interner.expression(&lambda_expr.body); - if let HirExpression::Block(block_expr) = hir_body_expr.clone() { + if let HirExpression::Block(block_expr) = hir_body_expr { parse_statement_blocks(block_expr.statements(), interner, result); } } @@ -1820,7 +1820,7 @@ mod test { let errors = resolve_src_code(src, vec!["main", "foo"]); if !errors.is_empty() { println!("Unexpected errors: {:?}", errors); - assert!(false); // there should be no errors + unreachable!("there should be no errors"); } } @@ -1857,8 +1857,7 @@ mod test { "#; let parsed_captures = get_program_captures(src); - let mut expected_captures = vec![]; - expected_captures.push(vec!["y".to_string()]); + let expected_captures = vec![vec!["y".to_string()]]; assert_eq!(expected_captures, parsed_captures); } @@ -1893,7 +1892,7 @@ mod test { assert!(errors.is_empty()); if !errors.is_empty() { println!("Unexpected errors: {:?}", errors); - assert!(false); // there should be no errors + unreachable!("there should be no errors"); } let expected_captures = vec![