Remove redundant to_ident_string calls

This commit is contained in:
Michael Goulet
2025-01-27 01:21:40 +00:00
parent ac1c6c50f4
commit c08624d8d2
10 changed files with 14 additions and 18 deletions

View File

@@ -168,7 +168,7 @@ impl<'tcx> FunctionItemRefChecker<'_, 'tcx> {
s
}
};
let ident = self.tcx.item_name(fn_id).to_ident_string();
let ident = self.tcx.item_ident(fn_id);
let ty_params = fn_args.types().map(|ty| format!("{ty}"));
let const_params = fn_args.consts().map(|c| format!("{c}"));
let params = ty_params.chain(const_params).join(", ");
@@ -177,7 +177,7 @@ impl<'tcx> FunctionItemRefChecker<'_, 'tcx> {
let ret = if fn_sig.output().skip_binder().is_unit() { "" } else { " -> _" };
let sugg = format!(
"{} as {}{}fn({}{}){}",
if params.is_empty() { ident.clone() } else { format!("{ident}::<{params}>") },
if params.is_empty() { ident.to_string() } else { format!("{ident}::<{params}>") },
unsafety,
abi,
vec!["_"; num_args].join(", "),