From 8622d7021a59a09cd1bf8ca4061739e84895e3ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustavo=20Gir=C3=A1ldez?= Date: Thu, 12 Oct 2023 22:59:05 -0400 Subject: [PATCH] chore: apply clippy suggestions --- tooling/debugger/src/lib.rs | 26 ++++++++++---------------- tooling/nargo_cli/src/cli/debug_cmd.rs | 2 -- 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/tooling/debugger/src/lib.rs b/tooling/debugger/src/lib.rs index ed9b89cbee8..d7690411965 100644 --- a/tooling/debugger/src/lib.rs +++ b/tooling/debugger/src/lib.rs @@ -78,19 +78,16 @@ impl<'backend, B: BlackBoxFunctionSolver> DebugContext<'backend, B> { } fn show_source_code_location(location: &OpcodeLocation, debug_artifact: &DebugArtifact) { - let locations = debug_artifact.debug_symbols[0].opcode_location(&location); - match locations { - Some(locations) => { - for loc in locations { - let file = &debug_artifact.file_map[&loc.file]; - let source = &file.source.as_str(); - let start = loc.span.start() as usize; - let end = loc.span.end() as usize; - println!("At {}:{start}-{end}", file.path.as_path().display()); - println!("\n{}\n", &source[start..end]); - } + let locations = debug_artifact.debug_symbols[0].opcode_location(location); + if let Some(locations) = locations { + for loc in locations { + let file = &debug_artifact.file_map[&loc.file]; + let source = &file.source.as_str(); + let start = loc.span.start() as usize; + let end = loc.span.end() as usize; + println!("At {}:{start}-{end}", file.path.as_path().display()); + println!("\n{}\n", &source[start..end]); } - None => {} } } @@ -140,10 +137,7 @@ pub fn debug_circuit( context.borrow().show_current_vm_status(); let handle_result = |result| { - solved.set(match result { - SolveResult::Done => true, - _ => false, - }); + solved.set(matches!(result, SolveResult::Done)); Ok(map_command_status(result)) }; diff --git a/tooling/nargo_cli/src/cli/debug_cmd.rs b/tooling/nargo_cli/src/cli/debug_cmd.rs index 9a1115ae7be..5dcb2c7bdec 100644 --- a/tooling/nargo_cli/src/cli/debug_cmd.rs +++ b/tooling/nargo_cli/src/cli/debug_cmd.rs @@ -10,8 +10,6 @@ use noirc_abi::InputMap; use noirc_driver::{CompileOptions, CompiledProgram}; use noirc_frontend::graph::CrateName; -use noir_debugger; - use super::compile_cmd::compile_bin_package; use super::fs::{inputs::read_inputs_from_file, witness::save_witness_to_dir}; use super::NargoConfig;