Use identifiers in format!

This commit is contained in:
Stephen Chung
2022-08-11 19:01:23 +08:00
parent ceaf9fab1b
commit be448dfe4d
36 changed files with 164 additions and 206 deletions

View File

@@ -135,7 +135,7 @@ impl FuncInfo {
return if r == x {
typ.into()
} else {
format!("&mut {}", r).into()
format!("&mut {r}").into()
};
}
@@ -202,7 +202,7 @@ impl FuncInfo {
};
let result: std::borrow::Cow<str> = match seg.next() {
Some(typ) => {
format!("{}: {}", name, FuncInfo::format_type(typ, false)).into()
format!("{name}: {}", FuncInfo::format_type(typ, false)).into()
}
None => name.into(),
};
@@ -2016,12 +2016,11 @@ impl Module {
return Err(crate::ERR::ErrorMismatchDataType(
"".to_string(),
if fn_ptr.is_anonymous() {
format!("cannot export closure in variable {}", _name)
format!("cannot export closure in variable {_name}")
} else {
format!(
"cannot export function pointer to local function '{}' in variable {}",
fn_ptr.fn_name(),
_name
"cannot export function pointer to local function '{}' in variable {_name}",
fn_ptr.fn_name()
)
},
crate::Position::NONE,