feat(clippy): Use clippy for it's extra lints

This commit is contained in:
Erick Tryzelaar
2016-01-18 12:24:03 -08:00
parent fbcf905c9f
commit bfa2b69193
19 changed files with 57 additions and 34 deletions
+2 -1
View File
@@ -11,7 +11,7 @@ keywords = ["serde", "serialization"]
[features]
default = ["with-syntex"]
nightly = ["quasi_macros"]
nightly = ["clippy", "quasi_macros"]
with-syntex = ["quasi/with-syntex", "quasi_codegen", "quasi_codegen/with-syntex", "syntex", "syntex_syntax"]
[build-dependencies]
@@ -20,6 +20,7 @@ syntex = { version = "^0.26.0", optional = true }
[dependencies]
aster = { version = "^0.10.0", default-features = false }
clippy = { version = "^0.0.35", optional = true }
quasi = { version = "^0.4.0", default-features = false }
quasi_macros = { version = "^0.4.0", optional = true }
syntex = { version = "^0.26.0", optional = true }
+2 -2
View File
@@ -32,7 +32,7 @@ impl FieldAttrs {
/// Return a set of formats that the field has attributes for.
pub fn formats(&self) -> HashSet<P<ast::Expr>> {
match self.names {
FieldNames::Format{ref formats, default: _} => {
FieldNames::Format { ref formats, .. } => {
let mut set = HashSet::new();
for (fmt, _) in formats.iter() {
set.insert(fmt.clone());
@@ -70,7 +70,7 @@ impl FieldAttrs {
pub fn default_key_expr(&self) -> &P<ast::Expr> {
match self.names {
FieldNames::Global(ref expr) => expr,
FieldNames::Format{formats: _, ref default} => default,
FieldNames::Format { ref default, .. } => default,
}
}
+2
View File
@@ -1,3 +1,5 @@
#![cfg_attr(feature = "nightly", plugin(clippy))]
#![cfg_attr(feature = "nightly", allow(used_underscore_binding))]
#![cfg_attr(not(feature = "with-syntex"), feature(rustc_private, plugin))]
#![cfg_attr(not(feature = "with-syntex"), plugin(quasi_macros))]