aboutsummaryrefslogtreecommitdiff
path: root/helix-core/src
diff options
context:
space:
mode:
authorGokul Soumya2022-06-11 15:39:21 +0000
committerGitHub2022-06-11 15:39:21 +0000
commit0b8a00ac967f4fd0608d83e2804bb6b1a8bf9c5d (patch)
treebbe9e09d40b843420e32a1f8942280cd66864b3b /helix-core/src
parent9b9c3e5ae263448b07b5bac1971d1c6e4bf7e674 (diff)
Refactor textobject node capture (#2741)
Diffstat (limited to 'helix-core/src')
-rw-r--r--helix-core/src/syntax.rs8
1 files changed, 1 insertions, 7 deletions
diff --git a/helix-core/src/syntax.rs b/helix-core/src/syntax.rs
index ca497b64..8d7520c3 100644
--- a/helix-core/src/syntax.rs
+++ b/helix-core/src/syntax.rs
@@ -308,13 +308,7 @@ impl TextObjectQuery {
let nodes: Vec<_> = mat
.captures
.iter()
- .filter_map(|x| {
- if x.index == capture_idx {
- Some(x.node)
- } else {
- None
- }
- })
+ .filter_map(|cap| (cap.index == capture_idx).then(|| cap.node))
.collect();
if nodes.len() > 1 {