Fix clippy lints
diff --git a/src/aster/qpath.rs b/src/aster/qpath.rs
index 71f68b1..6ecde86 100644
--- a/src/aster/qpath.rs
+++ b/src/aster/qpath.rs
@@ -65,6 +65,9 @@
where F: Invoke<(QSelf, Path)>
{
/// Build a qualified path with a path builder.
+ // Clippy false positive
+ // https://github.com/Manishearth/rust-clippy/issues/1285
+ #[cfg_attr(feature = "clippy", allow(wrong_self_convention))]
pub fn as_(self) -> PathBuilder<Self> {
PathBuilder::with_callback(self)
}
diff --git a/src/expr.rs b/src/expr.rs
index 4f5c73f..787f5ad 100644
--- a/src/expr.rs
+++ b/src/expr.rs
@@ -189,6 +189,9 @@
}
#[derive(Debug, Clone, Eq, PartialEq)]
+// Clippy false positive
+// https://github.com/Manishearth/rust-clippy/issues/1241
+#[cfg_attr(feature = "clippy", allow(enum_variant_names))]
pub enum Pat {
/// Represents a wildcard pattern (`_`)
Wild,
@@ -1013,7 +1016,7 @@
args[0].to_tokens(tokens);
tokens.append(".");
ident.to_tokens(tokens);
- if ascript.len() > 0 {
+ if !ascript.is_empty() {
tokens.append("::");
tokens.append("<");
tokens.append_separated(ascript, ",");
diff --git a/src/mac.rs b/src/mac.rs
index aa8fc07..6ae0120 100644
--- a/src/mac.rs
+++ b/src/mac.rs
@@ -377,9 +377,9 @@
Token::Dollar => tokens.append("$"),
Token::Question => tokens.append("?"),
Token::Literal(ref lit) => lit.to_tokens(tokens),
- Token::Ident(ref ident) => ident.to_tokens(tokens),
- Token::Underscore => tokens.append("_"),
+ Token::Ident(ref ident) |
Token::Lifetime(ref ident) => ident.to_tokens(tokens),
+ Token::Underscore => tokens.append("_"),
Token::DocComment(ref com) => {
tokens.append(&format!("{}\n", com));
}
diff --git a/src/visit.rs b/src/visit.rs
index 60c5d93..6ae2824 100644
--- a/src/visit.rs
+++ b/src/visit.rs
@@ -141,7 +141,7 @@
walk_list!(visitor, visit_lifetime, opt_lifetime);
visitor.visit_ty(&mutable_type.ty)
}
- Ty::Never => {}
+ Ty::Never | Ty::Infer => {}
Ty::Tup(ref tuple_element_types) => {
walk_list!(visitor, visit_ty, tuple_element_types);
}
@@ -167,13 +167,10 @@
visitor.visit_ty(inner);
visitor.visit_const_expr(len);
}
- Ty::PolyTraitRef(ref bounds) => {
- walk_list!(visitor, visit_ty_param_bound, bounds);
- }
+ Ty::PolyTraitRef(ref bounds) |
Ty::ImplTrait(ref bounds) => {
walk_list!(visitor, visit_ty_param_bound, bounds);
}
- Ty::Infer => {}
}
}
@@ -266,7 +263,7 @@
pub fn walk_const_expr<V: Visitor>(visitor: &mut V, len: &ConstExpr) {
match *len {
ConstExpr::Call(ref function, ref args) => {
- visitor.visit_const_expr(&function);
+ visitor.visit_const_expr(function);
walk_list!(visitor, visit_const_expr, args);
}
ConstExpr::Binary(_op, ref left, ref right) => {