diff options
author | Aleksey Kladov <[email protected]> | 2021-01-13 17:10:46 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2021-01-13 18:32:24 +0000 |
commit | 3d78f502bdb74a2d0b9cc8d9bb990e0a471dfb8c (patch) | |
tree | 652c20b44230439351678936db4b5c590bbd177b /crates/ide/src/syntax_highlighting/injector.rs | |
parent | f84f5cb0ea3c1b10fbe96038d0201975913425cc (diff) |
Use upstream TextSize API
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?) |