diff options
author | Aleksey Kladov <[email protected]> | 2021-01-10 11:36:15 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2021-01-10 11:36:15 +0000 |
commit | fc3fc571d29ccec4a4f80da35d5f77e94c6663c3 (patch) | |
tree | a7d61c74a2ea0f77bf6de84b11fc3fca72d4fb82 /crates/stdx | |
parent | 3a6ae42eacabeef0332273db216bc287d4fff613 (diff) |
Cleaner API
Diffstat (limited to 'crates/stdx')
-rw-r--r-- | crates/stdx/src/lib.rs | 4 |
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 | ||
155 | pub fn equal_range_by<T, F>(slice: &[T], mut key: F) -> (usize, usize) | 155 | pub fn equal_range_by<T, F>(slice: &[T], mut key: F) -> ops::Range<usize> |
156 | where | 156 | where |
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 | ||
164 | pub struct JodChild(pub process::Child); | 164 | pub struct JodChild(pub process::Child); |