summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <emilio@crisal.io>2019-12-11 03:14:19 +0100
committerEmilio Cobos Álvarez <emilio@crisal.io>2019-12-11 03:14:19 +0100
commitb3c3980d23f4031a72bdc52e299f2009fba7e0d5 (patch)
treebf018f64bf36f6bccf2a8fa277c335c22271d6dd
parent560354e4f1839be4911b1432e4307fef5a95eb96 (diff)
codegen: Minor cleanup after #1691.
-rw-r--r--src/codegen/mod.rs13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/codegen/mod.rs b/src/codegen/mod.rs
index b1612c70..ac68c20b 100644
--- a/src/codegen/mod.rs
+++ b/src/codegen/mod.rs
@@ -3612,22 +3612,21 @@ impl CodeGenerator for Function {
}
// Unfortunately this can't piggyback on the `attributes` list because
- // the #[link(wasm_import_module)] needs to happen before the `extern "C"` block.
- // it doesn't get picked up properly otherwise
+ // the #[link(wasm_import_module)] needs to happen before the `extern
+ // "C"` block. It doesn't get picked up properly otherwise
let wasm_link_attribute =
ctx.options().wasm_import_module_name.as_ref().map(|name| {
- quote! {
- #[link(wasm_import_module = #name)]
- }
+ quote! { #[link(wasm_import_module = #name)] }
});
let ident = ctx.rust_ident(canonical_name);
- let tokens = quote!(
+ let tokens = quote! {
#wasm_link_attribute
extern #abi {
#(#attributes)*
pub fn #ident ( #( #args ),* ) #ret;
- });
+ }
+ };
result.push(tokens);
}
}