mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-06-14 11:41:01 +00:00
Fix clippy lint about literal in format string
This commit is contained in:
@@ -45,7 +45,7 @@ macro_rules! assert_next_token {
|
|||||||
($ser:expr, $expected:ident($v:expr)) => {
|
($ser:expr, $expected:ident($v:expr)) => {
|
||||||
assert_next_token!(
|
assert_next_token!(
|
||||||
$ser,
|
$ser,
|
||||||
format_args!("{}({:?})", stringify!($expected), $v),
|
format_args!(concat!(stringify!($expected), "({:?})"), $v),
|
||||||
Token::$expected(v),
|
Token::$expected(v),
|
||||||
v == $v
|
v == $v
|
||||||
);
|
);
|
||||||
@@ -56,13 +56,13 @@ macro_rules! assert_next_token {
|
|||||||
use std::fmt::Write;
|
use std::fmt::Write;
|
||||||
let mut buffer = String::new();
|
let mut buffer = String::new();
|
||||||
$(
|
$(
|
||||||
write!(&mut buffer, "{}: {:?}, ", stringify!($k), $k).unwrap();
|
write!(&mut buffer, concat!(stringify!($k), ": {:?}, "), $k).unwrap();
|
||||||
)*
|
)*
|
||||||
buffer
|
buffer
|
||||||
};
|
};
|
||||||
assert_next_token!(
|
assert_next_token!(
|
||||||
$ser,
|
$ser,
|
||||||
format_args!("{} {{ {}}}", stringify!($expected), field_format()),
|
format_args!(concat!(stringify!($expected), " {{ {}}}"), field_format()),
|
||||||
Token::$expected { $($k),* },
|
Token::$expected { $($k),* },
|
||||||
($($k,)*) == compare
|
($($k,)*) == compare
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user