Give TypeInfo fields and methods more appropriate names

This commit is contained in:
Lukas Wirth 2021-08-03 17:28:51 +02:00
parent 8afa2722b2
commit b96f1adf5c
30 changed files with 76 additions and 74 deletions

View file

@ -153,7 +153,8 @@ impl FunctionBuilder {
// type, but that the current state of their code doesn't allow that return type
// to be accurately inferred.
let (ret_ty, should_render_snippet) = {
match ctx.sema.type_of_expr(&ast::Expr::CallExpr(call.clone())).map(TypeInfo::ty) {
match ctx.sema.type_of_expr(&ast::Expr::CallExpr(call.clone())).map(TypeInfo::original)
{
Some(ty) if ty.is_unknown() || ty.is_unit() => (make::ty_unit(), true),
Some(ty) => {
let rendered = ty.display_source_code(ctx.db(), target_module.into());
@ -331,7 +332,7 @@ fn fn_arg_type(
target_module: hir::Module,
fn_arg: &ast::Expr,
) -> Option<String> {
let ty = ctx.sema.type_of_expr(fn_arg)?.coerced();
let ty = ctx.sema.type_of_expr(fn_arg)?.adjusted();
if ty.is_unknown() {
return None;
}