Skip to content

Commit

Permalink
Replace Option match with .map().flatten()
Browse files Browse the repository at this point in the history
  • Loading branch information
anaPerezGhiglia committed Jun 5, 2024
1 parent 2289c3d commit b6ff40c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tooling/debugger/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,9 @@ impl<'a, B: BlackBoxFunctionSolver<FieldElement>> DebugContext<'a, B> {

/// Returns the `FileId` of the file associated with the innermost function on the call stack.
pub(super) fn get_current_file(&mut self) -> Option<FileId> {
match self.get_current_source_location() {
Some(locations) => locations.last().map(|location| location.file),
None => None,
}
self.get_current_source_location()
.map(|locations| locations.last().map(|location| location.file))
.flatten()
}

/// Returns the (possible) stack of source locations corresponding to the
Expand Down

0 comments on commit b6ff40c

Please sign in to comment.