mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 14:21:44 +00:00
Use upstream TextSize API
This commit is contained in:
parent
f84f5cb0ea
commit
3d78f502bd
3 changed files with 5 additions and 17 deletions
|
@ -5,8 +5,6 @@ use std::ops::{self, Sub};
|
|||
use stdx::equal_range_by;
|
||||
use syntax::{TextRange, TextSize};
|
||||
|
||||
use super::highlights::ordering;
|
||||
|
||||
#[derive(Default)]
|
||||
pub(super) struct Injector {
|
||||
buf: String,
|
||||
|
@ -33,7 +31,7 @@ impl Injector {
|
|||
&self.buf
|
||||
}
|
||||
pub(super) fn map_range_up(&self, range: TextRange) -> impl Iterator<Item = TextRange> + '_ {
|
||||
equal_range_by(&self.ranges, |&(r, _)| ordering(r, range)).filter_map(move |i| {
|
||||
equal_range_by(&self.ranges, |&(r, _)| TextRange::ordering(r, range)).filter_map(move |i| {
|
||||
let (target_range, delta) = self.ranges[i];
|
||||
let intersection = target_range.intersect(range).unwrap();
|
||||
Some(intersection + delta?)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue