diff --git a/tooling/debugger/src/context.rs b/tooling/debugger/src/context.rs index 7538cf4a348..fd4e93adb5a 100644 --- a/tooling/debugger/src/context.rs +++ b/tooling/debugger/src/context.rs @@ -180,10 +180,9 @@ impl<'a, B: BlackBoxFunctionSolver> 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 { - 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