Fuse multiple str::replace invocations into a single one

This commit is contained in:
Eduardo Sánchez Muñoz 2023-10-30 13:27:25 +01:00 committed by Amanieu d'Antras
parent 5cdd9f81ce
commit fd9370dd44

View file

@ -61,9 +61,7 @@ pub fn assert_instr(
}
let instr_str = instr
.replace('.', "_")
.replace('/', "_")
.replace(':', "_")
.replace(['.', '/', ':'], "_")
.replace(char::is_whitespace, "");
let assert_name = syn::Ident::new(&format!("assert_{name}_{instr_str}"), name.span());
// These name has to be unique enough for us to find it in the disassembly later on: