From 75370312fbfe072947ffdc568eebc9cb4c6108e4 Mon Sep 17 00:00:00 2001 From: Maan2003 Date: Sun, 13 Jun 2021 09:29:36 +0530 Subject: clippy::redundant_closure --- crates/ide_assists/src/handlers/apply_demorgan.rs | 4 ++-- crates/ide_assists/src/handlers/fill_match_arms.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/ide_assists') 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<( terms.sort_by_key(|t| t.syntax().text_range().start()); let mut terms = VecDeque::from(terms); - let paren_expr = expr.syntax().parent().and_then(|parent| ast::ParenExpr::cast(parent)); + let paren_expr = expr.syntax().parent().and_then(ast::ParenExpr::cast); let neg_expr = paren_expr .clone() .and_then(|paren_expr| paren_expr.syntax().parent()) - .and_then(|parent| ast::PrefixExpr::cast(parent)) + .and_then(ast::PrefixExpr::cast) .and_then(|prefix_expr| { if prefix_expr.op_kind().unwrap() == ast::PrefixOp::Not { 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 { fn variants(self, db: &RootDatabase) -> Vec { match self { ExtendedEnum::Enum(e) => { - e.variants(db).into_iter().map(|x| ExtendedVariant::Variant(x)).collect::>() + e.variants(db).into_iter().map(ExtendedVariant::Variant).collect::>() } ExtendedEnum::Bool => { Vec::::from([ExtendedVariant::True, ExtendedVariant::False]) -- cgit v1.2.3