Skip to content

Commit a63fcd2

Browse files
authored
Skip rustfmt on the link_section part of the code too (#1281)
As the link section value can be short enough that `cargo-fmt` decides to put it on one line, when prettyplease puts it on two, in some cases.
1 parent 906e096 commit a63fcd2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

crates/rust/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -946,6 +946,10 @@ macro_rules! __export_{world_name}_impl {{
946946
section_suffix: &str,
947947
func_name: Option<&str>,
948948
) {
949+
// As above, disable rustfmt, as we use prettyplease.
950+
if self.opts.format {
951+
uwriteln!(self.src, "#[rustfmt::skip]");
952+
}
949953
self.src.push_str("\n#[cfg(target_arch = \"wasm32\")]\n");
950954

951955
// The custom section name here must start with "component-type" but

0 commit comments

Comments
 (0)