@@ -293,23 +293,25 @@ impl RustWasm {
293
293
cur. contents . push ( module) ;
294
294
}
295
295
296
- // Disable rustfmt. By default we already format the code
297
- // using prettyplease, so we don't want `cargo fmt` to create
298
- // extra diffs for users to deal with.
299
- if self . opts . format {
300
- uwriteln ! ( self . src, "#[rustfmt::skip]" ) ;
301
- }
302
-
303
- emit ( & mut self . src , map) ;
304
- fn emit ( me : & mut Source , module : Module ) {
296
+ emit ( & mut self . src , map, & self . opts , true ) ;
297
+ fn emit ( me : & mut Source , module : Module , opts : & Opts , toplevel : bool ) {
305
298
for ( name, submodule) in module. submodules {
306
- // Ignore dead-code warnings. If the bindings are only used
307
- // within a crate, and not exported to a different crate, some
308
- // parts may be unused, and that's ok.
309
- uwriteln ! ( me, "#[allow(dead_code)]" ) ;
299
+ if toplevel {
300
+ // Disable rustfmt. By default we already format the code
301
+ // using prettyplease, so we don't want `cargo fmt` to create
302
+ // extra diffs for users to deal with.
303
+ if opts. format {
304
+ uwriteln ! ( me, "#[rustfmt::skip]" ) ;
305
+ }
306
+
307
+ // Ignore dead-code and clippy warnings. If the bindings are
308
+ // only used within a crate, and not exported to a different
309
+ // crate, some parts may be unused, and that's ok.
310
+ uwriteln ! ( me, "#[allow(dead_code, clippy::all)]" ) ;
311
+ }
310
312
311
313
uwriteln ! ( me, "pub mod {name} {{" ) ;
312
- emit ( me, submodule) ;
314
+ emit ( me, submodule, opts , false ) ;
313
315
uwriteln ! ( me, "}}" ) ;
314
316
}
315
317
for submodule in module. contents {
0 commit comments