Skip to content

Commit a7bcb83

Browse files
steinbroEh2406
authored andcommitted
Remove ordslice dependency
Fixes #14
1 parent 633dd1c commit a7bcb83

File tree

3 files changed

+3
-21
lines changed

3 files changed

+3
-21
lines changed

Cargo.lock

Lines changed: 0 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ preferences = { git = "https://github.com/Eh2406/preferences-rs", branch = "patc
2727
unicode-segmentation = "1.10.1"
2828
regex = "1.8.1"
2929
itertools = "0.10.5"
30-
ordslice = "0.3.0"
3130
average = { version = "0.9.2", features = ["serde1"]}
3231
chrono = { version = "0.4", features = ["serde"] }
3332
error-code = "2.3.1"

src/wide_string.rs

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -109,19 +109,9 @@ pub fn convert_range<T>(v: &[T], r: &Range<T>) -> Range<usize>
109109
where
110110
T: Ord,
111111
{
112-
use ordslice::Ext;
113-
use std::cmp::Ordering;
114-
let mut out = v.equal_range_by(|probe| {
115-
if *probe < r.start {
116-
Ordering::Less
117-
} else if *probe > r.end {
118-
Ordering::Greater
119-
} else {
120-
Ordering::Equal
121-
}
122-
});
123-
out.end -= 1;
124-
out
112+
let lo = v.partition_point(|x| *x < r.start);
113+
let hi = v.partition_point(|x| *x <= r.end);
114+
lo..(hi - 1)
125115
}
126116

127117
#[allow(dead_code)]

0 commit comments

Comments
 (0)