11// SPDX-License-Identifier: GPL-3.0-or-later
22
3- use lazy_static:: lazy_static;
43use std:: collections:: HashSet ;
54
65#[ cfg( target_family = "unix" ) ]
@@ -27,39 +26,38 @@ pub fn looks_like_a_source_file(argument: &str) -> bool {
2726 false
2827}
2928
30- lazy_static ! {
31- static ref EXTENSIONS : HashSet <& ' static str > = {
32- HashSet :: from( [
33- // header files
34- "h" , "hh" , "H" , "hp" , "hxx" , "hpp" , "HPP" , "h++" , "tcc" ,
35- // C
36- "c" , "C" ,
37- // C++
38- "cc" , "CC" , "c++" , "C++" , "cxx" , "cpp" , "cp" ,
39- // CUDA
40- "cu" ,
41- // ObjectiveC
42- "m" , "mi" , "mm" , "M" , "mii" ,
43- // Preprocessed
44- "i" , "ii" ,
45- // Assembly
46- "s" , "S" , "sx" , "asm" ,
47- // Fortran
48- "f" , "for" , "ftn" ,
49- "F" , "FOR" , "fpp" , "FPP" , "FTN" ,
50- "f90" , "f95" , "f03" , "f08" ,
51- "F90" , "F95" , "F03" , "F08" ,
52- // go
53- "go" ,
54- // brig
55- "brig" ,
56- // D
57- "d" , "di" , "dd" ,
58- // Ada
59- "ads" , "abd"
60- ] )
61- } ;
62- }
29+ #[ rustfmt:: skip]
30+ static EXTENSIONS : std:: sync:: LazyLock < HashSet < & ' static str > > = std:: sync:: LazyLock :: new ( || {
31+ HashSet :: from ( [
32+ // header files
33+ "h" , "hh" , "H" , "hp" , "hxx" , "hpp" , "HPP" , "h++" , "tcc" ,
34+ // C
35+ "c" , "C" ,
36+ // C++
37+ "cc" , "CC" , "c++" , "C++" , "cxx" , "cpp" , "cp" ,
38+ // CUDA
39+ "cu" ,
40+ // ObjectiveC
41+ "m" , "mi" , "mm" , "M" , "mii" ,
42+ // Preprocessed
43+ "i" , "ii" ,
44+ // Assembly
45+ "s" , "S" , "sx" , "asm" ,
46+ // Fortran
47+ "f" , "for" , "ftn" ,
48+ "F" , "FOR" , "fpp" , "FPP" , "FTN" ,
49+ "f90" , "f95" , "f03" , "f08" ,
50+ "F90" , "F95" , "F03" , "F08" ,
51+ // go
52+ "go" ,
53+ // brig
54+ "brig" ,
55+ // D
56+ "d" , "di" , "dd" ,
57+ // Ada
58+ "ads" , "abd" ,
59+ ] )
60+ } ) ;
6361
6462#[ cfg( test) ]
6563mod test {
0 commit comments