aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_assists
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ide_assists')
-rw-r--r--crates/ide_assists/src/handlers/inline_local_variable.rs16
1 files changed, 7 insertions, 9 deletions
diff --git a/crates/ide_assists/src/handlers/inline_local_variable.rs b/crates/ide_assists/src/handlers/inline_local_variable.rs
index bf4ba16f0..945d28650 100644
--- a/crates/ide_assists/src/handlers/inline_local_variable.rs
+++ b/crates/ide_assists/src/handlers/inline_local_variable.rs
@@ -65,10 +65,9 @@ pub(crate) fn inline_local_variable(acc: &mut Assists, ctx: &AssistContext) -> O
65 Some(u) => u, 65 Some(u) => u,
66 None => return Some(false), 66 None => return Some(false),
67 }; 67 };
68 68 Some(
69 Some(!matches!( 69 !(matches!(
70 (&initializer_expr, usage_parent), 70 initializer_expr,
71 (
72 ast::Expr::CallExpr(_) 71 ast::Expr::CallExpr(_)
73 | ast::Expr::IndexExpr(_) 72 | ast::Expr::IndexExpr(_)
74 | ast::Expr::MethodCallExpr(_) 73 | ast::Expr::MethodCallExpr(_)
@@ -82,9 +81,8 @@ pub(crate) fn inline_local_variable(acc: &mut Assists, ctx: &AssistContext) -> O
82 | ast::Expr::PathExpr(_) 81 | ast::Expr::PathExpr(_)
83 | ast::Expr::BlockExpr(_) 82 | ast::Expr::BlockExpr(_)
84 | ast::Expr::EffectExpr(_), 83 | ast::Expr::EffectExpr(_),
85 _ 84 ) || matches!(
86 ) | ( 85 usage_parent,
87 _,
88 ast::Expr::CallExpr(_) 86 ast::Expr::CallExpr(_)
89 | ast::Expr::TupleExpr(_) 87 | ast::Expr::TupleExpr(_)
90 | ast::Expr::ArrayExpr(_) 88 | ast::Expr::ArrayExpr(_)
@@ -94,8 +92,8 @@ pub(crate) fn inline_local_variable(acc: &mut Assists, ctx: &AssistContext) -> O
94 | ast::Expr::BreakExpr(_) 92 | ast::Expr::BreakExpr(_)
95 | ast::Expr::ReturnExpr(_) 93 | ast::Expr::ReturnExpr(_)
96 | ast::Expr::MatchExpr(_) 94 | ast::Expr::MatchExpr(_)
97 ) 95 )),
98 )) 96 )
99 }) 97 })
100 .collect::<Option<_>>() 98 .collect::<Option<_>>()
101 .map(|b| (file_id, b)) 99 .map(|b| (file_id, b))