mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-22 18:12:55 +00:00
Cleaner API
This commit is contained in:
parent
3a6ae42eac
commit
fc3fc571d2
3 changed files with 10 additions and 9 deletions
|
@ -152,13 +152,13 @@ where
|
|||
left
|
||||
}
|
||||
|
||||
pub fn equal_range_by<T, F>(slice: &[T], mut key: F) -> (usize, usize)
|
||||
pub fn equal_range_by<T, F>(slice: &[T], mut key: F) -> ops::Range<usize>
|
||||
where
|
||||
F: FnMut(&T) -> Ordering,
|
||||
{
|
||||
let start = partition_point(slice, |it| key(it) == Ordering::Less);
|
||||
let len = partition_point(&slice[start..], |it| key(it) == Ordering::Equal);
|
||||
(start, len)
|
||||
start..start + len
|
||||
}
|
||||
|
||||
pub struct JodChild(pub process::Child);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue