minor: address nit

This commit is contained in:
iDawer 2022-04-14 21:16:25 +05:00
parent 03c5dd1252
commit c53412046f

View File

@ -228,7 +228,7 @@ fn should_add_parens(ctx: &CompletionContext) -> bool {
}
fn detail(db: &dyn HirDatabase, func: hir::Function) -> String {
let ret_ty = func.async_ret_type(db).unwrap_or_else(|| func.ret_type(db));
let mut ret_ty = func.ret_type(db);
let mut detail = String::new();
if func.is_const(db) {
@ -236,6 +236,9 @@ fn detail(db: &dyn HirDatabase, func: hir::Function) -> String {
}
if func.is_async(db) {
format_to!(detail, "async ");
if let Some(async_ret) = func.async_ret_type(db) {
ret_ty = async_ret;
}
}
if func.is_unsafe_to_call(db) {
format_to!(detail, "unsafe ");