Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Address clippy warnings #2246

Merged
merged 1 commit into from
Aug 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
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 @@
}
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 @@

// 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 @@
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 @@

"#;
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 @@
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 Expand Up @@ -1926,7 +1925,7 @@
println(f"I want to print {0}");

let new_val = 10;
println(f"randomstring{new_val}{new_val}");

Check warning on line 1928 in crates/noirc_frontend/src/hir/resolution/resolver.rs

View workflow job for this annotation

GitHub Actions / Spellcheck / Spellcheck

Unknown word (randomstring)
}
fn println<T>(x : T) -> T {
x
Expand Down