about summary refs log tree commit diff
path: root/src/libsyntax/ext
diff options
context:
space:
mode:
authorSeo Sanghyeon <sanxiyn@gmail.com>2015-11-17 23:24:49 +0900
committerSeo Sanghyeon <sanxiyn@gmail.com>2015-11-17 23:24:49 +0900
commit95f6ea920d56d9f3db52f5fa0a81f0ec4dffde5f (patch)
tree9c51568c0bbbab14b8c8b72862128e91210cdda4 /src/libsyntax/ext
parentc61e8fd61a6cbdbfc8f1e2e0e6f40d927df8c18f (diff)
downloadrust-95f6ea920d56d9f3db52f5fa0a81f0ec4dffde5f.tar.gz
rust-95f6ea920d56d9f3db52f5fa0a81f0ec4dffde5f.zip
Fix match_ref_pats flagged by Clippy
Diffstat (limited to 'src/libsyntax/ext')
-rw-r--r--src/libsyntax/ext/deriving/generic/ty.rs4
-rw-r--r--src/libsyntax/ext/quote.rs6
-rw-r--r--src/libsyntax/ext/tt/macro_parser.rs34
3 files changed, 22 insertions, 22 deletions
diff --git a/src/libsyntax/ext/deriving/generic/ty.rs b/src/libsyntax/ext/deriving/generic/ty.rs
index 9e8e68c0b8c..67826c9c6cd 100644
--- a/src/libsyntax/ext/deriving/generic/ty.rs
+++ b/src/libsyntax/ext/deriving/generic/ty.rs
@@ -242,8 +242,8 @@ impl<'a> LifetimeBounds<'a> {
             cx.lifetime_def(span, cx.ident_of(*lt).name, bounds)
         }).collect();
         let ty_params = self.bounds.iter().map(|t| {
-            match t {
-                &(ref name, ref bounds) => {
+            match *t {
+                (ref name, ref bounds) => {
                     mk_ty_param(cx,
                                 span,
                                 *name,
diff --git a/src/libsyntax/ext/quote.rs b/src/libsyntax/ext/quote.rs
index d743a601bbb..5e5b8158181 100644
--- a/src/libsyntax/ext/quote.rs
+++ b/src/libsyntax/ext/quote.rs
@@ -63,9 +63,9 @@ pub mod rt {
 
     impl<T: ToTokens> ToTokens for Option<T> {
         fn to_tokens(&self, cx: &ExtCtxt) -> Vec<TokenTree> {
-            match self {
-                &Some(ref t) => t.to_tokens(cx),
-                &None => Vec::new(),
+            match *self {
+                Some(ref t) => t.to_tokens(cx),
+                None => Vec::new(),
             }
         }
     }
diff --git a/src/libsyntax/ext/tt/macro_parser.rs b/src/libsyntax/ext/tt/macro_parser.rs
index dded634882d..675482fd644 100644
--- a/src/libsyntax/ext/tt/macro_parser.rs
+++ b/src/libsyntax/ext/tt/macro_parser.rs
@@ -107,16 +107,16 @@ enum TokenTreeOrTokenTreeVec {
 
 impl TokenTreeOrTokenTreeVec {
     fn len(&self) -> usize {
-        match self {
-            &TtSeq(ref v) => v.len(),
-            &Tt(ref tt) => tt.len(),
+        match *self {
+            TtSeq(ref v) => v.len(),
+            Tt(ref tt) => tt.len(),
         }
     }
 
     fn get_tt(&self, index: usize) -> TokenTree {
-        match self {
-            &TtSeq(ref v) => v[index].clone(),
-            &Tt(ref tt) => tt.get_tt(index),
+        match *self {
+            TtSeq(ref v) => v[index].clone(),
+            Tt(ref tt) => tt.get_tt(index),
         }
     }
 }
@@ -144,17 +144,17 @@ pub struct MatcherPos {
 
 pub fn count_names(ms: &[TokenTree]) -> usize {
     ms.iter().fold(0, |count, elt| {
-        count + match elt {
-            &TokenTree::Sequence(_, ref seq) => {
+        count + match *elt {
+            TokenTree::Sequence(_, ref seq) => {
                 seq.num_captures
             }
-            &TokenTree::Delimited(_, ref delim) => {
+            TokenTree::Delimited(_, ref delim) => {
                 count_names(&delim.tts)
             }
-            &TokenTree::Token(_, MatchNt(..)) => {
+            TokenTree::Token(_, MatchNt(..)) => {
                 1
             }
-            &TokenTree::Token(_, _) => 0,
+            TokenTree::Token(_, _) => 0,
         }
     })
 }
@@ -203,18 +203,18 @@ pub fn nameize(p_s: &ParseSess, ms: &[TokenTree], res: &[Rc<NamedMatch>])
             -> HashMap<Name, Rc<NamedMatch>> {
     fn n_rec(p_s: &ParseSess, m: &TokenTree, res: &[Rc<NamedMatch>],
              ret_val: &mut HashMap<Name, Rc<NamedMatch>>, idx: &mut usize) {
-        match m {
-            &TokenTree::Sequence(_, ref seq) => {
+        match *m {
+            TokenTree::Sequence(_, ref seq) => {
                 for next_m in &seq.tts {
                     n_rec(p_s, next_m, res, ret_val, idx)
                 }
             }
-            &TokenTree::Delimited(_, ref delim) => {
+            TokenTree::Delimited(_, ref delim) => {
                 for next_m in &delim.tts {
                     n_rec(p_s, next_m, res, ret_val, idx)
                 }
             }
-            &TokenTree::Token(sp, MatchNt(bind_name, _, _, _)) => {
+            TokenTree::Token(sp, MatchNt(bind_name, _, _, _)) => {
                 match ret_val.entry(bind_name.name) {
                     Vacant(spot) => {
                         spot.insert(res[*idx].clone());
@@ -228,8 +228,8 @@ pub fn nameize(p_s: &ParseSess, ms: &[TokenTree], res: &[Rc<NamedMatch>])
                     }
                 }
             }
-            &TokenTree::Token(_, SubstNt(..)) => panic!("Cannot fill in a NT"),
-            &TokenTree::Token(_, _) => (),
+            TokenTree::Token(_, SubstNt(..)) => panic!("Cannot fill in a NT"),
+            TokenTree::Token(_, _) => (),
         }
     }
     let mut ret_val = HashMap::new();