Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-assists/src/handlers/unwrap_block.rs')
-rw-r--r--crates/ide-assists/src/handlers/unwrap_block.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/crates/ide-assists/src/handlers/unwrap_block.rs b/crates/ide-assists/src/handlers/unwrap_block.rs
index fd37140e9c..a83f6835ca 100644
--- a/crates/ide-assists/src/handlers/unwrap_block.rs
+++ b/crates/ide-assists/src/handlers/unwrap_block.rs
@@ -1,13 +1,13 @@
use syntax::{
+ AstNode, SyntaxKind, T, TextRange,
ast::{
self,
edit::{AstNodeEdit, IndentLevel},
make,
},
- AstNode, SyntaxKind, TextRange, T,
};
-use crate::{AssistContext, AssistId, AssistKind, Assists};
+use crate::{AssistContext, AssistId, Assists};
// Assist: unwrap_block
//
@@ -27,9 +27,8 @@ use crate::{AssistContext, AssistId, AssistKind, Assists};
// }
// ```
pub(crate) fn unwrap_block(acc: &mut Assists, ctx: &AssistContext<'_>) -> Option<()> {
- let assist_id = AssistId("unwrap_block", AssistKind::RefactorRewrite);
+ let assist_id = AssistId::refactor_rewrite("unwrap_block");
let assist_label = "Unwrap block";
-
let l_curly_token = ctx.find_token_syntax_at_offset(T!['{'])?;
let mut block = ast::BlockExpr::cast(l_curly_token.parent_ancestors().nth(1)?)?;
let target = block.syntax().text_range();