From 6a16ec52aa0d91945577c99cdf421b303b59301e Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 4 May 2021 14:10:49 +0300 Subject: internal: use API stabilized in 1.52 --- crates/ide_db/src/line_index.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'crates/ide_db/src') diff --git a/crates/ide_db/src/line_index.rs b/crates/ide_db/src/line_index.rs index 8e9d8cca2..816edfe6a 100644 --- a/crates/ide_db/src/line_index.rs +++ b/crates/ide_db/src/line_index.rs @@ -3,7 +3,6 @@ use std::iter; use rustc_hash::FxHashMap; -use stdx::partition_point; use syntax::{TextRange, TextSize}; #[derive(Clone, Debug, PartialEq, Eq)] @@ -97,7 +96,7 @@ impl LineIndex { } pub fn line_col(&self, offset: TextSize) -> LineCol { - let line = partition_point(&self.newlines, |&it| it <= offset) - 1; + let line = self.newlines.partition_point(|&it| it <= offset) - 1; let line_start_offset = self.newlines[line]; let col = offset - line_start_offset; LineCol { line: line as u32, col: col.into() } @@ -118,8 +117,8 @@ impl LineIndex { } pub fn lines(&self, range: TextRange) -> impl Iterator + '_ { - let lo = partition_point(&self.newlines, |&it| it < range.start()); - let hi = partition_point(&self.newlines, |&it| it <= range.end()); + let lo = self.newlines.partition_point(|&it| it < range.start()); + let hi = self.newlines.partition_point(|&it| it <= range.end()); let all = iter::once(range.start()) .chain(self.newlines[lo..hi].iter().copied()) .chain(iter::once(range.end())); -- cgit v1.2.3