Skip to content

Commit 5e2c68f

Browse files
committed
Use less
1 parent 39ef368 commit 5e2c68f

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lib/line-index/src/lib.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
#[cfg(test)]
66
mod tests;
77

8-
use std::{iter, mem};
9-
108
use nohash_hasher::IntMap as NoHashHashMap;
119
use text_size::{TextRange, TextSize};
1210

@@ -98,7 +96,7 @@ impl LineIndex {
9896

9997
// Save any utf-16 characters seen in the previous line
10098
if !wide_chars.is_empty() {
101-
line_wide_chars.insert(line, mem::take(&mut wide_chars));
99+
line_wide_chars.insert(line, std::mem::take(&mut wide_chars));
102100
}
103101

104102
// Prepare for processing the next line
@@ -156,9 +154,9 @@ impl LineIndex {
156154
pub fn lines(&self, range: TextRange) -> impl Iterator<Item = TextRange> + '_ {
157155
let lo = self.newlines.partition_point(|&it| it < range.start());
158156
let hi = self.newlines.partition_point(|&it| it <= range.end());
159-
let all = iter::once(range.start())
157+
let all = std::iter::once(range.start())
160158
.chain(self.newlines[lo..hi].iter().copied())
161-
.chain(iter::once(range.end()));
159+
.chain(std::iter::once(range.end()));
162160

163161
all.clone()
164162
.zip(all.skip(1))

0 commit comments

Comments
 (0)