Skip to content

Commit

Permalink
chore: apply clippy suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
ggiraldez committed Oct 13, 2023
1 parent f20d0e1 commit 8622d70
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 18 deletions.
26 changes: 10 additions & 16 deletions tooling/debugger/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {}
}
}

Expand Down Expand Up @@ -140,10 +137,7 @@ pub fn debug_circuit<B: BlackBoxFunctionSolver>(
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))
};

Expand Down
2 changes: 0 additions & 2 deletions tooling/nargo_cli/src/cli/debug_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8622d70

Please sign in to comment.