We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 03c5dd1 commit c534120Copy full SHA for c534120
crates/ide_completion/src/render/function.rs
@@ -228,14 +228,17 @@ fn should_add_parens(ctx: &CompletionContext) -> bool {
228
}
229
230
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));
+ let mut ret_ty = func.ret_type(db);
232
let mut detail = String::new();
233
234
if func.is_const(db) {
235
format_to!(detail, "const ");
236
237
if func.is_async(db) {
238
format_to!(detail, "async ");
239
+ if let Some(async_ret) = func.async_ret_type(db) {
240
+ ret_ty = async_ret;
241
+ }
242
243
if func.is_unsafe_to_call(db) {
244
format_to!(detail, "unsafe ");
0 commit comments