@@ -102,23 +102,23 @@ fn update_index(table: &mut Indices, offset: usize, hash: HashValue, old: usize,
102
102
* index = OffsetIndex :: new ( new, offset) ;
103
103
}
104
104
105
+ /// A simple alias to help `clippy::type_complexity`
106
+ type Pair < T > = ( T , T ) ;
107
+
105
108
#[ inline]
106
- fn len_slices < T > ( ( head, tail) : ( & [ T ] , & [ T ] ) ) -> usize {
109
+ fn len_slices < T > ( ( head, tail) : Pair < & [ T ] > ) -> usize {
107
110
head. len ( ) + tail. len ( )
108
111
}
109
112
110
113
#[ inline]
111
- fn iter_slices < ' a , T > (
112
- ( head, tail) : ( & ' a [ T ] , & ' a [ T ] ) ,
113
- ) -> iter:: Chain < slice:: Iter < ' a , T > , slice:: Iter < ' a , T > > {
114
+ fn iter_slices < T > (
115
+ ( head, tail) : Pair < & ' _ [ T ] > ,
116
+ ) -> iter:: Chain < slice:: Iter < ' _ , T > , slice:: Iter < ' _ , T > > {
114
117
head. iter ( ) . chain ( tail)
115
118
}
116
119
117
120
#[ inline]
118
- fn split_slices < ' a , T > (
119
- ( head, tail) : ( & ' a [ T ] , & ' a [ T ] ) ,
120
- i : usize ,
121
- ) -> ( ( & ' a [ T ] , & ' a [ T ] ) , ( & ' a [ T ] , & ' a [ T ] ) ) {
121
+ fn split_slices < T > ( ( head, tail) : Pair < & ' _ [ T ] > , i : usize ) -> Pair < Pair < & ' _ [ T ] > > {
122
122
if i <= head. len ( ) {
123
123
let ( head, mid) = head. split_at ( i) ;
124
124
( ( head, & [ ] ) , ( mid, tail) )
@@ -129,10 +129,7 @@ fn split_slices<'a, T>(
129
129
}
130
130
131
131
#[ inline]
132
- fn split_slices_mut < ' a , T > (
133
- ( head, tail) : ( & ' a mut [ T ] , & ' a mut [ T ] ) ,
134
- i : usize ,
135
- ) -> ( ( & ' a mut [ T ] , & ' a mut [ T ] ) , ( & ' a mut [ T ] , & ' a mut [ T ] ) ) {
132
+ fn split_slices_mut < T > ( ( head, tail) : Pair < & ' _ mut [ T ] > , i : usize ) -> Pair < Pair < & ' _ mut [ T ] > > {
136
133
if i <= head. len ( ) {
137
134
let ( head, mid) = head. split_at_mut ( i) ;
138
135
( ( head, & mut [ ] ) , ( mid, tail) )
@@ -143,11 +140,7 @@ fn split_slices_mut<'a, T>(
143
140
}
144
141
145
142
#[ inline]
146
- fn sub_slices_mut < ' a , T > (
147
- slices : ( & ' a mut [ T ] , & ' a mut [ T ] ) ,
148
- start : usize ,
149
- end : usize ,
150
- ) -> ( & ' a mut [ T ] , & ' a mut [ T ] ) {
143
+ fn sub_slices_mut < T > ( slices : Pair < & ' _ mut [ T ] > , start : usize , end : usize ) -> Pair < & ' _ mut [ T ] > {
151
144
let ( slices, _) = split_slices_mut ( slices, end) ;
152
145
split_slices_mut ( slices, start) . 1
153
146
}
@@ -156,11 +149,7 @@ fn sub_slices_mut<'a, T>(
156
149
/// and without regard for duplication.
157
150
///
158
151
/// ***Panics*** if there is not sufficient capacity already.
159
- fn insert_bulk_no_grow < K , V > (
160
- indices : & mut Indices ,
161
- offset : usize ,
162
- entries : ( & [ Bucket < K , V > ] , & [ Bucket < K , V > ] ) ,
163
- ) {
152
+ fn insert_bulk_no_grow < K , V > ( indices : & mut Indices , offset : usize , entries : Pair < & [ Bucket < K , V > ] > ) {
164
153
assert ! ( indices. capacity( ) - indices. len( ) >= len_slices( entries) ) ;
165
154
for entry in iter_slices ( entries) {
166
155
let index = OffsetIndex :: new ( indices. len ( ) , offset) ;
0 commit comments