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: clippy fixes #3358

Merged
merged 2 commits into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
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
3 changes: 1 addition & 2 deletions acvm-repo/barretenberg_blackbox_solver/src/wasm/pedersen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
let result_ptr: usize = 0;

self.call_multiple(
"pedersen_plookup_commit_with_hash_index",

Check warning on line 26 in acvm-repo/barretenberg_blackbox_solver/src/wasm/pedersen.rs

View workflow job for this annotation

GitHub Actions / Spellcheck / Spellcheck

Unknown word (plookup)
vec![&input_ptr, &result_ptr.into(), &hash_index.into()],
)?;

Expand All @@ -42,7 +42,7 @@
let result_ptr: usize = 0;

self.call_multiple(
"pedersen_plookup_compress_with_hash_index",

Check warning on line 45 in acvm-repo/barretenberg_blackbox_solver/src/wasm/pedersen.rs

View workflow job for this annotation

GitHub Actions / Spellcheck / Spellcheck

Unknown word (plookup)
vec![&input_ptr, &result_ptr.into(), &hash_index.into()],
)?;

Expand All @@ -57,8 +57,7 @@
#[test]
fn pedersen_hash_to_point() -> Result<(), Error> {
let barretenberg = Barretenberg::new();
let (x, y) = barretenberg
.encrypt(vec![FieldElement::from(1 as u128), FieldElement::from(1 as u128)], 1)?;
let (x, y) = barretenberg.encrypt(vec![FieldElement::one(), FieldElement::one()], 1)?;
let expected_x = FieldElement::from_hex(
"0x12afb43195f5c621d1d2cabb5f629707095c5307fd4185a663d4e80bb083e878",
)
Expand Down
4 changes: 2 additions & 2 deletions compiler/noirc_frontend/src/hir/type_check/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,9 @@ impl<'interner> TypeChecker<'interner> {
argument_types: &mut [(Type, ExprId, noirc_errors::Span)],
) {
let expected_object_type = match function_type {
Type::Function(args, _, _) => args.get(0),
Type::Function(args, _, _) => args.first(),
Type::Forall(_, typ) => match typ.as_ref() {
Type::Function(args, _, _) => args.get(0),
Type::Function(args, _, _) => args.first(),
typ => unreachable!("Unexpected type for function: {typ}"),
},
typ => unreachable!("Unexpected type for function: {typ}"),
Expand Down
2 changes: 1 addition & 1 deletion tooling/debugger/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ impl<'a, B: BlackBoxFunctionSolver> DebugContext<'a, B> {
}

pub(super) fn step_into_opcode(&mut self) -> DebugCommandResult {
if matches!(self.brillig_solver, Some(_)) {
if self.brillig_solver.is_some() {
self.step_brillig_opcode()
} else {
match self.acvm.step_into_brillig_opcode() {
Expand Down
2 changes: 1 addition & 1 deletion tooling/nargo/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ fn extract_locations_from_error(
_ => None,
}?;

if let Some(OpcodeLocation::Brillig { acir_index, .. }) = opcode_locations.get(0) {
if let Some(OpcodeLocation::Brillig { acir_index, .. }) = opcode_locations.first() {
opcode_locations.insert(0, OpcodeLocation::Acir(*acir_index));
}

Expand Down
1 change: 0 additions & 1 deletion tooling/nargo_fmt/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
let starts_with_single_line_comment = leading_trimmed.starts_with("//");

if ends_with_block_comment {
let comment_end = leading_trimmed.rfind(|c| c == '/').unwrap();

Check warning on line 92 in tooling/nargo_fmt/src/utils.rs

View workflow job for this annotation

GitHub Actions / Spellcheck / Spellcheck

Unknown word (rfind)

if leading[comment_end..].contains('\n') {
different_line = true;
Expand Down Expand Up @@ -124,7 +124,6 @@
Lexer::new(self)
.skip_comments(false)
.flatten()
.into_iter()
.find_map(|spanned| f(spanned.token()).then(|| spanned.to_span().end()))
}
}
Expand Down