@@ -111,7 +111,7 @@ impl<T: fmt::Debug> Node<T> {
111
111
#[ allow( clippy:: range_plus_one) ]
112
112
#[ allow( clippy:: too_many_lines) ]
113
113
#[ inline]
114
- fn _find (
114
+ fn find_with (
115
115
& self ,
116
116
mut start : usize ,
117
117
mut bytes : & [ u8 ] ,
@@ -156,7 +156,7 @@ impl<T: fmt::Debug> Node<T> {
156
156
Key :: Parameter ( _) => unreachable ! ( ) ,
157
157
} )
158
158
. ok ( )
159
- . and_then ( |i| nodes[ i] . _find ( start, bytes, ranges) )
159
+ . and_then ( |i| nodes[ i] . find_with ( start, bytes, ranges) )
160
160
} ) {
161
161
return Some ( id) ;
162
162
}
@@ -175,7 +175,7 @@ impl<T: fmt::Debug> Node<T> {
175
175
}
176
176
_ => true ,
177
177
} )
178
- . find_map ( |node| node. _find ( start, bytes, ranges) )
178
+ . find_map ( |node| node. find_with ( start, bytes, ranges) )
179
179
} ) {
180
180
return Some ( id) ;
181
181
}
@@ -190,7 +190,7 @@ impl<T: fmt::Debug> Node<T> {
190
190
|| pk == Kind :: ZeroOrMoreSegment
191
191
)
192
192
} )
193
- . find_map ( |node| node. _find ( start, bytes, ranges) )
193
+ . find_map ( |node| node. find_with ( start, bytes, ranges) )
194
194
} ) {
195
195
return Some ( id) ;
196
196
}
@@ -230,7 +230,7 @@ impl<T: fmt::Debug> Node<T> {
230
230
. enumerate ( )
231
231
. filter_map ( |( n, b) | ( s[ 0 ] == * b) . then_some ( n) )
232
232
. find_map ( |n| {
233
- node. _find ( start + n, & bytes[ n..] , ranges) . inspect (
233
+ node. find_with ( start + n, & bytes[ n..] , ranges) . inspect (
234
234
|_| {
235
235
ranges. push ( start..start + n) ;
236
236
} ,
@@ -256,7 +256,7 @@ impl<T: fmt::Debug> Node<T> {
256
256
}
257
257
_ => true ,
258
258
} )
259
- . find_map ( |node| node. _find ( start + 1 , & bytes[ 1 ..] , ranges) )
259
+ . find_map ( |node| node. find_with ( start + 1 , & bytes[ 1 ..] , ranges) )
260
260
} ) {
261
261
ranges. push ( start..start + 1 ) ;
262
262
return Some ( id) ;
@@ -277,7 +277,7 @@ impl<T: fmt::Debug> Node<T> {
277
277
}
278
278
_ => true ,
279
279
} )
280
- . find_map ( |node| node. _find ( start, bytes, ranges) )
280
+ . find_map ( |node| node. find_with ( start, bytes, ranges) )
281
281
} ) {
282
282
// param should be empty
283
283
ranges. push ( start + m..start + m) ;
@@ -303,7 +303,7 @@ impl<T: fmt::Debug> Node<T> {
303
303
Key :: String ( s) => s[ 0 ] == b'/' ,
304
304
Key :: Parameter ( _) => unreachable ! ( ) ,
305
305
} )
306
- . and_then ( |node| node. _find ( start, bytes, ranges) )
306
+ . and_then ( |node| node. find_with ( start, bytes, ranges) )
307
307
} ) {
308
308
ranges. push ( start..start + m) ;
309
309
return Some ( id) ;
@@ -345,7 +345,7 @@ impl<T: fmt::Debug> Node<T> {
345
345
. enumerate ( )
346
346
. filter_map ( |( n, b) | ( s[ 0 ] == * b) . then_some ( n) )
347
347
. find_map ( |n| {
348
- node. _find ( start + n, & bytes[ n..] , ranges) . inspect (
348
+ node. find_with ( start + n, & bytes[ n..] , ranges) . inspect (
349
349
|_| {
350
350
ranges. push ( start..start + n) ;
351
351
} ,
@@ -368,7 +368,7 @@ impl<T: fmt::Debug> Node<T> {
368
368
Key :: String ( s) => s[ 0 ] == b'/' ,
369
369
Key :: Parameter ( _) => unreachable ! ( ) ,
370
370
} )
371
- . and_then ( |node| node. _find ( start, bytes, ranges) )
371
+ . and_then ( |node| node. find_with ( start, bytes, ranges) )
372
372
} ) {
373
373
// param should be empty
374
374
ranges. push ( start + m..start + m) ;
@@ -383,7 +383,7 @@ impl<T: fmt::Debug> Node<T> {
383
383
384
384
pub fn find ( & self , bytes : & [ u8 ] ) -> Option < ( & T , SmallVec < [ Range < usize > ; 8 ] > ) > {
385
385
let mut ranges = SmallVec :: < [ Range < usize > ; 8 ] > :: new_const ( ) ; // opt!
386
- self . _find ( 0 , bytes, & mut ranges) . map ( |t| ( t, ranges) )
386
+ self . find_with ( 0 , bytes, & mut ranges) . map ( |t| ( t, ranges) )
387
387
}
388
388
}
389
389
0 commit comments