aboutsummaryrefslogtreecommitdiff
path: root/helix-core
diff options
context:
space:
mode:
authorPhilipp Mildenberger2023-07-27 02:57:19 +0000
committerGitHub2023-07-27 02:57:19 +0000
commit8a28f3059398eec7b5496bb1088b4d9870e6eb7e (patch)
tree77cf35ee489ed5367dc2a1ac8b4a0600530ded37 /helix-core
parent262a595e5343c5afd0f2570859b63ebf4c12b0fa (diff)
Reformat with nightly rustfmt for better let-else formatting (#7721)
Diffstat (limited to 'helix-core')
-rw-r--r--helix-core/src/match_brackets.rs8
-rw-r--r--helix-core/src/transaction.rs5
2 files changed, 10 insertions, 3 deletions
diff --git a/helix-core/src/match_brackets.rs b/helix-core/src/match_brackets.rs
index 7fda6d7e..f6d9885e 100644
--- a/helix-core/src/match_brackets.rs
+++ b/helix-core/src/match_brackets.rs
@@ -106,12 +106,16 @@ fn find_pair(
for close in
iter::successors(node.next_sibling(), |node| node.next_sibling()).take(MATCH_LIMIT)
{
- let Some(open) = as_close_pair(doc, &close) else { continue; };
+ let Some(open) = as_close_pair(doc, &close) else {
+ continue;
+ };
if find_pair_end(doc, Some(node), open, Backward).is_some() {
return doc.try_byte_to_char(close.start_byte()).ok();
}
}
- let Some(parent) = node.parent() else { break; };
+ let Some(parent) = node.parent() else {
+ break;
+ };
node = parent;
}
let node = tree.root_node().named_descendant_for_byte_range(pos, pos)?;
diff --git a/helix-core/src/transaction.rs b/helix-core/src/transaction.rs
index fec62578..1cea6911 100644
--- a/helix-core/src/transaction.rs
+++ b/helix-core/src/transaction.rs
@@ -389,7 +389,10 @@ impl ChangeSet {
}
let Some((i, change)) = iter.next() else {
- map!(|pos, _| (old_pos == pos).then_some(new_pos), self.changes.len());
+ map!(
+ |pos, _| (old_pos == pos).then_some(new_pos),
+ self.changes.len()
+ );
break;
};