@@ -301,16 +301,12 @@ fn collect_constants(lang: Language, content: &str) -> HashMap<String, String> {
301301 r"(?m)^\s*(?:public|private|protected)?\s*(?:static\s+)?final\s+(?:int|long|String)\s+([A-Za-z_][A-Za-z0-9_]*)\s*=\s*([^;]+);" ,
302302 ] ,
303303 Language :: Go => & [ r"(?m)^\s*const\s+([A-Za-z_][A-Za-z0-9_]*)\s*=\s*([^\n]+)$" ] ,
304- Language :: Python => & [
305- r"(?m)^\s*([A-Z_][A-Z0-9_]*)\s*=\s*([^#\n]+)" ,
306- ] ,
304+ Language :: Python => & [ r"(?m)^\s*([A-Z_][A-Z0-9_]*)\s*=\s*([^#\n]+)" ] ,
307305 Language :: Php => & [
308306 r"(?m)^\s*const\s+([A-Z_][A-Z0-9_]*)\s*=\s*([^;]+);" ,
309307 r#"define\(\s*['"]([A-Z_][A-Z0-9_]*)['"]\s*,\s*([^)]+)\)"# ,
310308 ] ,
311- Language :: Rust => & [
312- r"(?m)^\s*const\s+([A-Za-z_][A-Za-z0-9_]*)\s*:[^=]+=\s*([^;]+);" ,
313- ] ,
309+ Language :: Rust => & [ r"(?m)^\s*const\s+([A-Za-z_][A-Za-z0-9_]*)\s*:[^=]+=\s*([^;]+);" ] ,
314310 _ => & [ ] ,
315311 } ;
316312
@@ -492,7 +488,7 @@ fn dedupe_more_specific<'a>(hits: Vec<AlgorithmHit<'a>>) -> Vec<AlgorithmHit<'a>
492488 if p_i != p_j {
493489 continue ;
494490 }
495- if is_more_specific ( & hits[ j] . algorithm_name , & hits[ i] . algorithm_name ) {
491+ if is_more_specific ( hits[ j] . algorithm_name , hits[ i] . algorithm_name ) {
496492 drop[ i] = true ;
497493 break ;
498494 }
@@ -506,9 +502,7 @@ fn dedupe_more_specific<'a>(hits: Vec<AlgorithmHit<'a>>) -> Vec<AlgorithmHit<'a>
506502}
507503
508504fn primitive_of < ' a > ( hit : & ' a AlgorithmHit < ' a > ) -> Option < & ' a str > {
509- hit. metadata
510- . get ( "primitive" )
511- . and_then ( |v| v. as_str ( ) )
505+ hit. metadata . get ( "primitive" ) . and_then ( |v| v. as_str ( ) )
512506}
513507
514508fn is_more_specific ( specific : & str , generic : & str ) -> bool {
@@ -534,5 +528,7 @@ fn is_more_specific(specific: &str, generic: &str) -> bool {
534528
535529 tokens_specific_no_num == tokens_generic_no_num
536530 && tokens_specific. len ( ) > tokens_generic. len ( )
537- && tokens_specific. iter ( ) . any ( |t| t. chars ( ) . all ( |c| c. is_ascii_digit ( ) ) )
531+ && tokens_specific
532+ . iter ( )
533+ . any ( |t| t. chars ( ) . all ( |c| c. is_ascii_digit ( ) ) )
538534}
0 commit comments