Clippy fixes (#2033)

* clippy fixed

* wasm clippy

* clippy fixes

* post clippy fmt

* last clippy fix
This commit is contained in:
puzzle-rusher
2025-07-05 00:21:31 +04:00
committed by GitHub
parent 1f57e8fd1a
commit e892802baf
14 changed files with 37 additions and 40 deletions
+4 -4
View File
@@ -57,20 +57,20 @@ fn generate_runtime_api(
// just be an underscore, so fix any such names we find to work in structs.
let mut name = input.name.trim_start_matches('_').to_string();
if name.is_empty() {
name = format!("_{}", idx);
name = format!("_{idx}");
}
while !unique_names.insert(name.clone()) {
// Name is already used, append the index until it is unique.
name = format!("{}_param{}", name, idx);
name = format!("{name}_param{idx}");
}
let mut alias = name.to_upper_camel_case();
// Note: name is not empty.
if alias.as_bytes()[0].is_ascii_digit() {
alias = format!("Param{}", alias);
alias = format!("Param{alias}");
}
while !unique_aliases.insert(alias.clone()) {
alias = format!("{}Param{}", alias, idx);
alias = format!("{alias}Param{idx}");
}
let (alias_name, name) = (format_ident!("{alias}"), format_ident!("{name}"));