Skip to content

Commit

Permalink
Prohibit multiple predicates (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
hyd-dev authored Oct 6, 2020
1 parent f71bf60 commit 7daa598
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,30 +34,30 @@
macro_rules! cfg_if {
// match if/else chains with a final `else`
($(
if #[cfg($($meta:meta),*)] { $($tokens:tt)* }
if #[cfg($meta:meta)] { $($tokens:tt)* }
) else * else {
$($tokens2:tt)*
}) => {
$crate::cfg_if! {
@__items
() ;
$( ( ($($meta),*) ($($tokens)*) ), )*
$( ( ($meta) ($($tokens)*) ), )*
( () ($($tokens2)*) ),
}
};

// match if/else chains lacking a final `else`
(
if #[cfg($($i_met:meta),*)] { $($i_tokens:tt)* }
if #[cfg($i_met:meta)] { $($i_tokens:tt)* }
$(
else if #[cfg($($e_met:meta),*)] { $($e_tokens:tt)* }
else if #[cfg($e_met:meta)] { $($e_tokens:tt)* }
)*
) => {
$crate::cfg_if! {
@__items
() ;
( ($($i_met),*) ($($i_tokens)*) ),
$( ( ($($e_met),*) ($($e_tokens)*) ), )*
( ($i_met) ($($i_tokens)*) ),
$( ( ($e_met) ($($e_tokens)*) ), )*
( () () ),
}
};
Expand Down

0 comments on commit 7daa598

Please sign in to comment.