mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-04-22 11:28:02 +00:00
feat(clippy): Use clippy for it's extra lints
This commit is contained in:
@@ -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 }
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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))]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user