@@ -139,7 +139,7 @@ macro_rules! match_ignore_ascii_case {
139
139
#[ allow( dead_code) ]
140
140
struct Dummy ;
141
141
142
- _cssparser_internal__max_len !( $value => lowercase, $( $string) ,+) ;
142
+ _cssparser_internal__to_lowercase !( $value => lowercase, $( $string) ,+) ;
143
143
match lowercase {
144
144
$(
145
145
Some ( $string) => $result,
@@ -203,7 +203,7 @@ macro_rules! ascii_case_insensitive_phf_map {
203
203
impl $Name {
204
204
#[ inline]
205
205
fn get( input: & str ) -> Option <& ' static $ValueType> {
206
- _cssparser_internal__max_len !( input => lowercase, $( $key) ,+) ;
206
+ _cssparser_internal__to_lowercase !( input => lowercase, $( $key) ,+) ;
207
207
lowercase. and_then( |string| $Name:: map( ) . get( string) )
208
208
}
209
209
}
@@ -212,13 +212,14 @@ macro_rules! ascii_case_insensitive_phf_map {
212
212
213
213
/// Implementation detail of match_ignore_ascii_case! and ascii_case_insensitive_phf_map! macros.
214
214
///
215
+ /// **This macro is not part of the public API. It can change or be removed between any versions.**
216
+ ///
215
217
/// * Check at compile-time that none of the `$string`s contain ASCII uppercase letters
216
- /// * Define a local variable named `$output`
217
- /// to the result of calling `_match_ignore_ascii_case__to_lowercase`
218
+ /// * Define a local variable named `$output` to the result of calling `_internal__to_lowercase`
218
219
/// with a stack-allocated buffer as long as the longest `$string`.
219
220
#[ macro_export]
220
221
#[ doc( hidden) ]
221
- macro_rules! _cssparser_internal__max_len {
222
+ macro_rules! _cssparser_internal__to_lowercase {
222
223
( $input: expr => $output: ident, $( $string: expr) ,+) => {
223
224
#[ derive( cssparser__max_len) ]
224
225
#[ cssparser__max_len__data( $( string = $string) ,+) ]
@@ -227,24 +228,26 @@ macro_rules! _cssparser_internal__max_len {
227
228
228
229
// MAX_LENGTH is generated by cssparser__match_ignore_ascii_case__max_len
229
230
let mut buffer: [ u8 ; MAX_LENGTH ] =
230
- // `buffer` is only used in `_match_ignore_ascii_case__to_lowercase `,
231
+ // `buffer` is only used in `_internal__to_lowercase `,
231
232
// which initializes with `copy_from_slice` the part of the buffer it uses,
232
233
// before it uses it.
233
234
unsafe {
234
235
:: std:: mem:: uninitialized( )
235
236
} ;
236
- let $output = $crate:: _match_ignore_ascii_case__to_lowercase ( & mut buffer, $input) ;
237
+ let $output = $crate:: _internal__to_lowercase ( & mut buffer, $input) ;
237
238
}
238
239
}
239
240
240
241
241
242
/// Implementation detail of match_ignore_ascii_case! and ascii_case_insensitive_phf_map! macros.
242
243
///
244
+ /// **This function is not part of the public API. It can change or be removed between any verisons.**
245
+ ///
243
246
/// Return `input`, lower-cased, unless larger than `buffer`
244
247
/// which is used temporary space for lower-casing a copy of `input` if necessary.
245
248
#[ doc( hidden) ]
246
249
#[ allow( non_snake_case) ]
247
- pub fn _match_ignore_ascii_case__to_lowercase < ' a > ( buffer : & ' a mut [ u8 ] , input : & ' a str ) -> Option < & ' a str > {
250
+ pub fn _internal__to_lowercase < ' a > ( buffer : & ' a mut [ u8 ] , input : & ' a str ) -> Option < & ' a str > {
248
251
if let Some ( buffer) = buffer. get_mut ( ..input. len ( ) ) {
249
252
if let Some ( first_uppercase) = input. bytes ( ) . position ( |byte| matches ! ( byte, b'A' ...b'Z' ) ) {
250
253
buffer. copy_from_slice ( input. as_bytes ( ) ) ;
0 commit comments