mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-04-22 21:48:02 +00:00
feat(clippy): Use clippy for it's extra lints
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
#![cfg_attr(feature = "nightly", feature(plugin))]
|
||||
#![cfg_attr(feature = "nightly", plugin(clippy))]
|
||||
|
||||
extern crate num;
|
||||
extern crate serde;
|
||||
|
||||
|
||||
@@ -95,12 +95,12 @@ declare_tests! {
|
||||
test_char {
|
||||
'a' => vec![Token::Char('a')],
|
||||
'a' => vec![Token::Str("a")],
|
||||
'a' => vec![Token::String("a".to_string())],
|
||||
'a' => vec![Token::String("a".to_owned())],
|
||||
}
|
||||
test_string {
|
||||
"abc".to_string() => vec![Token::Str("abc")],
|
||||
"abc".to_string() => vec![Token::String("abc".to_string())],
|
||||
"a".to_string() => vec![Token::Char('a')],
|
||||
"abc".to_owned() => vec![Token::Str("abc")],
|
||||
"abc".to_owned() => vec![Token::String("abc".to_owned())],
|
||||
"a".to_owned() => vec![Token::Char('a')],
|
||||
}
|
||||
test_option {
|
||||
None::<i32> => vec![Token::Unit],
|
||||
|
||||
@@ -63,7 +63,7 @@ declare_ser_tests! {
|
||||
}
|
||||
test_str {
|
||||
"abc" => &[Token::Str("abc")],
|
||||
"abc".to_string() => &[Token::Str("abc")],
|
||||
"abc".to_owned() => &[Token::Str("abc")],
|
||||
}
|
||||
test_option {
|
||||
None::<i32> => &[Token::Option(false)],
|
||||
|
||||
@@ -325,7 +325,7 @@ impl de::Error for Error {
|
||||
fn end_of_stream() -> Error { Error::EndOfStreamError }
|
||||
|
||||
fn unknown_field(field: &str) -> Error {
|
||||
Error::UnknownFieldError(field.to_string())
|
||||
Error::UnknownFieldError(field.to_owned())
|
||||
}
|
||||
|
||||
fn missing_field(field: &'static str) -> Error {
|
||||
|
||||
Reference in New Issue
Block a user