From fd9370dd44545ce0e459ebf35d746f0c1367fe7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduardo=20S=C3=A1nchez=20Mu=C3=B1oz?= Date: Mon, 30 Oct 2023 13:27:25 +0100 Subject: [PATCH] Fuse multiple `str::replace` invocations into a single one --- library/stdarch/crates/assert-instr-macro/src/lib.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/library/stdarch/crates/assert-instr-macro/src/lib.rs b/library/stdarch/crates/assert-instr-macro/src/lib.rs index c9de43943fd4..14912f0ca6a3 100644 --- a/library/stdarch/crates/assert-instr-macro/src/lib.rs +++ b/library/stdarch/crates/assert-instr-macro/src/lib.rs @@ -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: