diff options
Diffstat (limited to 'crates/ide/src/syntax_highlighting/injector.rs')
-rw-r--r-- | crates/ide/src/syntax_highlighting/injector.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/crates/ide/src/syntax_highlighting/injector.rs b/crates/ide/src/syntax_highlighting/injector.rs index fd4025694..24ff473ec 100644 --- a/crates/ide/src/syntax_highlighting/injector.rs +++ b/crates/ide/src/syntax_highlighting/injector.rs | |||
@@ -5,8 +5,6 @@ use std::ops::{self, Sub}; | |||
5 | use stdx::equal_range_by; | 5 | use stdx::equal_range_by; |
6 | use syntax::{TextRange, TextSize}; | 6 | use syntax::{TextRange, TextSize}; |
7 | 7 | ||
8 | use super::highlights::ordering; | ||
9 | |||
10 | #[derive(Default)] | 8 | #[derive(Default)] |
11 | pub(super) struct Injector { | 9 | pub(super) struct Injector { |
12 | buf: String, | 10 | buf: String, |
@@ -33,7 +31,7 @@ impl Injector { | |||
33 | &self.buf | 31 | &self.buf |
34 | } | 32 | } |
35 | pub(super) fn map_range_up(&self, range: TextRange) -> impl Iterator<Item = TextRange> + '_ { | 33 | pub(super) fn map_range_up(&self, range: TextRange) -> impl Iterator<Item = TextRange> + '_ { |
36 | equal_range_by(&self.ranges, |&(r, _)| ordering(r, range)).filter_map(move |i| { | 34 | equal_range_by(&self.ranges, |&(r, _)| TextRange::ordering(r, range)).filter_map(move |i| { |
37 | let (target_range, delta) = self.ranges[i]; | 35 | let (target_range, delta) = self.ranges[i]; |
38 | let intersection = target_range.intersect(range).unwrap(); | 36 | let intersection = target_range.intersect(range).unwrap(); |
39 | Some(intersection + delta?) | 37 | Some(intersection + delta?) |