Skip to content

Commit 610cc22

Browse files
committed
Add support for attributes on match arms in match_ignore_ascii_case!
1 parent ff98a34 commit 610cc22

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/macros.rs

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ use std::mem::MaybeUninit;
1919
/// # fn dummy(function_name: &String) { let _ =
2020
/// match_ignore_ascii_case! { &function_name,
2121
/// "rgb" => parse_rgb(..),
22+
/// # #[cfg(not(something))]
2223
/// "rgba" => parse_rgba(..),
2324
/// "hsl" => parse_hsl(..),
2425
/// "hsla" => parse_hsla(..),
@@ -35,6 +36,7 @@ use std::mem::MaybeUninit;
3536
macro_rules! match_ignore_ascii_case {
3637
( $input:expr,
3738
$(
39+
$( #[$meta: meta] )*
3840
$( $pattern: pat )|+ $( if $guard: expr )? => $then: expr
3941
),+
4042
$(,)?
@@ -55,6 +57,7 @@ macro_rules! match_ignore_ascii_case {
5557
// since we’ve verified that none of them include ASCII upper case letters.
5658
match lowercase.unwrap_or("A") {
5759
$(
60+
$( #[$meta] )*
5861
$( $pattern )|+ $( if $guard )? => $then,
5962
)+
6063
}

0 commit comments

Comments
 (0)