@@ -48,11 +48,11 @@ macro_rules! match_ignore_ascii_case {
48
48
// rather than expression/statement context,
49
49
// even though the macro only expands to items.
50
50
mod cssparser_internal {
51
- $crate:: cssparser_internal__match_ignore_ascii_case__support ! {
51
+ $crate:: _cssparser_internal_max_len ! {
52
52
$( $( $pattern ) + ) +
53
53
}
54
54
}
55
- cssparser_internal__to_lowercase !( $input, cssparser_internal:: MAX_LENGTH => lowercase) ;
55
+ _cssparser_internal_to_lowercase !( $input, cssparser_internal:: MAX_LENGTH => lowercase) ;
56
56
// "A" is a short string that we know is different for every string pattern,
57
57
// since we’ve verified that none of them include ASCII upper case letters.
58
58
match lowercase. unwrap_or( "A" ) {
@@ -98,15 +98,19 @@ macro_rules! ascii_case_insensitive_phf_map {
98
98
pub fn $name( input: & str ) -> Option <& ' static $ValueType> {
99
99
// This dummy module works around a feature gate,
100
100
// see comment on the similar module in `match_ignore_ascii_case!` above.
101
- mod cssparser_internal {
102
- use $crate:: _internal__phf:: { Map , phf_map} ;
103
- #[ allow( unused) ] use super :: * ;
104
- $crate:: cssparser_internal__ascii_case_insensitive_phf_map__support! {
105
- $ValueType $( $key $value ) +
101
+ mod _cssparser_internal {
102
+ $crate:: _cssparser_internal_max_len! {
103
+ $( $key ) +
106
104
}
107
105
}
108
- cssparser_internal__to_lowercase!( input, cssparser_internal:: MAX_LENGTH => lowercase) ;
109
- lowercase. and_then( |s| cssparser_internal:: MAP . get( s) )
106
+ use $crate:: _cssparser_internal_phf as phf;
107
+ static MAP : phf:: Map <& ' static str , $ValueType> = phf:: phf_map! {
108
+ $(
109
+ $key => $value,
110
+ ) *
111
+ } ;
112
+ _cssparser_internal_to_lowercase!( input, _cssparser_internal:: MAX_LENGTH => lowercase) ;
113
+ lowercase. and_then( |s| MAP . get( s) )
110
114
}
111
115
}
112
116
}
@@ -116,19 +120,19 @@ macro_rules! ascii_case_insensitive_phf_map {
116
120
/// **This macro is not part of the public API. It can change or be removed between any versions.**
117
121
///
118
122
/// Define a local variable named `$output`
119
- /// and assign it the result of calling `_internal__to_lowercase `
123
+ /// and assign it the result of calling `_cssparser_internal_to_lowercase `
120
124
/// with a stack-allocated buffer of length `$BUFFER_SIZE`.
121
125
#[ macro_export]
122
126
#[ doc( hidden) ]
123
- macro_rules! cssparser_internal__to_lowercase {
127
+ macro_rules! _cssparser_internal_to_lowercase {
124
128
( $input: expr, $BUFFER_SIZE: expr => $output: ident) => {
125
129
#[ allow( unsafe_code) ]
126
130
let mut buffer = unsafe {
127
131
:: std:: mem:: MaybeUninit :: <[ :: std:: mem:: MaybeUninit <u8 >; $BUFFER_SIZE] >:: uninit( )
128
132
. assume_init( )
129
133
} ;
130
134
let input: & str = $input;
131
- let $output = $crate:: _internal__to_lowercase ( & mut buffer, input) ;
135
+ let $output = $crate:: _cssparser_internal_to_lowercase ( & mut buffer, input) ;
132
136
} ;
133
137
}
134
138
@@ -140,7 +144,7 @@ macro_rules! cssparser_internal__to_lowercase {
140
144
/// Otherwise, return `input` ASCII-lowercased, using `buffer` as temporary space if necessary.
141
145
#[ doc( hidden) ]
142
146
#[ allow( non_snake_case) ]
143
- pub fn _internal__to_lowercase < ' a > (
147
+ pub fn _cssparser_internal_to_lowercase < ' a > (
144
148
buffer : & ' a mut [ MaybeUninit < u8 > ] ,
145
149
input : & ' a str ,
146
150
) -> Option < & ' a str > {
0 commit comments