@@ -87,23 +87,23 @@ macro_rules! match_ignore_ascii_case {
8787///
8888/// fn color_rgb(input: &str) -> Option<(u8, u8, u8)> {
8989/// cssparser::ascii_case_insensitive_phf_map! {
90- /// keywords -> (u8, u8, u8) = {
90+ /// static KEYWORDS : (u8, u8, u8) = {
9191/// "red" => (255, 0, 0),
9292/// "green" => (0, 255, 0),
9393/// "blue" => (0, 0, 255),
9494/// }
9595/// }
96- /// keywords ::get(input).cloned()
96+ /// KEYWORDS ::get(input).cloned()
9797/// }
9898/// ```
9999///
100100/// You can also iterate over the map entries by using `keywords::entries()`.
101101#[ macro_export]
102102macro_rules! ascii_case_insensitive_phf_map {
103- ( $name: ident -> $ValueType: ty = { $( $key: tt => $value: expr ) ,+ } ) => {
104- ascii_case_insensitive_phf_map!( $name -> $ValueType = { $( $key => $value, ) + } )
103+ ( static $name: ident : $ValueType: ty = { $( $key: tt => $value: expr ) ,+ } ) => {
104+ ascii_case_insensitive_phf_map!( static $name : $ValueType = { $( $key => $value, ) + } )
105105 } ;
106- ( $name: ident -> $ValueType: ty = { $( $key: tt => $value: expr, ) + } ) => {
106+ ( static $name: ident : $ValueType: ty = { $( $key: tt => $value: expr, ) + } ) => {
107107 use $crate:: _cssparser_internal_phf as phf;
108108
109109 #[ inline( always) ]
@@ -124,7 +124,7 @@ macro_rules! ascii_case_insensitive_phf_map {
124124 maxlen
125125 } ;
126126
127- static MAP : phf:: Map <& ' static str , $ValueType> = phf:: phf_map! {
127+ static __MAP : phf:: Map <& ' static str , $ValueType> = phf:: phf_map! {
128128 $(
129129 $key => $value,
130130 ) *
@@ -140,12 +140,12 @@ macro_rules! ascii_case_insensitive_phf_map {
140140 impl $name {
141141 #[ allow( dead_code) ]
142142 fn entries( ) -> impl Iterator <Item = ( & ' static & ' static str , & ' static $ValueType) > {
143- MAP . entries( )
143+ __MAP . entries( )
144144 }
145145
146146 fn get( input: & str ) -> Option <& ' static $ValueType> {
147147 $crate:: _cssparser_internal_to_lowercase!( input, MAX_LENGTH => lowercase) ;
148- MAP . get( lowercase?)
148+ __MAP . get( lowercase?)
149149 }
150150 }
151151 }
0 commit comments