remove edit_in_place from replace_let_with_if_let assist with edit::AstNodeEdit

This commit is contained in:
bit-aloo 2026-02-13 12:07:01 +05:30
parent b214aac14c
commit 3a202c4736
No known key found for this signature in database

View file

@ -1,7 +1,7 @@
use ide_db::ty_filter::TryEnum;
use syntax::{
AstNode, T,
ast::{self, edit::IndentLevel, edit_in_place::Indent, syntax_factory::SyntaxFactory},
ast::{self, edit::{AstNodeEdit, IndentLevel}, syntax_factory::SyntaxFactory},
};
use crate::{AssistContext, AssistId, Assists};
@ -64,7 +64,7 @@ pub(crate) fn replace_let_with_if_let(acc: &mut Assists, ctx: &AssistContext<'_>
if let_expr_needs_paren(&init) { make.expr_paren(init).into() } else { init };
let block = make.block_expr([], None);
block.indent(IndentLevel::from_node(let_stmt.syntax()));
let block = block.indent(IndentLevel::from_node(let_stmt.syntax()));
let if_expr = make.expr_if(
make.expr_let(pat, init_expr).into(),
block,