Skip to content

Commit 8b840c3

Browse files
committed
Resolve semicolon_in_expressions_from_macros warning in serde_test
warning: trailing semicolon in macro used in expression position --> serde_test/src/ser.rs:44:10 | 44 | ); | ^ ... 152 | Some(&Token::BorrowedStr(_)) => assert_next_token!(self, BorrowedStr(v)), | ---------------------------------------- in this macro invocation | = note: `#[warn(semicolon_in_expressions_from_macros)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: this warning originates in the macro `assert_next_token` (in Nightly builds, run with -Z macro-backtrace for more info) warning: trailing semicolon in macro used in expression position --> serde_test/src/ser.rs:36:76 | 36 | assert_next_token!($ser, stringify!($actual), Token::$actual, true); | ^ ... 386 | Token::TupleVariantEnd => assert_next_token!(self.ser, TupleVariantEnd), | --------------------------------------------- in this macro invocation | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: this warning originates in the macro `assert_next_token` (in Nightly builds, run with -Z macro-backtrace for more info)
1 parent 9c39115 commit 8b840c3

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

serde_test/src/ser.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,18 @@ impl<'a> Serializer<'a> {
3232
}
3333

3434
macro_rules! assert_next_token {
35-
($ser:expr, $actual:ident) => {
35+
($ser:expr, $actual:ident) => {{
3636
assert_next_token!($ser, stringify!($actual), Token::$actual, true);
37-
};
38-
($ser:expr, $actual:ident($v:expr)) => {
37+
}};
38+
($ser:expr, $actual:ident($v:expr)) => {{
3939
assert_next_token!(
4040
$ser,
4141
format_args!(concat!(stringify!($actual), "({:?})"), $v),
4242
Token::$actual(v),
4343
v == $v
4444
);
45-
};
46-
($ser:expr, $actual:ident { $($k:ident),* }) => {
45+
}};
46+
($ser:expr, $actual:ident { $($k:ident),* }) => {{
4747
let compare = ($($k,)*);
4848
let field_format = || {
4949
use std::fmt::Write;
@@ -59,7 +59,7 @@ macro_rules! assert_next_token {
5959
Token::$actual { $($k),* },
6060
($($k,)*) == compare
6161
);
62-
};
62+
}};
6363
($ser:expr, $actual:expr, $pat:pat, $guard:expr) => {
6464
match $ser.next_token() {
6565
Some($pat) if $guard => {}

0 commit comments

Comments
 (0)