Skip to content

Commit 624424f

Browse files
committed
Fix clippy CI lints
1 parent 9865ad4 commit 624424f

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

generator/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -430,14 +430,14 @@ pub fn generate_phf(
430430
fn normalise_name(s: &str, codepoint: char) -> String {
431431
let mut normalised = String::new();
432432
let bytes = s.as_bytes();
433-
for (i, c) in bytes.into_iter().copied().enumerate() {
433+
for (i, c) in bytes.iter().copied().enumerate() {
434434
if c.is_ascii_whitespace() || c == b'_' {
435435
continue;
436436
}
437437
if codepoint != '\u{1180}' // HANGUL JUNGSEONG O-E
438438
&& c == b'-'
439-
&& bytes.get(i - 1).is_some_and(u8::is_ascii_alphanumeric)
440-
&& bytes.get(i + 1).is_some_and(u8::is_ascii_alphanumeric)
439+
&& bytes.get(i - 1).map_or(false, u8::is_ascii_alphanumeric)
440+
&& bytes.get(i + 1).map_or(false, u8::is_ascii_alphanumeric)
441441
{
442442
continue;
443443
}

generator/src/phf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ fn try_phf_table(
4747
) -> Option<(Vec<(u32, u32)>, Vec<char>)> {
4848
let hashes: Vec<_> = values
4949
.iter()
50-
.map(|(n, s)| (split(hash(&s, seed)), *n))
50+
.map(|(n, s)| (split(hash(s, seed)), *n))
5151
.collect();
5252

5353
let table_len = hashes.len();

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -457,8 +457,8 @@ fn normalise(search_name: &str, buf: &mut [u8]) -> usize {
457457
continue;
458458
}
459459
if c == b'-'
460-
&& bytes.get(i - 1).is_some_and(u8::is_ascii_alphanumeric)
461-
&& bytes.get(i + 1).is_some_and(u8::is_ascii_alphanumeric)
460+
&& bytes.get(i - 1).map_or(false, u8::is_ascii_alphanumeric)
461+
&& bytes.get(i + 1).map_or(false, u8::is_ascii_alphanumeric)
462462
{
463463
continue;
464464
}

0 commit comments

Comments
 (0)