diff options
author | Maan2003 <[email protected]> | 2021-06-13 04:59:36 +0100 |
---|---|---|
committer | Maan2003 <[email protected]> | 2021-06-13 04:59:36 +0100 |
commit | 75370312fbfe072947ffdc568eebc9cb4c6108e4 (patch) | |
tree | cb435a1c147db6891c7f6cf625efd8876f427788 /crates/ide_assists | |
parent | 705f7e6e2644bf5de4255bc05ea8d9d5027c29b0 (diff) |
clippy::redundant_closure
Diffstat (limited to 'crates/ide_assists')
-rw-r--r-- | crates/ide_assists/src/handlers/apply_demorgan.rs | 4 | ||||
-rw-r--r-- | crates/ide_assists/src/handlers/fill_match_arms.rs | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/crates/ide_assists/src/handlers/apply_demorgan.rs b/crates/ide_assists/src/handlers/apply_demorgan.rs index 5c936a510..c93959e66 100644 --- a/crates/ide_assists/src/handlers/apply_demorgan.rs +++ b/crates/ide_assists/src/handlers/apply_demorgan.rs | |||
@@ -78,12 +78,12 @@ pub(crate) fn apply_demorgan(acc: &mut Assists, ctx: &AssistContext) -> Option<( | |||
78 | terms.sort_by_key(|t| t.syntax().text_range().start()); | 78 | terms.sort_by_key(|t| t.syntax().text_range().start()); |
79 | let mut terms = VecDeque::from(terms); | 79 | let mut terms = VecDeque::from(terms); |
80 | 80 | ||
81 | let paren_expr = expr.syntax().parent().and_then(|parent| ast::ParenExpr::cast(parent)); | 81 | let paren_expr = expr.syntax().parent().and_then(ast::ParenExpr::cast); |
82 | 82 | ||
83 | let neg_expr = paren_expr | 83 | let neg_expr = paren_expr |
84 | .clone() | 84 | .clone() |
85 | .and_then(|paren_expr| paren_expr.syntax().parent()) | 85 | .and_then(|paren_expr| paren_expr.syntax().parent()) |
86 | .and_then(|parent| ast::PrefixExpr::cast(parent)) | 86 | .and_then(ast::PrefixExpr::cast) |
87 | .and_then(|prefix_expr| { | 87 | .and_then(|prefix_expr| { |
88 | if prefix_expr.op_kind().unwrap() == ast::PrefixOp::Not { | 88 | if prefix_expr.op_kind().unwrap() == ast::PrefixOp::Not { |
89 | Some(prefix_expr) | 89 | Some(prefix_expr) |
diff --git a/crates/ide_assists/src/handlers/fill_match_arms.rs b/crates/ide_assists/src/handlers/fill_match_arms.rs index c8bc923f5..5a43bdd6f 100644 --- a/crates/ide_assists/src/handlers/fill_match_arms.rs +++ b/crates/ide_assists/src/handlers/fill_match_arms.rs | |||
@@ -202,7 +202,7 @@ impl ExtendedEnum { | |||
202 | fn variants(self, db: &RootDatabase) -> Vec<ExtendedVariant> { | 202 | fn variants(self, db: &RootDatabase) -> Vec<ExtendedVariant> { |
203 | match self { | 203 | match self { |
204 | ExtendedEnum::Enum(e) => { | 204 | ExtendedEnum::Enum(e) => { |
205 | e.variants(db).into_iter().map(|x| ExtendedVariant::Variant(x)).collect::<Vec<_>>() | 205 | e.variants(db).into_iter().map(ExtendedVariant::Variant).collect::<Vec<_>>() |
206 | } | 206 | } |
207 | ExtendedEnum::Bool => { | 207 | ExtendedEnum::Bool => { |
208 | Vec::<ExtendedVariant>::from([ExtendedVariant::True, ExtendedVariant::False]) | 208 | Vec::<ExtendedVariant>::from([ExtendedVariant::True, ExtendedVariant::False]) |