Simplify a branch in check_config macro.

This commit is contained in:
Sergio Benitez 2016-10-04 13:49:07 -07:00
parent 05bed92272
commit 63d31e8082
1 changed files with 1 additions and 4 deletions

View File

@ -193,10 +193,7 @@ mod test {
macro_rules! check_config { macro_rules! check_config {
($rconfig:expr => { $($param:tt)+ }) => ( ($rconfig:expr => { $($param:tt)+ }) => (
match $rconfig { check_config!($rconfig, Config { $($param)+ })
Ok(config) => assert_eq!(config.active(), &Config { $($param)+ }),
Err(e) => panic!("Config {} failed: {:?}", stringify!($rconfig), e)
}
); );
($rconfig:expr, $econfig:expr) => ( ($rconfig:expr, $econfig:expr) => (