diff options
| author | Eduardo Sánchez Muñoz <eduardosm-dev@e64.io> | 2023-10-30 13:27:25 +0100 |
|---|---|---|
| committer | Amanieu d'Antras <amanieu@gmail.com> | 2023-10-31 02:20:17 +0100 |
| commit | fd9370dd44545ce0e459ebf35d746f0c1367fe7b (patch) | |
| tree | 83fbd4861da35813a67fe7ab52297d2ccdbb6ef3 | |
| parent | 5cdd9f81ce5203b5d78343026df3a3be809652c4 (diff) | |
| download | rust-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.rs | 4 |
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: |
