aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/expr.rs
diff options
context:
space:
mode:
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);