Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Tom French <[email protected]>
  • Loading branch information
ggiraldez and TomAFrench authored Oct 30, 2023
1 parent 97b33d5 commit 6fe9937
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions tooling/debugger/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ impl<'a, B: BlackBoxFunctionSolver> DebugContext<'a, B> {
return result;
}
let new_location = self.get_current_source_location();
if matches!(new_location, Some(..)) && new_location != start_location {
if new_location.is_some() && new_location != start_location {
return DebugCommandResult::Ok;
}
}
Expand Down Expand Up @@ -201,10 +201,11 @@ impl<'a, B: BlackBoxFunctionSolver> DebugContext<'a, B> {
acir_index < opcodes.len()
&& matches!(opcodes[acir_index], Opcode::Brillig(..))
&& {
let Opcode::Brillig(ref brillig) = opcodes[acir_index] else {
unreachable!("opcode at {acir_index} is not Brillig")
};
brillig_index < brillig.bytecode.len()
if let Some(Opcode::Brillig(ref brillig)) = opcodes[acir_index] {
brillig_index < brillig.bytecode.len()
} else {
false
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion tooling/debugger/src/repl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ impl<'a, B: BlackBoxFunctionSolver> ReplDebugger<'a, B> {

fn restart_session(&mut self) {
let breakpoints: Vec<OpcodeLocation> =
self.context.iterate_breakpoints().cloned().collect();
self.context.iterate_breakpoints().copied().collect();
self.context = DebugContext::new(
self.blackbox_solver,
self.circuit,
Expand Down

0 comments on commit 6fe9937

Please sign in to comment.