Skip to content

Commit

Permalink
chore: Address clippy warnings (#2246)
Browse files Browse the repository at this point in the history
chore: clippy fixes
  • Loading branch information
TomAFrench authored Aug 10, 2023
1 parent d309cc0 commit 650937a
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions crates/noirc_frontend/src/hir/resolution/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1570,7 +1570,7 @@ mod test {
let mut all_captures: Vec<Vec<String>> = 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);
Expand Down Expand Up @@ -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
}
}

Expand All @@ -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);
}
}
Expand Down Expand Up @@ -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");
}
}

Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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![
Expand Down

0 comments on commit 650937a

Please sign in to comment.