aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Du <[email protected]>2019-06-04 07:28:50 +0100
committerAlan Du <[email protected]>2019-06-04 23:05:07 +0100
commitfb592d76aa24e8fe74694038c283f56ea83ab568 (patch)
tree414c1366892c61cc42812c1697726308ac1f25a1
parent619a61529878f82daf7aed571bc4f6a10bd6dd9f (diff)
Fix clippy::into_iter_on_ref
-rw-r--r--crates/ra_hir/src/expr/validation.rs2
-rw-r--r--crates/ra_hir/src/ty/infer.rs2
-rw-r--r--crates/ra_ide_api/src/folding_ranges.rs2
3 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_hir/src/expr/validation.rs b/crates/ra_hir/src/expr/validation.rs
index 0248b087d..592f558f2 100644
--- a/crates/ra_hir/src/expr/validation.rs
+++ b/crates/ra_hir/src/expr/validation.rs
@@ -57,7 +57,7 @@ impl<'a, 'b> ExprValidator<'a, 'b> {
57 _ => return, 57 _ => return,
58 }; 58 };
59 59
60 let lit_fields: FxHashSet<_> = fields.into_iter().map(|f| &f.name).collect(); 60 let lit_fields: FxHashSet<_> = fields.iter().map(|f| &f.name).collect();
61 let missed_fields: Vec<Name> = struct_def 61 let missed_fields: Vec<Name> = struct_def
62 .fields(db) 62 .fields(db)
63 .iter() 63 .iter()
diff --git a/crates/ra_hir/src/ty/infer.rs b/crates/ra_hir/src/ty/infer.rs
index 1723921e6..58cfcd8a2 100644
--- a/crates/ra_hir/src/ty/infer.rs
+++ b/crates/ra_hir/src/ty/infer.rs
@@ -1044,7 +1044,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> {
1044 Expr::StructLit { path, fields, spread } => { 1044 Expr::StructLit { path, fields, spread } => {
1045 let (ty, def_id) = self.resolve_variant(path.as_ref()); 1045 let (ty, def_id) = self.resolve_variant(path.as_ref());
1046 let substs = ty.substs().unwrap_or_else(Substs::empty); 1046 let substs = ty.substs().unwrap_or_else(Substs::empty);
1047 for (field_idx, field) in fields.into_iter().enumerate() { 1047 for (field_idx, field) in fields.iter().enumerate() {
1048 let field_ty = def_id 1048 let field_ty = def_id
1049 .and_then(|it| match it.field(self.db, &field.name) { 1049 .and_then(|it| match it.field(self.db, &field.name) {
1050 Some(field) => Some(field), 1050 Some(field) => Some(field),
diff --git a/crates/ra_ide_api/src/folding_ranges.rs b/crates/ra_ide_api/src/folding_ranges.rs
index b50bbee38..4400ff232 100644
--- a/crates/ra_ide_api/src/folding_ranges.rs
+++ b/crates/ra_ide_api/src/folding_ranges.rs
@@ -205,7 +205,7 @@ mod tests {
205 "The amount of fold kinds is different than the expected amount" 205 "The amount of fold kinds is different than the expected amount"
206 ); 206 );
207 for ((fold, range), fold_kind) in 207 for ((fold, range), fold_kind) in
208 folds.into_iter().zip(ranges.into_iter()).zip(fold_kinds.into_iter()) 208 folds.iter().zip(ranges.into_iter()).zip(fold_kinds.iter())
209 { 209 {
210 assert_eq!(fold.range.start(), range.start()); 210 assert_eq!(fold.range.start(), range.start());
211 assert_eq!(fold.range.end(), range.end()); 211 assert_eq!(fold.range.end(), range.end());