aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/syntax_highlighting/injector.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2021-01-10 11:36:15 +0000
committerAleksey Kladov <[email protected]>2021-01-10 11:36:15 +0000
commitfc3fc571d29ccec4a4f80da35d5f77e94c6663c3 (patch)
treea7d61c74a2ea0f77bf6de84b11fc3fca72d4fb82 /crates/ide/src/syntax_highlighting/injector.rs
parent3a6ae42eacabeef0332273db216bc287d4fff613 (diff)
Cleaner API
Diffstat (limited to 'crates/ide/src/syntax_highlighting/injector.rs')
-rw-r--r--crates/ide/src/syntax_highlighting/injector.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/crates/ide/src/syntax_highlighting/injector.rs b/crates/ide/src/syntax_highlighting/injector.rs
index e8f17eb69..fd4025694 100644
--- a/crates/ide/src/syntax_highlighting/injector.rs
+++ b/crates/ide/src/syntax_highlighting/injector.rs
@@ -33,8 +33,7 @@ impl Injector {
33 &self.buf 33 &self.buf
34 } 34 }
35 pub(super) fn map_range_up(&self, range: TextRange) -> impl Iterator<Item = TextRange> + '_ { 35 pub(super) fn map_range_up(&self, range: TextRange) -> impl Iterator<Item = TextRange> + '_ {
36 let (start, len) = equal_range_by(&self.ranges, |&(r, _)| ordering(r, range)); 36 equal_range_by(&self.ranges, |&(r, _)| ordering(r, range)).filter_map(move |i| {
37 (start..start + len).filter_map(move |i| {
38 let (target_range, delta) = self.ranges[i]; 37 let (target_range, delta) = self.ranges[i];
39 let intersection = target_range.intersect(range).unwrap(); 38 let intersection = target_range.intersect(range).unwrap();
40 Some(intersection + delta?) 39 Some(intersection + delta?)