diff options
Diffstat (limited to 'crates/assists/src')
-rw-r--r-- | crates/assists/src/handlers/inline_local_variable.rs | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/crates/assists/src/handlers/inline_local_variable.rs b/crates/assists/src/handlers/inline_local_variable.rs index dc798daaa..0e63a60e8 100644 --- a/crates/assists/src/handlers/inline_local_variable.rs +++ b/crates/assists/src/handlers/inline_local_variable.rs | |||
@@ -79,29 +79,30 @@ pub(crate) fn inline_local_variable(acc: &mut Assists, ctx: &AssistContext) -> O | |||
79 | None => return Ok(false), | 79 | None => return Ok(false), |
80 | }; | 80 | }; |
81 | 81 | ||
82 | Ok(!matches!((&initializer_expr, usage_parent), | 82 | Ok(!matches!( |
83 | (&initializer_expr, usage_parent), | ||
83 | (ast::Expr::CallExpr(_), _) | 84 | (ast::Expr::CallExpr(_), _) |
84 | | (ast::Expr::IndexExpr(_), _) | 85 | | (ast::Expr::IndexExpr(_), _) |
85 | | (ast::Expr::MethodCallExpr(_), _) | 86 | | (ast::Expr::MethodCallExpr(_), _) |
86 | | (ast::Expr::FieldExpr(_), _) | 87 | | (ast::Expr::FieldExpr(_), _) |
87 | | (ast::Expr::TryExpr(_), _) | 88 | | (ast::Expr::TryExpr(_), _) |
88 | | (ast::Expr::RefExpr(_), _) | 89 | | (ast::Expr::RefExpr(_), _) |
89 | | (ast::Expr::Literal(_), _) | 90 | | (ast::Expr::Literal(_), _) |
90 | | (ast::Expr::TupleExpr(_), _) | 91 | | (ast::Expr::TupleExpr(_), _) |
91 | | (ast::Expr::ArrayExpr(_), _) | 92 | | (ast::Expr::ArrayExpr(_), _) |
92 | | (ast::Expr::ParenExpr(_), _) | 93 | | (ast::Expr::ParenExpr(_), _) |
93 | | (ast::Expr::PathExpr(_), _) | 94 | | (ast::Expr::PathExpr(_), _) |
94 | | (ast::Expr::BlockExpr(_), _) | 95 | | (ast::Expr::BlockExpr(_), _) |
95 | | (ast::Expr::EffectExpr(_), _) | 96 | | (ast::Expr::EffectExpr(_), _) |
96 | | (_, ast::Expr::CallExpr(_)) | 97 | | (_, ast::Expr::CallExpr(_)) |
97 | | (_, ast::Expr::TupleExpr(_)) | 98 | | (_, ast::Expr::TupleExpr(_)) |
98 | | (_, ast::Expr::ArrayExpr(_)) | 99 | | (_, ast::Expr::ArrayExpr(_)) |
99 | | (_, ast::Expr::ParenExpr(_)) | 100 | | (_, ast::Expr::ParenExpr(_)) |
100 | | (_, ast::Expr::ForExpr(_)) | 101 | | (_, ast::Expr::ForExpr(_)) |
101 | | (_, ast::Expr::WhileExpr(_)) | 102 | | (_, ast::Expr::WhileExpr(_)) |
102 | | (_, ast::Expr::BreakExpr(_)) | 103 | | (_, ast::Expr::BreakExpr(_)) |
103 | | (_, ast::Expr::ReturnExpr(_)) | 104 | | (_, ast::Expr::ReturnExpr(_)) |
104 | | (_, ast::Expr::MatchExpr(_)) | 105 | | (_, ast::Expr::MatchExpr(_)) |
105 | )) | 106 | )) |
106 | }) | 107 | }) |
107 | .collect::<Result<Vec<_>, _>>()?; | 108 | .collect::<Result<Vec<_>, _>>()?; |