diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-07-04 22:56:36 +0100 |
---|---|---|
committer | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-07-04 22:56:36 +0100 |
commit | b1bf434dfcf81ac681a9e152628f9eecde68470a (patch) | |
tree | 51ea069481d3a5eefa9ec1f558a12c85690dabce /crates/ra_hir/src/expr.rs | |
parent | c6a6e43372de9530ec7df0f38352466ed107e1a2 (diff) | |
parent | e7fb6c83cc33facf0d74e253bd193afc46b1dc5c (diff) |
Merge #1482
1482: Some clippy fixes for 1.36 r=kjeremy a=kjeremy
Some clippy fixes now that 1.36 is released. ~~Plus the requisite format run (I can rebase after #1481 is merged to make this cleaner) .~~
The change from `map(|it| *it)` to `copied()` changes the minimum rust stable to 1.36.
Co-authored-by: Jeremy Kolb <[email protected]>
Diffstat (limited to 'crates/ra_hir/src/expr.rs')
-rw-r--r-- | crates/ra_hir/src/expr.rs | 8 |
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); |