aboutsummaryrefslogtreecommitdiff
path: root/helix-core
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-core
parentde5e5863aa0b48a9853ea1e692cd13faea680bda (diff)
Simplify some cases that use return None to use ?
Diffstat (limited to 'helix-core')
-rw-r--r--helix-core/src/indent.rs5
1 files changed, 1 insertions, 4 deletions
diff --git a/helix-core/src/indent.rs b/helix-core/src/indent.rs
index 88ab09b5..8ccc0120 100644
--- a/helix-core/src/indent.rs
+++ b/helix-core/src/indent.rs
@@ -194,10 +194,7 @@ fn get_highest_syntax_node_at_bytepos(syntax: &Syntax, pos: usize) -> Option<Nod
let tree = syntax.tree();
// named_descendant
- let mut node = match tree.root_node().descendant_for_byte_range(pos, pos) {
- Some(node) => node,
- None => return None,
- };
+ let mut node = tree.root_node().descendant_for_byte_range(pos, pos)?;
while let Some(parent) = node.parent() {
if parent.start_byte() == node.start_byte() {