about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEduardo Sánchez Muñoz <eduardosm-dev@e64.io>2023-10-30 13:27:25 +0100
committerAmanieu d'Antras <amanieu@gmail.com>2023-10-31 02:20:17 +0100
commitfd9370dd44545ce0e459ebf35d746f0c1367fe7b (patch)
tree83fbd4861da35813a67fe7ab52297d2ccdbb6ef3
parent5cdd9f81ce5203b5d78343026df3a3be809652c4 (diff)
downloadrust-fd9370dd44545ce0e459ebf35d746f0c1367fe7b.tar.gz
rust-fd9370dd44545ce0e459ebf35d746f0c1367fe7b.zip
Fuse multiple `str::replace` invocations into a single one
-rw-r--r--library/stdarch/crates/assert-instr-macro/src/lib.rs4
1 files changed, 1 insertions, 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 c9de43943fd..14912f0ca6a 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: