Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit c534120

Browse files
committed
minor: address nit
1 parent 03c5dd1 commit c534120

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

crates/ide_completion/src/render/function.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,14 +228,17 @@ fn should_add_parens(ctx: &CompletionContext) -> bool {
228228
}
229229

230230
fn detail(db: &dyn HirDatabase, func: hir::Function) -> String {
231-
let ret_ty = func.async_ret_type(db).unwrap_or_else(|| func.ret_type(db));
231+
let mut ret_ty = func.ret_type(db);
232232
let mut detail = String::new();
233233

234234
if func.is_const(db) {
235235
format_to!(detail, "const ");
236236
}
237237
if func.is_async(db) {
238238
format_to!(detail, "async ");
239+
if let Some(async_ret) = func.async_ret_type(db) {
240+
ret_ty = async_ret;
241+
}
239242
}
240243
if func.is_unsafe_to_call(db) {
241244
format_to!(detail, "unsafe ");

0 commit comments

Comments
 (0)