Add optional clippy
diff --git a/Cargo.toml b/Cargo.toml
index e438ed9..e9c923a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -17,4 +17,5 @@
 visit = []
 
 [dependencies]
+clippy = { version = "0.*", optional = true }
 quote = { version = "0.1.2", optional = true }
diff --git a/src/attr.rs b/src/attr.rs
index 10c8029..8d36b34 100644
--- a/src/attr.rs
+++ b/src/attr.rs
@@ -1,6 +1,6 @@
 use super::*;
 
-/// Doc-comments are promoted to attributes that have is_sugared_doc = true
+/// Doc-comments are promoted to attributes that have `is_sugared_doc` = true
 #[derive(Debug, Clone, Eq, PartialEq)]
 pub struct Attribute {
     pub value: MetaItem,
diff --git a/src/escape.rs b/src/escape.rs
index 2cdb647..c3b208a 100644
--- a/src/escape.rs
+++ b/src/escape.rs
@@ -66,6 +66,7 @@
     char_from_hex_bytes(&[a as u8, b as u8])
 }
 
+#[cfg_attr(feature = "clippy", allow(many_single_char_names))]
 fn backslash_u<I>(chars: &mut I) -> Option<char> where I: Iterator<Item = (usize, char)> {
     next_char!(chars @ '{');
     let a = next_char!(chars @ '0'...'9' | 'a'...'f' | 'A'...'F');
diff --git a/src/expr.rs b/src/expr.rs
index df35554..1026654 100644
--- a/src/expr.rs
+++ b/src/expr.rs
@@ -318,7 +318,7 @@
 ///
 /// Patterns like the fields of Foo `{ x, ref y, ref mut z }`
 /// are treated the same as` x: x, y: ref y, z: ref mut z`,
-/// except is_shorthand is true
+/// except `is_shorthand` is true
 #[derive(Debug, Clone, Eq, PartialEq)]
 pub struct FieldPat {
     /// The identifier for the field
diff --git a/src/generics.rs b/src/generics.rs
index 7e091e5..e7cc873 100644
--- a/src/generics.rs
+++ b/src/generics.rs
@@ -29,8 +29,8 @@
 }
 
 /// The AST represents all type param bounds as types.
-/// typeck::collect::compute_bounds matches these against
-/// the "special" built-in traits (see middle::lang_items) and
+/// `typeck::collect::compute_bounds` matches these against
+/// the "special" built-in traits (see `middle::lang_items`) and
 /// detects Copy, Send and Sync.
 #[derive(Debug, Clone, Eq, PartialEq)]
 pub enum TyParamBound {
diff --git a/src/helper.rs b/src/helper.rs
index d1db351..bccdd42 100644
--- a/src/helper.rs
+++ b/src/helper.rs
@@ -9,8 +9,7 @@
 }
 
 pub fn punct<'a>(input: &'a str, token: &'static str) -> IResult<&'a str, &'a str> {
-    let mut chars = input.char_indices();
-    while let Some((i, ch)) = chars.next() {
+    for (i, ch) in input.char_indices() {
         if !ch.is_whitespace() {
             return if input[i..].starts_with(token) {
                 let end = i + token.len();
diff --git a/src/item.rs b/src/item.rs
index 9a23042..a5794c4 100644
--- a/src/item.rs
+++ b/src/item.rs
@@ -87,13 +87,13 @@
     /// or just
     ///
     /// `foo::bar::baz` (with `as baz` implicitly on the right)
-    ViewPathSimple(Ident, Path),
+    Simple(Ident, Path),
 
     /// `foo::bar::*`
-    ViewPathGlob(Path),
+    Glob(Path),
 
-    /// `foo::bar::{a,b,c}`
-    ViewPathList(Path, Vec<PathListItem>)
+    /// `foo::bar::{a, b, c}`
+    List(Path, Vec<PathListItem>)
 }
 
 #[derive(Debug, Clone, Eq, PartialEq)]
diff --git a/src/lib.rs b/src/lib.rs
index d7b7b10..0841f17 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,3 +1,6 @@
+#![cfg_attr(feature = "clippy", feature(plugin))]
+#![cfg_attr(feature = "clippy", plugin(clippy))]
+
 #[cfg(feature = "printing")]
 extern crate quote;
 
diff --git a/src/mac.rs b/src/mac.rs
index 42d116f..f227a25 100644
--- a/src/mac.rs
+++ b/src/mac.rs
@@ -4,7 +4,7 @@
 /// is being invoked, and the vector of token-trees contains the source
 /// of the macro invocation.
 ///
-/// NB: the additional ident for a macro_rules-style macro is actually
+/// NB: the additional ident for a `macro_rules`-style macro is actually
 /// stored in the enclosing item. Oog.
 #[derive(Debug, Clone, Eq, PartialEq)]
 pub struct Mac {
@@ -20,7 +20,7 @@
 /// If the syntax extension is an MBE macro, it will attempt to match its
 /// LHS token tree against the provided token tree, and if it finds a
 /// match, will transcribe the RHS token tree, splicing in any captured
-/// macro_parser::matched_nonterminals into the `SubstNt`s it finds.
+/// `macro_parser::matched_nonterminals` into the `SubstNt`s it finds.
 ///
 /// The RHS of an MBE macro is the only place `SubstNt`s are substituted.
 /// Nothing special happens to misnamed or misplaced `SubstNt`s.