diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-01-15 14:48:21 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-01-15 14:48:21 +0000 |
commit | 0c58aa9dc0e24f0fa6a6ee7eb0c35041dedddb0a (patch) | |
tree | 863b6e41430b4d9f5c9dcebd443f4acdbe7e0193 /crates/assists/src/handlers | |
parent | d6a708b1eae170aee4a323ea6513bc4f2a1a5bbc (diff) | |
parent | 138514bea244253f2c0007976921f4475c9d2cd5 (diff) |
Merge #7209
7209: Support yield keyword r=Veykril a=sasurau4
Part of #4309
The inference of yield will be implemented at another PR.
Co-authored-by: Daiki Ihara <[email protected]>
Diffstat (limited to 'crates/assists/src/handlers')
-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<_>, _>>()?; |