aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/adt.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-09-25 06:27:07 +0100
committerGitHub <[email protected]>2019-09-25 06:27:07 +0100
commit6bac2d0a637a6d0b3922a6f8fe05fa32d6d43b15 (patch)
treec3c2af75fa7be376506bf0ffe23fe8cad9c6c402 /crates/ra_hir/src/adt.rs
parentc7420ddaaa76741d1eebe393406b38ba5596e54a (diff)
parent9c45a9e58632966984a79e18aa5221efb65e0ead (diff)
Merge #1904
1904: Remove redundant `clone()` r=matklad a=sinkuu Co-authored-by: Shotaro Yamada <[email protected]>
Diffstat (limited to 'crates/ra_hir/src/adt.rs')
-rw-r--r--crates/ra_hir/src/adt.rs11
1 files changed, 3 insertions, 8 deletions
diff --git a/crates/ra_hir/src/adt.rs b/crates/ra_hir/src/adt.rs
index 56f2b7aa3..fbb4ff4d8 100644
--- a/crates/ra_hir/src/adt.rs
+++ b/crates/ra_hir/src/adt.rs
@@ -56,8 +56,7 @@ impl EnumVariant {
56 .zip(db.enum_data(self.parent).variants.iter()) 56 .zip(db.enum_data(self.parent).variants.iter())
57 .find(|(_syntax, (id, _))| *id == self.id) 57 .find(|(_syntax, (id, _))| *id == self.id)
58 .unwrap() 58 .unwrap()
59 .0 59 .0;
60 .to_owned();
61 Source { file_id: src.file_id, ast } 60 Source { file_id: src.file_id, ast }
62 } 61 }
63 pub(crate) fn variant_data(self, db: &impl DefDatabase) -> Arc<VariantData> { 62 pub(crate) fn variant_data(self, db: &impl DefDatabase) -> Arc<VariantData> {
@@ -203,12 +202,8 @@ impl StructField {
203 }; 202 };
204 203
205 let field_sources = match struct_kind { 204 let field_sources = match struct_kind {
206 ast::StructKind::Tuple(fl) => { 205 ast::StructKind::Tuple(fl) => fl.fields().map(|it| FieldSource::Pos(it)).collect(),
207 fl.fields().map(|it| FieldSource::Pos(it.to_owned())).collect() 206 ast::StructKind::Named(fl) => fl.fields().map(|it| FieldSource::Named(it)).collect(),
208 }
209 ast::StructKind::Named(fl) => {
210 fl.fields().map(|it| FieldSource::Named(it.to_owned())).collect()
211 }
212 ast::StructKind::Unit => Vec::new(), 207 ast::StructKind::Unit => Vec::new(),
213 }; 208 };
214 let ast = field_sources 209 let ast = field_sources