aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists/src/assists/invert_if.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_assists/src/assists/invert_if.rs')
-rw-r--r--crates/ra_assists/src/assists/invert_if.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/crates/ra_assists/src/assists/invert_if.rs b/crates/ra_assists/src/assists/invert_if.rs
index 16352c040..694c3642c 100644
--- a/crates/ra_assists/src/assists/invert_if.rs
+++ b/crates/ra_assists/src/assists/invert_if.rs
@@ -1,4 +1,3 @@
1use hir::db::HirDatabase;
2use ra_syntax::ast::{self, AstNode}; 1use ra_syntax::ast::{self, AstNode};
3use ra_syntax::T; 2use ra_syntax::T;
4 3
@@ -23,7 +22,7 @@ use crate::{Assist, AssistCtx, AssistId};
23// } 22// }
24// ``` 23// ```
25 24
26pub(crate) fn invert_if(ctx: AssistCtx<impl HirDatabase>) -> Option<Assist> { 25pub(crate) fn invert_if(ctx: AssistCtx) -> Option<Assist> {
27 let if_keyword = ctx.find_token_at_offset(T![if])?; 26 let if_keyword = ctx.find_token_at_offset(T![if])?;
28 let expr = ast::IfExpr::cast(if_keyword.parent())?; 27 let expr = ast::IfExpr::cast(if_keyword.parent())?;
29 let if_range = if_keyword.text_range(); 28 let if_range = if_keyword.text_range();