Skip to content

Commit

Permalink
Ignore clippy warnings in generated code (#279)
Browse files Browse the repository at this point in the history
* fix(gen-rust-wasm): get rid of unused unit warning

* Revert "fix(gen-rust-wasm): get rid of unused unit warning"

This reverts commit c2f47bd.

* fix: clippy lint warning in generated code
  • Loading branch information
7sDream committed Jul 12, 2022
1 parent 2679e06 commit 128fd67
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions crates/gen-rust-wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,10 @@ impl Generator for RustWasm {
self.trait_name = iface.name.to_camel_case();

if !self.opts.standalone {
self.src
.push_str(&format!("mod {} {{\n", iface.name.to_snake_case()));
self.src.push_str(&format!(
"#[allow(clippy::all)]\nmod {} {{\n",
iface.name.to_snake_case(),
));
}

self.sizes.fill(iface);
Expand Down
6 changes: 4 additions & 2 deletions crates/gen-wasmtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,10 @@ impl Generator for Wasmtime {
self.types.analyze(iface);
self.in_import = variant == AbiVariant::GuestImport;
self.trait_name = iface.name.to_camel_case();
self.src
.push_str(&format!("pub mod {} {{\n", iface.name.to_snake_case()));
self.src.push_str(&format!(
"#[allow(clippy::all)]\npub mod {} {{\n",
iface.name.to_snake_case(),
));
self.src
.push_str("#[allow(unused_imports)]\nuse wit_bindgen_wasmtime::{wasmtime, anyhow};\n");
self.sizes.fill(iface);
Expand Down

0 comments on commit 128fd67

Please sign in to comment.