Unnamed repository; edit this file 'description' to name the repository.
-rw-r--r--crates/ide-assists/src/handlers/inline_call.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/crates/ide-assists/src/handlers/inline_call.rs b/crates/ide-assists/src/handlers/inline_call.rs
index 2eb7089b7c..7bbb921341 100644
--- a/crates/ide-assists/src/handlers/inline_call.rs
+++ b/crates/ide-assists/src/handlers/inline_call.rs
@@ -484,12 +484,10 @@ fn inline(
body = make::block_expr(let_stmts, Some(body.into())).clone_for_update();
}
} else if let Some(stmt_list) = body.stmt_list() {
- ted::insert_all(
- ted::Position::after(
- stmt_list.l_curly_token().expect("L_CURLY for StatementList is missing."),
- ),
- let_stmts.into_iter().map(|stmt| stmt.syntax().clone().into()).collect(),
- );
+ let position = stmt_list.l_curly_token().expect("L_CURLY for StatementList is missing.");
+ let_stmts.into_iter().rev().for_each(|let_stmt| {
+ ted::insert(ted::Position::after(position.clone()), let_stmt.syntax().clone());
+ });
}
let original_indentation = match node {