diff --git a/.travis.yml b/.travis.yml index fc94d82..490f2ce 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ sudo: false language: rust rust: - - 1.8.0 + - 1.12.0 - nightly - beta - stable diff --git a/matches/lib.rs b/matches/lib.rs index e75d110..d3bfa7b 100644 --- a/matches/lib.rs +++ b/matches/lib.rs @@ -30,22 +30,13 @@ #[macro_export(local_inner_macros)] macro_rules! matches { ($expression:expr, $($pattern:tt)+) => { - _matches_tt_as_expr_hack! { - match $expression { - $($pattern)+ => true, - _ => false - } + match $expression { + $($pattern)+ => true, + _ => false } } } -/// Work around "error: unexpected token: `an interpolated tt`", whatever that means. -#[doc(hidden)] -#[macro_export(local_inner_macros)] -macro_rules! _matches_tt_as_expr_hack { - ($value:expr) => ($value) -} - /// Assert that an expression matches a refutable pattern. /// /// Syntax: `assert_matches!(` *expression* `,` *pattern* `)` @@ -67,11 +58,9 @@ macro_rules! _matches_tt_as_expr_hack { #[macro_export(local_inner_macros)] macro_rules! assert_matches { ($expression:expr, $($pattern:tt)+) => { - _matches_tt_as_expr_hack! { - match $expression { - $($pattern)+ => (), - ref e => panic!("assertion failed: `{:?}` does not match `{}`", e, stringify!($($pattern)+)), - } + match $expression { + $($pattern)+ => (), + ref e => panic!("assertion failed: `{:?}` does not match `{}`", e, stringify!($($pattern)+)), } } }