summaryrefslogtreecommitdiff
path: root/src/codegen/helpers.rs
diff options
context:
space:
mode:
authorNick Fitzgerald <fitzgen@gmail.com>2017-09-05 10:23:12 -0700
committerNick Fitzgerald <fitzgen@gmail.com>2017-09-07 10:52:31 -0700
commit04f020bd00cdbaacc0e206fa783f546f6dd57e44 (patch)
treed5a9a0161d0e859308951981b6a40f7918e4c0bf /src/codegen/helpers.rs
parent231bccbc9be95be1db53a26d759cba2bfa55e951 (diff)
Use the `quote!` macro for `link_name` attributes
The latest `rustfmt` has fixed the formatting bugs we were running into.
Diffstat (limited to 'src/codegen/helpers.rs')
-rw-r--r--src/codegen/helpers.rs9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/codegen/helpers.rs b/src/codegen/helpers.rs
index 822922cd..5136d787 100644
--- a/src/codegen/helpers.rs
+++ b/src/codegen/helpers.rs
@@ -45,12 +45,9 @@ pub mod attributes {
}
pub fn link_name(name: &str) -> quote::Tokens {
- // This is ridiculous, but rustfmt doesn't seem to be formatting
- // `link_name` attributes very well, so we jump through these formatting
- // hoops to make it work.
- let mut tokens = quote! {};
- tokens.append(format!(" #[link_name = \"{}\"]", name));
- tokens
+ quote! {
+ #[link_name = #name]
+ }
}
}