File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -430,14 +430,14 @@ pub fn generate_phf(
430
430
fn normalise_name ( s : & str , codepoint : char ) -> String {
431
431
let mut normalised = String :: new ( ) ;
432
432
let bytes = s. as_bytes ( ) ;
433
- for ( i, c) in bytes. into_iter ( ) . copied ( ) . enumerate ( ) {
433
+ for ( i, c) in bytes. iter ( ) . copied ( ) . enumerate ( ) {
434
434
if c. is_ascii_whitespace ( ) || c == b'_' {
435
435
continue ;
436
436
}
437
437
if codepoint != '\u{1180}' // HANGUL JUNGSEONG O-E
438
438
&& 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)
441
441
{
442
442
continue ;
443
443
}
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ fn try_phf_table(
47
47
) -> Option < ( Vec < ( u32 , u32 ) > , Vec < char > ) > {
48
48
let hashes: Vec < _ > = values
49
49
. iter ( )
50
- . map ( |( n, s) | ( split ( hash ( & s, seed) ) , * n) )
50
+ . map ( |( n, s) | ( split ( hash ( s, seed) ) , * n) )
51
51
. collect ( ) ;
52
52
53
53
let table_len = hashes. len ( ) ;
Original file line number Diff line number Diff line change @@ -457,8 +457,8 @@ fn normalise(search_name: &str, buf: &mut [u8]) -> usize {
457
457
continue ;
458
458
}
459
459
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)
462
462
{
463
463
continue ;
464
464
}
You can’t perform that action at this time.
0 commit comments