aboutsummaryrefslogtreecommitdiff
path: root/crates/stdx/src
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2021-01-10 11:36:15 +0000
committerAleksey Kladov <[email protected]>2021-01-10 11:36:15 +0000
commitfc3fc571d29ccec4a4f80da35d5f77e94c6663c3 (patch)
treea7d61c74a2ea0f77bf6de84b11fc3fca72d4fb82 /crates/stdx/src
parent3a6ae42eacabeef0332273db216bc287d4fff613 (diff)
Cleaner API
Diffstat (limited to 'crates/stdx/src')
-rw-r--r--crates/stdx/src/lib.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/stdx/src/lib.rs b/crates/stdx/src/lib.rs
index 5aacdb16e..13aab1451 100644
--- a/crates/stdx/src/lib.rs
+++ b/crates/stdx/src/lib.rs
@@ -152,13 +152,13 @@ where
152 left 152 left
153} 153}
154 154
155pub fn equal_range_by<T, F>(slice: &[T], mut key: F) -> (usize, usize) 155pub fn equal_range_by<T, F>(slice: &[T], mut key: F) -> ops::Range<usize>
156where 156where
157 F: FnMut(&T) -> Ordering, 157 F: FnMut(&T) -> Ordering,
158{ 158{
159 let start = partition_point(slice, |it| key(it) == Ordering::Less); 159 let start = partition_point(slice, |it| key(it) == Ordering::Less);
160 let len = partition_point(&slice[start..], |it| key(it) == Ordering::Equal); 160 let len = partition_point(&slice[start..], |it| key(it) == Ordering::Equal);
161 (start, len) 161 start..start + len
162} 162}
163 163
164pub struct JodChild(pub process::Child); 164pub struct JodChild(pub process::Child);