diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-09-23 19:47:14 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2019-09-23 19:47:14 +0100 |
commit | c12a713739e30019497ab0f5e7bfa776122bfc6d (patch) | |
tree | 87e32301e1507a677840066c1547d86fd21e0460 | |
parent | a745afcc36ef273eb44bc9f71a40d9948d7309b0 (diff) | |
parent | 13d7fc1620c7af448c9f234f806f4aee342b3948 (diff) |
Merge #1898
1898: Drive by lints r=kjeremy a=kjeremy
Co-authored-by: kjeremy <[email protected]>
Co-authored-by: Jeremy Kolb <[email protected]>
-rw-r--r-- | crates/ra_assists/src/fill_match_arms.rs | 2 | ||||
-rw-r--r-- | crates/ra_hir/src/code_model.rs | 2 | ||||
-rw-r--r-- | crates/ra_hir/src/from_source.rs | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_assists/src/fill_match_arms.rs b/crates/ra_assists/src/fill_match_arms.rs index 543ed164c..f59062bb9 100644 --- a/crates/ra_assists/src/fill_match_arms.rs +++ b/crates/ra_assists/src/fill_match_arms.rs | |||
@@ -29,7 +29,7 @@ pub(crate) fn fill_match_arms(mut ctx: AssistCtx<impl HirDatabase>) -> Option<As | |||
29 | 29 | ||
30 | ctx.add_action(AssistId("fill_match_arms"), "fill match arms", |edit| { | 30 | ctx.add_action(AssistId("fill_match_arms"), "fill match arms", |edit| { |
31 | let variants = variant_list.variants(); | 31 | let variants = variant_list.variants(); |
32 | let arms = variants.into_iter().filter_map(build_pat).map(|pat| { | 32 | let arms = variants.filter_map(build_pat).map(|pat| { |
33 | AstBuilder::<ast::MatchArm>::from_pieces( | 33 | AstBuilder::<ast::MatchArm>::from_pieces( |
34 | iter::once(pat), | 34 | iter::once(pat), |
35 | &AstBuilder::<ast::Expr>::unit(), | 35 | &AstBuilder::<ast::Expr>::unit(), |
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs index 28002f740..12399c6ac 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs | |||
@@ -749,7 +749,7 @@ impl Const { | |||
749 | db.const_data(self) | 749 | db.const_data(self) |
750 | } | 750 | } |
751 | 751 | ||
752 | pub fn name(&self, db: &impl HirDatabase) -> Option<Name> { | 752 | pub fn name(self, db: &impl HirDatabase) -> Option<Name> { |
753 | self.data(db).name().cloned() | 753 | self.data(db).name().cloned() |
754 | } | 754 | } |
755 | 755 | ||
diff --git a/crates/ra_hir/src/from_source.rs b/crates/ra_hir/src/from_source.rs index c6ad85fc7..f3194595f 100644 --- a/crates/ra_hir/src/from_source.rs +++ b/crates/ra_hir/src/from_source.rs | |||
@@ -122,7 +122,7 @@ impl FromSource for StructField { | |||
122 | .fields() | 122 | .fields() |
123 | .into_iter() | 123 | .into_iter() |
124 | .flat_map(|it| it.iter()) | 124 | .flat_map(|it| it.iter()) |
125 | .map(|(id, _)| StructField { parent: variant_def.clone(), id }) | 125 | .map(|(id, _)| StructField { parent: variant_def, id }) |
126 | .find(|f| f.source(db) == src) | 126 | .find(|f| f.source(db) == src) |
127 | } | 127 | } |
128 | } | 128 | } |