diff options
Diffstat (limited to 'crates/ra_assists/src/assists/move_guard.rs')
-rw-r--r-- | crates/ra_assists/src/assists/move_guard.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/crates/ra_assists/src/assists/move_guard.rs b/crates/ra_assists/src/assists/move_guard.rs index 41a31e677..2b91ce7c4 100644 --- a/crates/ra_assists/src/assists/move_guard.rs +++ b/crates/ra_assists/src/assists/move_guard.rs | |||
@@ -1,4 +1,3 @@ | |||
1 | use hir::db::HirDatabase; | ||
2 | use ra_syntax::{ | 1 | use ra_syntax::{ |
3 | ast, | 2 | ast, |
4 | ast::{AstNode, AstToken, IfExpr, MatchArm}, | 3 | ast::{AstNode, AstToken, IfExpr, MatchArm}, |
@@ -32,7 +31,7 @@ use crate::{Assist, AssistCtx, AssistId}; | |||
32 | // } | 31 | // } |
33 | // } | 32 | // } |
34 | // ``` | 33 | // ``` |
35 | pub(crate) fn move_guard_to_arm_body(ctx: AssistCtx<impl HirDatabase>) -> Option<Assist> { | 34 | pub(crate) fn move_guard_to_arm_body(ctx: AssistCtx) -> Option<Assist> { |
36 | let match_arm = ctx.find_node_at_offset::<MatchArm>()?; | 35 | let match_arm = ctx.find_node_at_offset::<MatchArm>()?; |
37 | let guard = match_arm.guard()?; | 36 | let guard = match_arm.guard()?; |
38 | let space_before_guard = guard.syntax().prev_sibling_or_token(); | 37 | let space_before_guard = guard.syntax().prev_sibling_or_token(); |
@@ -89,7 +88,7 @@ pub(crate) fn move_guard_to_arm_body(ctx: AssistCtx<impl HirDatabase>) -> Option | |||
89 | // } | 88 | // } |
90 | // } | 89 | // } |
91 | // ``` | 90 | // ``` |
92 | pub(crate) fn move_arm_cond_to_match_guard(ctx: AssistCtx<impl HirDatabase>) -> Option<Assist> { | 91 | pub(crate) fn move_arm_cond_to_match_guard(ctx: AssistCtx) -> Option<Assist> { |
93 | let match_arm: MatchArm = ctx.find_node_at_offset::<MatchArm>()?; | 92 | let match_arm: MatchArm = ctx.find_node_at_offset::<MatchArm>()?; |
94 | let last_match_pat = match_arm.pats().last()?; | 93 | let last_match_pat = match_arm.pats().last()?; |
95 | 94 | ||