Resolve clippy lints in tests

This commit is contained in:
David Tolnay 2017-02-01 15:45:16 -08:00
parent fc43daa60d
commit 148ea75fed
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
2 changed files with 9 additions and 2 deletions

View File

@ -196,6 +196,12 @@ macro_rules! json_internal {
json_internal!(@object $object [,] (,));
};
// Key is fully parenthesized. This avoids clippy double_parens false
// positives because the parenthesization may be necessary here.
(@object $object:ident () ($key:expr) : $($rest:tt)*) => {
json_internal!(@object $object ($key) : $($rest)*);
};
// Munch a token into the current key.
(@object $object:ident ($($key:tt)*) $tt:tt $($rest:tt)*) => {
json_internal!(@object $object ($($key)* $tt) $($rest)*);

View File

@ -1,3 +1,5 @@
#![cfg_attr(feature = "cargo-clippy", allow(float_cmp))]
#![cfg_attr(feature = "trace-macros", feature(trace_macros))]
#[cfg(feature = "trace-macros")]
trace_macros!(true);
@ -1006,8 +1008,7 @@ fn test_parse_list() {
("[1, [2, 3]]", (1u64, (2u64, 3u64))),
]);
let v: () = from_str("[]").unwrap();
assert_eq!(v, ());
from_str::<()>("[]").unwrap();
}
#[test]