summaryrefslogtreecommitdiff
path: root/helix-term/src
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-12-02 01:31:19 +0000
committerBlaž Hrastnik2021-12-02 01:31:19 +0000
commitd14ca05d6b877826337db02888514269e1071f8c (patch)
treeb1e1f4d8086784a8f4c45ffc150926b5a806f03f /helix-term/src
parentde5e5863aa0b48a9853ea1e692cd13faea680bda (diff)
Simplify some cases that use return None to use ?
Diffstat (limited to 'helix-term/src')
-rw-r--r--helix-term/src/commands/dap.rs5
1 files changed, 1 insertions, 4 deletions
diff --git a/helix-term/src/commands/dap.rs b/helix-term/src/commands/dap.rs
index 8184475c..b44be16c 100644
--- a/helix-term/src/commands/dap.rs
+++ b/helix-term/src/commands/dap.rs
@@ -165,10 +165,7 @@ fn get_breakpoint_at_current_line(editor: &mut Editor) -> Option<(usize, Breakpo
let text = doc.text().slice(..);
let line = doc.selection(view.id).primary().cursor_line(text);
- let path = match doc.path() {
- Some(path) => path,
- None => return None,
- };
+ let path = doc.path()?;
editor.breakpoints.get(path).and_then(|breakpoints| {
let i = breakpoints.iter().position(|b| b.line == line);
i.map(|i| (i, breakpoints[i].clone()))