From 78a6572616c9a041b955abe18d438f85efc0e5e5 Mon Sep 17 00:00:00 2001 From: jnyfah Date: Mon, 17 Mar 2025 16:48:46 +0100 Subject: [PATCH] some changes --- .../rust-analyzer/crates/ide/src/inlay_hints/closure_ret.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/tools/rust-analyzer/crates/ide/src/inlay_hints/closure_ret.rs b/src/tools/rust-analyzer/crates/ide/src/inlay_hints/closure_ret.rs index 03835ec1f4cf..22b8c722984c 100644 --- a/src/tools/rust-analyzer/crates/ide/src/inlay_hints/closure_ret.rs +++ b/src/tools/rust-analyzer/crates/ide/src/inlay_hints/closure_ret.rs @@ -61,10 +61,9 @@ pub(super) fn hints( if arrow.is_none() { " -> " } else { "" }, ) } else { - let body = closure.body()?; - let body_range = body.syntax().text_range(); - Some(config.lazy_text_edit(|| { + let body = closure.body(); + let body_range = body.expect("Closure must have a body").syntax().text_range(); let mut builder = TextEdit::builder(); let insert_pos = param_list.syntax().text_range().end();