compiler: replace ExternAbi::name calls with formatters
Most of these just format the ABI string, so... just format ExternAbi? This makes it more consistent and less jank when we can do it.
This commit is contained in:
@@ -161,12 +161,7 @@ impl<'tcx> FunctionItemRefChecker<'_, 'tcx> {
|
||||
let unsafety = fn_sig.safety().prefix_str();
|
||||
let abi = match fn_sig.abi() {
|
||||
ExternAbi::Rust => String::from(""),
|
||||
other_abi => {
|
||||
let mut s = String::from("extern \"");
|
||||
s.push_str(other_abi.name());
|
||||
s.push_str("\" ");
|
||||
s
|
||||
}
|
||||
other_abi => format!("extern {other_abi} "),
|
||||
};
|
||||
let ident = self.tcx.item_ident(fn_id);
|
||||
let ty_params = fn_args.types().map(|ty| format!("{ty}"));
|
||||
|
||||
Reference in New Issue
Block a user