aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/expr.rs
diff options
context:
space:
mode:
authorJeremy Kolb <[email protected]>2019-07-04 18:26:44 +0100
committerJeremy Kolb <[email protected]>2019-07-04 22:43:00 +0100
commit4ad9e986ad05e404df73701c098b71f73a847ca6 (patch)
tree2a2b2cc9dbee07d0aa92df883c807edbab264a85 /crates/ra_hir/src/expr.rs
parentc6a6e43372de9530ec7df0f38352466ed107e1a2 (diff)
Some clippy fixes for 1.36
Diffstat (limited to 'crates/ra_hir/src/expr.rs')
-rw-r--r--crates/ra_hir/src/expr.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_hir/src/expr.rs b/crates/ra_hir/src/expr.rs
index d5b4ba6b6..3e763fef0 100644
--- a/crates/ra_hir/src/expr.rs
+++ b/crates/ra_hir/src/expr.rs
@@ -150,7 +150,7 @@ impl BodySourceMap {
150 } 150 }
151 151
152 pub(crate) fn field_syntax(&self, expr: ExprId, field: usize) -> AstPtr<ast::NamedField> { 152 pub(crate) fn field_syntax(&self, expr: ExprId, field: usize) -> AstPtr<ast::NamedField> {
153 self.field_map[&(expr, field)].clone() 153 self.field_map[&(expr, field)]
154 } 154 }
155} 155}
156 156
@@ -471,15 +471,15 @@ impl Pat {
471 match self { 471 match self {
472 Pat::Range { .. } | Pat::Lit(..) | Pat::Path(..) | Pat::Wild | Pat::Missing => {} 472 Pat::Range { .. } | Pat::Lit(..) | Pat::Path(..) | Pat::Wild | Pat::Missing => {}
473 Pat::Bind { subpat, .. } => { 473 Pat::Bind { subpat, .. } => {
474 subpat.iter().map(|pat| *pat).for_each(f); 474 subpat.iter().copied().for_each(f);
475 } 475 }
476 Pat::Tuple(args) | Pat::TupleStruct { args, .. } => { 476 Pat::Tuple(args) | Pat::TupleStruct { args, .. } => {
477 args.iter().map(|pat| *pat).for_each(f); 477 args.iter().copied().for_each(f);
478 } 478 }
479 Pat::Ref { pat, .. } => f(*pat), 479 Pat::Ref { pat, .. } => f(*pat),
480 Pat::Slice { prefix, rest, suffix } => { 480 Pat::Slice { prefix, rest, suffix } => {
481 let total_iter = prefix.iter().chain(rest.iter()).chain(suffix.iter()); 481 let total_iter = prefix.iter().chain(rest.iter()).chain(suffix.iter());
482 total_iter.map(|pat| *pat).for_each(f); 482 total_iter.copied().for_each(f);
483 } 483 }
484 Pat::Struct { args, .. } => { 484 Pat::Struct { args, .. } => {
485 args.iter().map(|f| f.pat).for_each(f); 485 args.iter().map(|f| f.pat).for_each(f);