Skip to content

Commit 5fbb1ed

Browse files
committedDec 27, 2024··
clippy
1 parent 047adf2 commit 5fbb1ed

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed
 

‎src/node.rs

+11-11
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ impl<T: fmt::Debug> Node<T> {
111111
#[allow(clippy::range_plus_one)]
112112
#[allow(clippy::too_many_lines)]
113113
#[inline]
114-
fn _find(
114+
fn find_with(
115115
&self,
116116
mut start: usize,
117117
mut bytes: &[u8],
@@ -156,7 +156,7 @@ impl<T: fmt::Debug> Node<T> {
156156
Key::Parameter(_) => unreachable!(),
157157
})
158158
.ok()
159-
.and_then(|i| nodes[i]._find(start, bytes, ranges))
159+
.and_then(|i| nodes[i].find_with(start, bytes, ranges))
160160
}) {
161161
return Some(id);
162162
}
@@ -175,7 +175,7 @@ impl<T: fmt::Debug> Node<T> {
175175
}
176176
_ => true,
177177
})
178-
.find_map(|node| node._find(start, bytes, ranges))
178+
.find_map(|node| node.find_with(start, bytes, ranges))
179179
}) {
180180
return Some(id);
181181
}
@@ -190,7 +190,7 @@ impl<T: fmt::Debug> Node<T> {
190190
|| pk == Kind::ZeroOrMoreSegment
191191
)
192192
})
193-
.find_map(|node| node._find(start, bytes, ranges))
193+
.find_map(|node| node.find_with(start, bytes, ranges))
194194
}) {
195195
return Some(id);
196196
}
@@ -230,7 +230,7 @@ impl<T: fmt::Debug> Node<T> {
230230
.enumerate()
231231
.filter_map(|(n, b)| (s[0] == *b).then_some(n))
232232
.find_map(|n| {
233-
node._find(start + n, &bytes[n..], ranges).inspect(
233+
node.find_with(start + n, &bytes[n..], ranges).inspect(
234234
|_| {
235235
ranges.push(start..start + n);
236236
},
@@ -256,7 +256,7 @@ impl<T: fmt::Debug> Node<T> {
256256
}
257257
_ => true,
258258
})
259-
.find_map(|node| node._find(start + 1, &bytes[1..], ranges))
259+
.find_map(|node| node.find_with(start + 1, &bytes[1..], ranges))
260260
}) {
261261
ranges.push(start..start + 1);
262262
return Some(id);
@@ -277,7 +277,7 @@ impl<T: fmt::Debug> Node<T> {
277277
}
278278
_ => true,
279279
})
280-
.find_map(|node| node._find(start, bytes, ranges))
280+
.find_map(|node| node.find_with(start, bytes, ranges))
281281
}) {
282282
// param should be empty
283283
ranges.push(start + m..start + m);
@@ -303,7 +303,7 @@ impl<T: fmt::Debug> Node<T> {
303303
Key::String(s) => s[0] == b'/',
304304
Key::Parameter(_) => unreachable!(),
305305
})
306-
.and_then(|node| node._find(start, bytes, ranges))
306+
.and_then(|node| node.find_with(start, bytes, ranges))
307307
}) {
308308
ranges.push(start..start + m);
309309
return Some(id);
@@ -345,7 +345,7 @@ impl<T: fmt::Debug> Node<T> {
345345
.enumerate()
346346
.filter_map(|(n, b)| (s[0] == *b).then_some(n))
347347
.find_map(|n| {
348-
node._find(start + n, &bytes[n..], ranges).inspect(
348+
node.find_with(start + n, &bytes[n..], ranges).inspect(
349349
|_| {
350350
ranges.push(start..start + n);
351351
},
@@ -368,7 +368,7 @@ impl<T: fmt::Debug> Node<T> {
368368
Key::String(s) => s[0] == b'/',
369369
Key::Parameter(_) => unreachable!(),
370370
})
371-
.and_then(|node| node._find(start, bytes, ranges))
371+
.and_then(|node| node.find_with(start, bytes, ranges))
372372
}) {
373373
// param should be empty
374374
ranges.push(start + m..start + m);
@@ -383,7 +383,7 @@ impl<T: fmt::Debug> Node<T> {
383383

384384
pub fn find(&self, bytes: &[u8]) -> Option<(&T, SmallVec<[Range<usize>; 8]>)> {
385385
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))
387387
}
388388
}
389389

0 commit comments

Comments
 (0)
Please sign in to comment.