[INFO] fetching crate wasi_virt_layer-cli 0.1.1... [INFO] linting wasi_virt_layer-cli-0.1.1 against nightly for clippy-nonminimal_bool-denied [INFO] extracting crate wasi_virt_layer-cli 0.1.1 into /workspace/builds/worker-4-tc1/source [INFO] started tweaking crates.io crate wasi_virt_layer-cli 0.1.1 [INFO] removed 0 missing tests [INFO] finished tweaking crates.io crate wasi_virt_layer-cli 0.1.1 [INFO] tweaked toml for crates.io crate wasi_virt_layer-cli 0.1.1 written to /workspace/builds/worker-4-tc1/source/Cargo.toml [INFO] validating manifest of crates.io crate wasi_virt_layer-cli 0.1.1 on toolchain nightly [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] crate crates.io crate wasi_virt_layer-cli 0.1.1 already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Updating crates.io index [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded wasm-metadata v0.236.1 [INFO] [stderr] Downloaded wasm-opt-cxx-sys v0.116.0 [INFO] [stderr] Downloaded target-lexicon v0.13.3 [INFO] [stderr] Downloaded cranelift-bitset v0.123.2 [INFO] [stderr] Downloaded wasmtime-internal-component-util v36.0.2 [INFO] [stderr] Downloaded wasm-encoder v0.236.1 [INFO] [stderr] Downloaded assert_cmd v2.0.17 [INFO] [stderr] Downloaded cargo-util-schemas v0.8.2 [INFO] [stderr] Downloaded wasmprinter v0.236.1 [INFO] [stderr] Downloaded cargo_metadata v0.22.0 [INFO] [stderr] Downloaded clap v4.5.50 [INFO] [stderr] Downloaded cxxbridge-cmd v1.0.187 [INFO] [stderr] Downloaded cxx-build v1.0.187 [INFO] [stderr] Downloaded wit-parser v0.236.1 [INFO] [stderr] Downloaded clap_builder v4.5.50 [INFO] [stderr] Downloaded walrus v0.23.3 [INFO] [stderr] Downloaded wasmtime-environ v36.0.2 [INFO] [stderr] Downloaded wasmparser v0.240.0 [INFO] [stderr] Downloaded wasmparser v0.236.1 [INFO] [stderr] Downloaded wasmparser v0.214.0 [INFO] [stderr] Downloaded cxx v1.0.187 [INFO] [stderr] Downloaded wast v240.0.0 [INFO] [stderr] Downloaded wit-component v0.236.1 [INFO] [stderr] Downloaded wasm-encoder v0.240.0 [INFO] [stderr] Downloaded cxxbridge-macro v1.0.187 [INFO] [stderr] Downloaded console v0.16.1 [INFO] [stderr] Downloaded postcard v1.1.3 [INFO] [stderr] Downloaded wasm-encoder v0.214.0 [INFO] [stderr] Downloaded wasm-opt v0.116.1 [INFO] [stderr] Downloaded gimli v0.26.2 [INFO] [stderr] Downloaded codespan-reporting v0.13.1 [INFO] [stderr] Downloaded wit-bindgen-core v0.44.0 [INFO] [stderr] Downloaded wat v1.240.0 [INFO] [stderr] Downloaded gag v1.0.0 [INFO] [stderr] Downloaded cranelift-entity v0.123.2 [INFO] [stderr] Downloaded cobs v0.3.0 [INFO] [stderr] Downloaded cxxbridge-flags v1.0.187 [INFO] [stderr] Downloaded walrus-macro v0.22.0 [INFO] [stderr] Downloaded link-cplusplus v1.0.12 [INFO] [stderr] Downloaded wasm-opt-sys v0.116.0 [INFO] [stderr] Downloaded wasm-merge-sys v0.1.0 [INFO] [stderr] Downloaded walrus-simple-interpreter v0.2.3 [INFO] [stderr] Downloaded scratch v1.0.9 [INFO] [stderr] Downloaded js-component-bindgen v1.12.0 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] 9370f4c7511b9b54394b25b0f8e9ad17efcf0c0ed9f0d725266ca674c2dab29b [INFO] running `Command { std: "docker" "start" "-a" "9370f4c7511b9b54394b25b0f8e9ad17efcf0c0ed9f0d725266ca674c2dab29b", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "9370f4c7511b9b54394b25b0f8e9ad17efcf0c0ed9f0d725266ca674c2dab29b", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "9370f4c7511b9b54394b25b0f8e9ad17efcf0c0ed9f0d725266ca674c2dab29b", kill_on_drop: false }` [INFO] [stdout] 9370f4c7511b9b54394b25b0f8e9ad17efcf0c0ed9f0d725266ca674c2dab29b [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "clippy" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 6307cd28dec0fa5df0c9e59be437d9d32b08d6580612ac2e91042fd5bdaeda9b [INFO] running `Command { std: "docker" "start" "-a" "6307cd28dec0fa5df0c9e59be437d9d32b08d6580612ac2e91042fd5bdaeda9b", kill_on_drop: false }` [INFO] [stderr] Compiling unicode-ident v1.0.20 [INFO] [stderr] Compiling serde_core v1.0.228 [INFO] [stderr] Checking stable_deref_trait v1.2.1 [INFO] [stderr] Checking bitflags v2.10.0 [INFO] [stderr] Compiling wasmparser v0.236.1 [INFO] [stderr] Checking log v0.4.28 [INFO] [stderr] Checking leb128fmt v0.1.0 [INFO] [stderr] Compiling num-traits v0.2.19 [INFO] [stderr] Compiling crc32fast v1.5.0 [INFO] [stderr] Compiling serde_json v1.0.145 [INFO] [stderr] Checking aho-corasick v1.1.3 [INFO] [stderr] Checking winnow v0.7.13 [INFO] [stderr] Compiling wasm-encoder v0.240.0 [INFO] [stderr] Checking unicode-xid v0.2.6 [INFO] [stderr] Compiling wasm-encoder v0.236.1 [INFO] [stderr] Checking id-arena v2.2.1 [INFO] [stderr] Compiling proc-macro2 v1.0.101 [INFO] [stderr] Compiling object v0.37.3 [INFO] [stderr] Compiling indexmap v1.9.3 [INFO] [stderr] Compiling erased-serde v0.4.8 [INFO] [stderr] Checking ahash v0.8.12 [INFO] [stderr] Checking anstyle-query v1.1.4 [INFO] [stderr] Compiling rustversion v1.0.22 [INFO] [stderr] Checking is_terminal_polyfill v1.70.2 [INFO] [stderr] Compiling target-lexicon v0.13.3 [INFO] [stderr] Checking bumpalo v3.19.0 [INFO] [stderr] Checking percent-encoding v2.3.2 [INFO] [stderr] Checking termcolor v1.4.1 [INFO] [stderr] Checking anstream v0.6.21 [INFO] [stderr] Compiling quote v1.0.41 [INFO] [stderr] Checking form_urlencoded v1.2.2 [INFO] [stderr] Compiling camino v1.2.1 [INFO] [stderr] Checking fallible-iterator v0.2.0 [INFO] [stderr] Compiling owo-colors v4.2.3 [INFO] [stderr] Compiling syn v2.0.107 [INFO] [stderr] Compiling eyre v0.6.12 [INFO] [stderr] Checking wasm-encoder v0.214.0 [INFO] [stderr] Checking miniz_oxide v0.8.9 [INFO] [stderr] Checking rustix v1.1.2 [INFO] [stderr] Checking rustc-demangle v0.1.26 [INFO] [stderr] Checking clap_lex v0.7.6 [INFO] [stderr] Checking gimli v0.26.2 [INFO] [stderr] Checking wasmtime-internal-component-util v36.0.2 [INFO] [stderr] Checking indenter v0.3.4 [INFO] [stderr] Checking heck v0.5.0 [INFO] [stderr] Checking dirs-sys v0.5.0 [INFO] [stderr] Checking clap_builder v4.5.50 [INFO] [stderr] Checking toml_datetime v0.7.3 [INFO] [stderr] Checking predicates-core v1.0.9 [INFO] [stderr] Checking base64 v0.22.1 [INFO] [stderr] Compiling doc-comment v0.3.3 [INFO] [stderr] Checking ordered-float v2.10.1 [INFO] [stderr] Checking castaway v0.2.4 [INFO] [stderr] Checking jiff v0.2.15 [INFO] [stderr] Checking chrono v0.4.42 [INFO] [stderr] Checking compact_str v0.9.0 [INFO] [stderr] Checking wast v240.0.0 [INFO] [stderr] Checking dirs v6.0.0 [INFO] [stderr] Checking console v0.16.1 [INFO] [stderr] Checking itertools v0.14.0 [INFO] [stderr] Checking regex-automata v0.4.13 [INFO] [stderr] Compiling assert_cmd v2.0.17 [INFO] [stderr] Checking difflib v0.4.0 [INFO] [stderr] Checking termtree v0.5.1 [INFO] [stderr] Checking predicates-tree v1.0.12 [INFO] [stderr] Checking predicates v3.1.3 [INFO] [stderr] Checking wait-timeout v0.2.1 [INFO] [stderr] Checking tempfile v3.23.0 [INFO] [stderr] Checking indexmap v2.12.0 [INFO] [stderr] Checking semver v1.0.27 [INFO] [stderr] Checking toml_parser v1.0.4 [INFO] [stderr] Checking serde-untagged v0.1.9 [INFO] [stderr] Checking regex v1.12.2 [INFO] [stderr] Checking bstr v1.12.0 [INFO] [stderr] Checking gimli v0.32.3 [INFO] [stderr] Checking toml_edit v0.23.7 [INFO] [stderr] Checking env_filter v0.1.4 [INFO] [stderr] Checking env_logger v0.11.8 [INFO] [stderr] Compiling synstructure v0.13.2 [INFO] [stderr] Compiling serde_derive v1.0.228 [INFO] [stderr] Compiling zerovec-derive v0.11.1 [INFO] [stderr] Compiling displaydoc v0.2.5 [INFO] [stderr] Compiling thiserror-impl v2.0.17 [INFO] [stderr] Compiling thiserror-impl v1.0.69 [INFO] [stderr] Compiling walrus-macro v0.22.0 [INFO] [stderr] Compiling strum_macros v0.27.2 [INFO] [stderr] Compiling clap_derive v4.5.49 [INFO] [stderr] Compiling zerofrom-derive v0.1.6 [INFO] [stderr] Compiling yoke-derive v0.8.0 [INFO] [stderr] Checking addr2line v0.25.1 [INFO] [stderr] Checking wat v1.240.0 [INFO] [stderr] Checking thiserror v1.0.69 [INFO] [stderr] Checking filedescriptor v0.8.3 [INFO] [stderr] Checking zerofrom v0.1.6 [INFO] [stderr] Checking thiserror v2.0.17 [INFO] [stderr] Checking gag v1.0.0 [INFO] [stderr] Checking cobs v0.3.0 [INFO] [stderr] Checking yoke v0.8.0 [INFO] [stderr] Checking zerovec v0.11.4 [INFO] [stderr] Checking zerotrie v0.2.2 [INFO] [stderr] Checking clap v4.5.50 [INFO] [stderr] Checking tinystr v0.8.1 [INFO] [stderr] Checking potential_utf v0.1.3 [INFO] [stderr] Checking icu_locale_core v2.0.0 [INFO] [stderr] Checking icu_collections v2.0.0 [INFO] [stderr] Checking serde v1.0.228 [INFO] [stderr] Checking strum v0.27.2 [INFO] [stderr] Checking hashbrown v0.15.5 [INFO] [stderr] Checking smallvec v1.15.1 [INFO] [stderr] Checking toml_datetime v0.6.11 [INFO] [stderr] Checking serde_spanned v0.6.9 [INFO] [stderr] Checking hashbrown v0.14.5 [INFO] [stderr] Checking cranelift-bitset v0.123.2 [INFO] [stderr] Checking postcard v1.1.3 [INFO] [stderr] Checking serde-value v0.7.0 [INFO] [stderr] Checking cargo-platform v0.3.1 [INFO] [stderr] Checking icu_provider v2.0.0 [INFO] [stderr] Checking cranelift-entity v0.123.2 [INFO] [stderr] Checking toml_edit v0.22.27 [INFO] [stderr] Checking icu_properties v2.0.1 [INFO] [stderr] Checking icu_normalizer v2.0.0 [INFO] [stderr] Checking wasmparser v0.214.0 [INFO] [stderr] Checking idna_adapter v1.2.1 [INFO] [stderr] Checking idna v1.1.0 [INFO] [stderr] Checking url v2.5.7 [INFO] [stderr] Checking toml v0.8.23 [INFO] [stderr] Checking cargo-util-schemas v0.8.2 [INFO] [stderr] Checking cargo_metadata v0.22.0 [INFO] [stderr] Checking backtrace v0.3.76 [INFO] [stderr] Checking color-eyre v0.6.5 [INFO] [stderr] Checking wit-parser v0.236.1 [INFO] [stderr] Checking wasmprinter v0.236.1 [INFO] [stderr] Checking walrus v0.23.3 [INFO] [stderr] Checking wasm-metadata v0.236.1 [INFO] [stderr] Checking wasmtime-environ v36.0.2 [INFO] [stderr] Checking wit-component v0.236.1 [INFO] [stderr] Checking wit-bindgen-core v0.44.0 [INFO] [stderr] Checking walrus-simple-interpreter v0.2.3 [INFO] [stderr] Checking js-component-bindgen v1.12.0 [INFO] [stderr] Checking wasi_virt_layer-cli v0.1.1 (/opt/rustwide/workdir) [INFO] [stdout] warning: unused import: `command` [INFO] [stdout] --> src/args.rs:4:20 [INFO] [stdout] | [INFO] [stdout] 4 | use clap::{Parser, command}; [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit expression [INFO] [stdout] --> src/fallback_command.rs:171:13 [INFO] [stdout] | [INFO] [stdout] 171 | () [INFO] [stdout] | ^^ help: remove the final `()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stdout] = note: `#[warn(clippy::unused_unit)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `WalrusUtilExport as _` and `WalrusUtilImport as _` [INFO] [stdout] --> src/generator/special_func.rs:8:48 [INFO] [stdout] | [INFO] [stdout] 8 | NAMESPACE, ResultUtil as _, WalrusFID, WalrusUtilExport as _, WalrusUtilFuncs as _, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] 9 | WalrusUtilImport as _, WalrusUtilModule as _, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `command` [INFO] [stdout] --> src/args.rs:4:20 [INFO] [stdout] | [INFO] [stdout] 4 | use clap::{Parser, command}; [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit expression [INFO] [stdout] --> src/fallback_command.rs:171:13 [INFO] [stdout] | [INFO] [stdout] 171 | () [INFO] [stdout] | ^^ help: remove the final `()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stdout] = note: `#[warn(clippy::unused_unit)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `WalrusUtilExport as _` and `WalrusUtilImport as _` [INFO] [stdout] --> src/generator/special_func.rs:8:48 [INFO] [stdout] | [INFO] [stdout] 8 | NAMESPACE, ResultUtil as _, WalrusFID, WalrusUtilExport as _, WalrusUtilFuncs as _, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] 9 | WalrusUtilImport as _, WalrusUtilModule as _, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `import_id` [INFO] [stdout] --> src/generator/abi_connect.rs:82:29 [INFO] [stdout] | [INFO] [stdout] 82 | if let Some(import_id) = ("wasi_snapshot_preview1", import) [INFO] [stdout] | ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_import_id` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `real_thread_spawn_fn_id` [INFO] [stdout] --> src/generator/threads.rs:123:17 [INFO] [stdout] | [INFO] [stdout] 123 | let real_thread_spawn_fn_id = (root, &component_name).get_fid(&module.imports)?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_real_thread_spawn_fn_id` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `import_id` [INFO] [stdout] --> src/generator/abi_connect.rs:82:29 [INFO] [stdout] | [INFO] [stdout] 82 | if let Some(import_id) = ("wasi_snapshot_preview1", import) [INFO] [stdout] | ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_import_id` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `threads` [INFO] [stdout] --> src/generator/mod.rs:1537:5 [INFO] [stdout] | [INFO] [stdout] 1537 | threads: bool, [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_threads` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `real_thread_spawn_fn_id` [INFO] [stdout] --> src/generator/threads.rs:123:17 [INFO] [stdout] | [INFO] [stdout] 123 | let real_thread_spawn_fn_id = (root, &component_name).get_fid(&module.imports)?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_real_thread_spawn_fn_id` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `threads` [INFO] [stdout] --> src/generator/mod.rs:1537:5 [INFO] [stdout] | [INFO] [stdout] 1537 | threads: bool, [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_threads` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `format!` in `error!` args [INFO] [stdout] --> src/abi.rs:40:13 [INFO] [stdout] | [INFO] [stdout] 40 | / log::error!( [INFO] [stdout] 41 | | "Extra imports remain. You must use the `{name}!` macro plugger to export these functions: {}{}", [INFO] [stdout] 42 | | variants.iter().map(|v| v.to_string()).collect::>().join(", "), [INFO] [stdout] 43 | | format!("\nExtra message: {}", name.get_message().unwrap_or("")) [INFO] [stdout] 44 | | ); [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: combine the `format!(..)` arguments with the outer `error!(..)` call [INFO] [stdout] = help: or consider changing `format!` to `format_args!` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_in_format_args [INFO] [stdout] = note: `#[warn(clippy::format_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Iterator::find` [INFO] [stdout] --> src/abi.rs:160:13 [INFO] [stdout] | [INFO] [stdout] 160 | / for plugger in Self::iter() { [INFO] [stdout] 161 | | if plugger.variants().contains(func) { [INFO] [stdout] 162 | | return Some(plugger); [INFO] [stdout] ... | [INFO] [stdout] 165 | | None [INFO] [stdout] | |________________^ help: replace with an iterator: `Self::iter().find(|&plugger| plugger.variants().contains(func))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_find [INFO] [stdout] = note: `#[warn(clippy::manual_find)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: doc list item overindented [INFO] [stdout] --> src/args.rs:29:9 [INFO] [stdout] | [INFO] [stdout] 29 | /// You can translate component to js directly. [INFO] [stdout] | ^^^^^ help: try using ` ` (3 spaces) [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items [INFO] [stdout] = note: `#[warn(clippy::doc_overindented_list_items)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/args.rs:103:29 [INFO] [stdout] | [INFO] [stdout] 103 | .unwrap_or_else(|| WasmPath::with_maybe_none()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `WasmPath::with_maybe_none` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enclosing `Ok` and `?` operator are unneeded [INFO] [stdout] --> src/compile.rs:291:5 [INFO] [stdout] | [INFO] [stdout] 291 | / Ok(ret.wrap_err( [INFO] [stdout] 292 | | r#" [INFO] [stdout] 293 | | Failed to find Wasm file on build artifact. If you set ` [INFO] [stdout] 294 | | [lib] [INFO] [stdout] ... | [INFO] [stdout] 298 | | .trim(), [INFO] [stdout] 299 | | )?) [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark [INFO] [stdout] = note: `#[warn(clippy::needless_question_mark)]` on by default [INFO] [stdout] help: remove the enclosing `Ok` and `?` operator [INFO] [stdout] | [INFO] [stdout] 291 ~ ret.wrap_err( [INFO] [stdout] 292 | r#" [INFO] [stdout] ... [INFO] [stdout] 298 | .trim(), [INFO] [stdout] 299 ~ ) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/compile.rs:73:23 [INFO] [stdout] | [INFO] [stdout] 73 | args.push(&manifest_path); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `manifest_path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/compile.rs:141:13 [INFO] [stdout] | [INFO] [stdout] 141 | if let Some(line) = msg_receiver.try_recv().ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] = note: `#[warn(clippy::match_result_ok)]` on by default [INFO] [stdout] help: consider matching on `Ok(line)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 141 - if let Some(line) = msg_receiver.try_recv().ok() { [INFO] [stdout] 141 + if let Ok(line) = msg_receiver.try_recv() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/compile.rs:158:25 [INFO] [stdout] | [INFO] [stdout] 158 | return Ok(false); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 158 - return Ok(false); [INFO] [stdout] 158 + Ok(false) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/compile.rs:212:13 [INFO] [stdout] | [INFO] [stdout] 212 | if let Some(message) = parse_receiver.try_recv().ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] help: consider matching on `Ok(message)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 212 - if let Some(message) = parse_receiver.try_recv().ok() { [INFO] [stdout] 212 + if let Ok(message) = parse_receiver.try_recv() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/compile.rs:215:25 [INFO] [stdout] | [INFO] [stdout] 215 | / if building_crate.id == artifact.package_id { [INFO] [stdout] ... | [INFO] [stdout] 234 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 214 ~ cargo_metadata::Message::CompilerArtifact(artifact) [INFO] [stdout] 215 ~ if building_crate.id == artifact.package_id => { [INFO] [stdout] 216 | // let mut file = std::fs::OpenOptions::new() [INFO] [stdout] ... [INFO] [stdout] 233 | } [INFO] [stdout] 234 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead [INFO] [stdout] --> src/compile.rs:225:49 [INFO] [stdout] | [INFO] [stdout] 225 | ... if let Some(wasm) = artifact [INFO] [stdout] | ___________________________________________^ [INFO] [stdout] 226 | | ... .filenames [INFO] [stdout] 227 | | ... .iter() [INFO] [stdout] 228 | | ... .filter(|f| f.extension() == Some("wasm")) [INFO] [stdout] 229 | | ... .next() [INFO] [stdout] | |_________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next [INFO] [stdout] = note: `#[warn(clippy::filter_next)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 225 ~ if let Some(wasm) = artifact [INFO] [stdout] 226 + .filenames [INFO] [stdout] 227 + .iter().find(|f| f.extension() == Some("wasm")) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `contains()` instead of `iter().any()` is more efficient [INFO] [stdout] --> src/compile.rs:323:25 [INFO] [stdout] | [INFO] [stdout] 323 | / workspace [INFO] [stdout] 324 | | .iter() [INFO] [stdout] 325 | | .any(|workspace_package| package.id == *workspace_package) [INFO] [stdout] | |______________________________________________________________________________________^ help: try: `workspace.contains(&package.id)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_contains [INFO] [stdout] = note: `#[warn(clippy::manual_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `TomlRestorers` [INFO] [stdout] --> src/config_checker.rs:18:5 [INFO] [stdout] | [INFO] [stdout] 18 | / pub fn new() -> Self { [INFO] [stdout] 19 | | Self(Vec::new()) [INFO] [stdout] 20 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 17 + impl Default for TomlRestorers { [INFO] [stdout] 18 + fn default() -> Self { [INFO] [stdout] 19 + Self::new() [INFO] [stdout] 20 + } [INFO] [stdout] 21 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/config_checker.rs:54:44 [INFO] [stdout] | [INFO] [stdout] 54 | let file_data = fs::read_to_string(&path).wrap_err("Failed to read manifest file")?; [INFO] [stdout] | ^^^^^ help: change this to: `path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/config_checker.rs:55:19 [INFO] [stdout] | [INFO] [stdout] 55 | fs::write(&path, &changed).wrap_err("Failed to write manifest file")?; [INFO] [stdout] | ^^^^^ help: change this to: `path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/config_checker.rs:150:35 [INFO] [stdout] | [INFO] [stdout] 150 | Item::Table(table) => table.get("features").map_or(false, |v| { [INFO] [stdout] | ___________________________________^ [INFO] [stdout] 151 | | v.as_array() [INFO] [stdout] 152 | | .map(|arr| arr.iter().any(|s| s.as_str() == Some(feature))) [INFO] [stdout] 153 | | .unwrap_or(false) [INFO] [stdout] 154 | | }), [INFO] [stdout] | |______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] = note: `#[warn(clippy::unnecessary_map_or)]` on by default [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 150 - Item::Table(table) => table.get("features").map_or(false, |v| { [INFO] [stdout] 150 + Item::Table(table) => table.get("features").is_some_and(|v| { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/config_checker.rs:156:17 [INFO] [stdout] | [INFO] [stdout] 156 | / inline.get("features").map_or(false, |v| { [INFO] [stdout] 157 | | v.as_array() [INFO] [stdout] 158 | | .map(|arr| arr.iter().any(|s| s.as_str() == Some(feature))) [INFO] [stdout] 159 | | .unwrap_or(false) [INFO] [stdout] 160 | | }) [INFO] [stdout] | |__________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 156 - inline.get("features").map_or(false, |v| { [INFO] [stdout] 156 + inline.get("features").is_some_and(|v| { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/config_checker.rs:168:32 [INFO] [stdout] | [INFO] [stdout] 168 | fs::read_to_string(&self.manifest_path).wrap_err("Failed to read manifest file")?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: change this to: `self.manifest_path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/config_checker.rs:178:44 [INFO] [stdout] | [INFO] [stdout] 178 | let file_data = fs::read_to_string(&self.root_manifest_path) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `self.root_manifest_path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/config_checker.rs:197:12 [INFO] [stdout] | [INFO] [stdout] 197 | if doc [INFO] [stdout] | ____________^ [INFO] [stdout] 198 | | .get("dependencies") [INFO] [stdout] 199 | | .map_or(true, |inner| inner.is_none()) [INFO] [stdout] | |__________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_none_or` instead [INFO] [stdout] | [INFO] [stdout] 199 - .map_or(true, |inner| inner.is_none()) [INFO] [stdout] 199 + .is_none_or(|inner| inner.is_none()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/config_checker.rs:204:12 [INFO] [stdout] | [INFO] [stdout] 204 | if doc["dependencies"] [INFO] [stdout] | ____________^ [INFO] [stdout] 205 | | .get(crate_name) [INFO] [stdout] 206 | | .map_or(true, |inner| inner.is_none()) [INFO] [stdout] | |__________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_none_or` instead [INFO] [stdout] | [INFO] [stdout] 206 - .map_or(true, |inner| inner.is_none()) [INFO] [stdout] 206 + .is_none_or(|inner| inner.is_none()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_none()` [INFO] [stdout] --> src/config_checker.rs:237:16 [INFO] [stdout] | [INFO] [stdout] 237 | if matches!(table.get("features"), None) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `table.get("features").is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_none()` [INFO] [stdout] --> src/config_checker.rs:251:16 [INFO] [stdout] | [INFO] [stdout] 251 | if matches!(table.get("features"), None) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `table.get("features").is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/config_checker.rs:311:42 [INFO] [stdout] | [INFO] [stdout] 311 | Ok(Some(TomlRestorer::with_write(&path, data.to_string())?)) [INFO] [stdout] | ^^^^^ help: change this to: `path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/config_checker.rs:356:9 [INFO] [stdout] | [INFO] [stdout] 356 | return TomlRestorer::with_write(&self.manifest_path, doc.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 356 - return TomlRestorer::with_write(&self.manifest_path, doc.to_string()); [INFO] [stdout] 356 + TomlRestorer::with_write(&self.manifest_path, doc.to_string()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/config_checker.rs:351:45 [INFO] [stdout] | [INFO] [stdout] 351 | return TomlRestorer::with_write(&self.root_manifest_path, doc.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `self.root_manifest_path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/config_checker.rs:356:41 [INFO] [stdout] | [INFO] [stdout] 356 | return TomlRestorer::with_write(&self.manifest_path, doc.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: change this to: `self.manifest_path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: passing a unit value to a function [INFO] [stdout] --> src/fallback_command.rs:170:9 [INFO] [stdout] | [INFO] [stdout] 170 | / Some(if buf.contains(WHITE_SPACE) { [INFO] [stdout] 171 | | () [INFO] [stdout] 172 | | } else { [INFO] [stdout] 173 | | return None; [INFO] [stdout] 174 | | }) [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unit_arg [INFO] [stdout] = note: `#[warn(clippy::unit_arg)]` on by default [INFO] [stdout] help: move the expression in front of the call and replace it with the unit literal `()` [INFO] [stdout] | [INFO] [stdout] 170 ~ let _: () = if buf.contains(WHITE_SPACE) { [INFO] [stdout] 171 + () [INFO] [stdout] 172 + } else { [INFO] [stdout] 173 + return None; [INFO] [stdout] 174 + }; [INFO] [stdout] 175 + Some(()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/generator/abi_connect.rs:26:13 [INFO] [stdout] | [INFO] [stdout] 26 | / if let Some(import_id) = ( [INFO] [stdout] 27 | | // CORE_MODULE_ROOT, [INFO] [stdout] 28 | | // &format!("[static]wasip1.{}-import", import.replace("_", "-")), [INFO] [stdout] 29 | | "wasi_snapshot_preview1", [INFO] [stdout] ... | [INFO] [stdout] 32 | | .get_fid(&module.imports) [INFO] [stdout] 33 | | .ok() [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] help: consider matching on `Ok(import_id)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 26 ~ if let Ok(import_id) = ( [INFO] [stdout] 27 + // CORE_MODULE_ROOT, [INFO] [stdout] 28 + // &format!("[static]wasip1.{}-import", import.replace("_", "-")), [INFO] [stdout] 29 + "wasi_snapshot_preview1", [INFO] [stdout] 30 + import, [INFO] [stdout] 31 + ) [INFO] [stdout] 32 + .get_fid(&module.imports) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/generator/abi_connect.rs:35:24 [INFO] [stdout] | [INFO] [stdout] 35 | if let Some(_) = export { [INFO] [stdout] | -------^^^^^^^--------- help: try: `if export.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/generator/abi_connect.rs:45:24 [INFO] [stdout] | [INFO] [stdout] 45 | if let Some(_) = export { [INFO] [stdout] | -------^^^^^^^--------- help: try: `if export.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/generator/abi_connect.rs:82:17 [INFO] [stdout] | [INFO] [stdout] 82 | / if let Some(import_id) = ("wasi_snapshot_preview1", import) [INFO] [stdout] 83 | | .get_fid(&module.imports) [INFO] [stdout] 84 | | .ok() [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] help: consider matching on `Ok(import_id)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 82 ~ if let Ok(import_id) = ("wasi_snapshot_preview1", import) [INFO] [stdout] 83 + .get_fid(&module.imports) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/generator/abi_connect.rs:121:25 [INFO] [stdout] | [INFO] [stdout] 121 | &format!("__wasip1_vfs_wasi_thread_start_{wasm}"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("__wasip1_vfs_wasi_thread_start_{wasm}")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/generator/abi_connect.rs:132:25 [INFO] [stdout] | [INFO] [stdout] 132 | &format!("__wasip1_vfs_wasi_thread_spawn_{wasm}"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("__wasip1_vfs_wasi_thread_spawn_{wasm}")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/generator/abi_connect.rs:154:13 [INFO] [stdout] | [INFO] [stdout] 154 | / if let Some(fid) = ("non_recursive_wasi_snapshot_preview1", import) [INFO] [stdout] 155 | | .get_fid(&module.imports) [INFO] [stdout] 156 | | .ok() [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] help: consider matching on `Ok(fid)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 154 ~ if let Ok(fid) = ("non_recursive_wasi_snapshot_preview1", import) [INFO] [stdout] 155 + .get_fid(&module.imports) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/generator/abi_connect.rs:159:17 [INFO] [stdout] | [INFO] [stdout] 159 | / if let Some(import_id) = ("wasi_snapshot_preview1", import) [INFO] [stdout] 160 | | .get_fid(&module.imports) [INFO] [stdout] 161 | | .ok() [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] help: consider matching on `Ok(import_id)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 159 ~ if let Ok(import_id) = ("wasi_snapshot_preview1", import) [INFO] [stdout] 160 + .get_fid(&module.imports) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/generator/check.rs:51:52 [INFO] [stdout] | [INFO] [stdout] 51 | .map(|s| (strsim::jaro_winkler(&s, wasm_name.as_ref()), s)) [INFO] [stdout] | ^^ help: change this to: `s` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `filter_map` with an identity function [INFO] [stdout] --> src/generator/debug.rs:66:18 [INFO] [stdout] | [INFO] [stdout] 66 | .filter_map(|v| v) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_map_identity [INFO] [stdout] = note: `#[warn(clippy::filter_map_identity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `filter_map` with an identity function [INFO] [stdout] --> src/generator/debug.rs:379:34 [INFO] [stdout] | [INFO] [stdout] 379 | ... .filter_map(|v| v) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_map_identity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `format!` in `error!` args [INFO] [stdout] --> src/abi.rs:40:13 [INFO] [stdout] | [INFO] [stdout] 40 | / log::error!( [INFO] [stdout] 41 | | "Extra imports remain. You must use the `{name}!` macro plugger to export these functions: {}{}", [INFO] [stdout] 42 | | variants.iter().map(|v| v.to_string()).collect::>().join(", "), [INFO] [stdout] 43 | | format!("\nExtra message: {}", name.get_message().unwrap_or("")) [INFO] [stdout] 44 | | ); [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: combine the `format!(..)` arguments with the outer `error!(..)` call [INFO] [stdout] = help: or consider changing `format!` to `format_args!` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_in_format_args [INFO] [stdout] = note: `#[warn(clippy::format_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/generator/debug.rs:606:9 [INFO] [stdout] | [INFO] [stdout] 606 | if let Some(id) = "debug_wasip1_vfs_pre_init".get_fid(&module.exports).ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] help: consider matching on `Ok(id)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 606 - if let Some(id) = "debug_wasip1_vfs_pre_init".get_fid(&module.exports).ok() { [INFO] [stdout] 606 + if let Ok(id) = "debug_wasip1_vfs_pre_init".get_fid(&module.exports) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: direct implementation of `ToString` [INFO] [stdout] --> src/generator/memory.rs:106:1 [INFO] [stdout] | [INFO] [stdout] 106 | / impl ToString for HadSharedAndImported { [INFO] [stdout] 107 | | fn to_string(&self) -> String { [INFO] [stdout] 108 | | let n = self.had_shared as u8 [INFO] [stdout] 109 | | | (self.had_imported as u8) << 1 [INFO] [stdout] ... | [INFO] [stdout] 113 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: prefer implementing `Display` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl [INFO] [stdout] = note: `#[warn(clippy::to_string_trait_impl)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Iterator::find` [INFO] [stdout] --> src/abi.rs:160:13 [INFO] [stdout] | [INFO] [stdout] 160 | / for plugger in Self::iter() { [INFO] [stdout] 161 | | if plugger.variants().contains(func) { [INFO] [stdout] 162 | | return Some(plugger); [INFO] [stdout] ... | [INFO] [stdout] 165 | | None [INFO] [stdout] | |________________^ help: replace with an iterator: `Self::iter().find(|&plugger| plugger.variants().contains(func))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_find [INFO] [stdout] = note: `#[warn(clippy::manual_find)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/generator/memory.rs:328:13 [INFO] [stdout] | [INFO] [stdout] 328 | / if let Some(id) = (NAMESPACE, &with_name(wasm, "memory_copy_from")) [INFO] [stdout] 329 | | .get_fid(&module.imports) [INFO] [stdout] 330 | | .ok() [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] help: consider matching on `Ok(id)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 328 ~ if let Ok(id) = (NAMESPACE, &with_name(wasm, "memory_copy_from")) [INFO] [stdout] 329 + .get_fid(&module.imports) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/generator/memory.rs:353:13 [INFO] [stdout] | [INFO] [stdout] 353 | / if let Some(id) = (NAMESPACE, &with_name(wasm, "memory_copy_to")) [INFO] [stdout] 354 | | .get_fid(&module.imports) [INFO] [stdout] 355 | | .ok() [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] help: consider matching on `Ok(id)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 353 ~ if let Ok(id) = (NAMESPACE, &with_name(wasm, "memory_copy_to")) [INFO] [stdout] 354 + .get_fid(&module.imports) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: doc list item overindented [INFO] [stdout] --> src/args.rs:29:9 [INFO] [stdout] | [INFO] [stdout] 29 | /// You can translate component to js directly. [INFO] [stdout] | ^^^^^ help: try using ` ` (3 spaces) [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items [INFO] [stdout] = note: `#[warn(clippy::doc_overindented_list_items)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/generator/memory.rs:406:13 [INFO] [stdout] | [INFO] [stdout] 406 | / if let Some(id) = (NAMESPACE, &with_name(wasm, "memory_trap")) [INFO] [stdout] 407 | | .get_fid(&module.imports) [INFO] [stdout] 408 | | .ok() [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] help: consider matching on `Ok(id)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 406 ~ if let Ok(id) = (NAMESPACE, &with_name(wasm, "memory_trap")) [INFO] [stdout] 407 + .get_fid(&module.imports) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/generator/memory.rs:497:13 [INFO] [stdout] | [INFO] [stdout] 497 | / if let Some(id) = (NAMESPACE, &format!("__wasip1_vfs_{wasm}_memory_director")) [INFO] [stdout] 498 | | .get_fid(&module.imports) [INFO] [stdout] 499 | | .ok() [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] help: consider matching on `Ok(id)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 497 ~ if let Ok(id) = (NAMESPACE, &format!("__wasip1_vfs_{wasm}_memory_director")) [INFO] [stdout] 498 + .get_fid(&module.imports) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `filter_map` with an identity function [INFO] [stdout] --> src/generator/shared_global.rs:78:14 [INFO] [stdout] | [INFO] [stdout] 78 | .filter_map(|v| v) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_map_identity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary map of the identity function [INFO] [stdout] --> src/generator/shared_global.rs:132:20 [INFO] [stdout] | [INFO] [stdout] 132 | .last() [INFO] [stdout] | ____________________^ [INFO] [stdout] 133 | | .map(|g| g) [INFO] [stdout] | |_______________________^ help: remove the call to `map` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_identity [INFO] [stdout] = note: `#[warn(clippy::map_identity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/args.rs:103:29 [INFO] [stdout] | [INFO] [stdout] 103 | .unwrap_or_else(|| WasmPath::with_maybe_none()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `WasmPath::with_maybe_none` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/generator/shared_global.rs:327:17 [INFO] [stdout] | [INFO] [stdout] 327 | / if let Instr::Call(Call { func }) = instr { [INFO] [stdout] 328 | | if *func == alt_id { [INFO] [stdout] 329 | | *instr = Instr::MemoryGrow(MemoryGrow { memory: mem_id }); [INFO] [stdout] 330 | | } [INFO] [stdout] 331 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 327 ~ if let Instr::Call(Call { func }) = instr [INFO] [stdout] 328 ~ && *func == alt_id { [INFO] [stdout] 329 | *instr = Instr::MemoryGrow(MemoryGrow { memory: mem_id }); [INFO] [stdout] 330 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/generator/shared_global.rs:359:21 [INFO] [stdout] | [INFO] [stdout] 359 | / if let Instr::Call(Call { func }) = instr { [INFO] [stdout] 360 | | if *func == alt_id { [INFO] [stdout] 361 | | *instr = Instr::MemoryGrow(MemoryGrow { memory: mem_id }); [INFO] [stdout] 362 | | } [INFO] [stdout] 363 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 359 ~ if let Instr::Call(Call { func }) = instr [INFO] [stdout] 360 ~ && *func == alt_id { [INFO] [stdout] 361 | *instr = Instr::MemoryGrow(MemoryGrow { memory: mem_id }); [INFO] [stdout] 362 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/generator/special_func.rs:86:13 [INFO] [stdout] | [INFO] [stdout] 86 | if let Some(reset) = (NAMESPACE, &reset_name).get_fid(&module.imports).ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] help: consider matching on `Ok(reset)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 86 - if let Some(reset) = (NAMESPACE, &reset_name).get_fid(&module.imports).ok() { [INFO] [stdout] 86 + if let Ok(reset) = (NAMESPACE, &reset_name).get_fid(&module.imports) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Value` which implements the `Copy` trait [INFO] [stdout] --> src/generator/special_func.rs:94:39 [INFO] [stdout] | [INFO] [stdout] 94 | Some((g.id(), v.clone())) [INFO] [stdout] | ^^^^^^^^^ help: try removing the `clone` call: `v` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Option>` which implements the `Copy` trait [INFO] [stdout] --> src/generator/special_func.rs:242:25 [INFO] [stdout] | [INFO] [stdout] 242 | let old_start = module.start.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `module.start` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/generator/special_func.rs:258:9 [INFO] [stdout] | [INFO] [stdout] 258 | / if let Some(start) = old_start { [INFO] [stdout] 259 | | if ctx.unstable_print_debug { [INFO] [stdout] 260 | | module.exports.add("__wasip1_vfs_start_init_old", start); [INFO] [stdout] 261 | | } [INFO] [stdout] 262 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 258 ~ if let Some(start) = old_start [INFO] [stdout] 259 ~ && ctx.unstable_print_debug { [INFO] [stdout] 260 | module.exports.add("__wasip1_vfs_start_init_old", start); [INFO] [stdout] 261 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/generator/special_func.rs:274:17 [INFO] [stdout] | [INFO] [stdout] 274 | / match &mut func.kind { [INFO] [stdout] 275 | | walrus::FunctionKind::Local(l) => { [INFO] [stdout] 276 | | l.builder_mut() [INFO] [stdout] 277 | | .func_body() [INFO] [stdout] ... | [INFO] [stdout] 280 | | _ => {} [INFO] [stdout] 281 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 274 ~ if let walrus::FunctionKind::Local(l) = &mut func.kind { [INFO] [stdout] 275 + l.builder_mut() [INFO] [stdout] 276 + .func_body() [INFO] [stdout] 277 + .retain(|instr, _| !instr.is_data_drop()); [INFO] [stdout] 278 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/generator/special_func.rs:353:13 [INFO] [stdout] | [INFO] [stdout] 353 | / if let Some(fid) = (NAMESPACE, &format!("__wasip1_vfs_{wasm}___main_void")) [INFO] [stdout] 354 | | .get_fid(&module.imports) [INFO] [stdout] 355 | | .ok() [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] help: consider matching on `Ok(fid)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 353 ~ if let Ok(fid) = (NAMESPACE, &format!("__wasip1_vfs_{wasm}___main_void")) [INFO] [stdout] 354 + .get_fid(&module.imports) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.into_iter().count()` on a `Vec` [INFO] [stdout] --> src/generator/special_func.rs:389:38 [INFO] [stdout] | [INFO] [stdout] 389 | let call_count = module [INFO] [stdout] | ______________________________________^ [INFO] [stdout] 390 | | .funcs [INFO] [stdout] 391 | | .flat_read( [INFO] [stdout] 392 | | |instr, _| { [INFO] [stdout] ... | [INFO] [stdout] 402 | | .into_iter() [INFO] [stdout] 403 | | .count(); [INFO] [stdout] | |________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_count [INFO] [stdout] = note: `#[warn(clippy::iter_count)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 389 ~ let call_count = module [INFO] [stdout] 390 + .funcs [INFO] [stdout] 391 + .flat_read( [INFO] [stdout] 392 + |instr, _| { [INFO] [stdout] 393 + if let walrus::ir::Instr::Call(c) = instr { [INFO] [stdout] 394 + if c.func == main_void_func_id { 1 } else { 0 } [INFO] [stdout] 395 + } else { [INFO] [stdout] 396 + 0 [INFO] [stdout] 397 + } [INFO] [stdout] 398 + }, [INFO] [stdout] 399 + start_fn_id, [INFO] [stdout] 400 + ) [INFO] [stdout] 401 ~ .wrap_err("Failed to read main_void calls")?.len(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enclosing `Ok` and `?` operator are unneeded [INFO] [stdout] --> src/compile.rs:291:5 [INFO] [stdout] | [INFO] [stdout] 291 | / Ok(ret.wrap_err( [INFO] [stdout] 292 | | r#" [INFO] [stdout] 293 | | Failed to find Wasm file on build artifact. If you set ` [INFO] [stdout] 294 | | [lib] [INFO] [stdout] ... | [INFO] [stdout] 298 | | .trim(), [INFO] [stdout] 299 | | )?) [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark [INFO] [stdout] = note: `#[warn(clippy::needless_question_mark)]` on by default [INFO] [stdout] help: remove the enclosing `Ok` and `?` operator [INFO] [stdout] | [INFO] [stdout] 291 ~ ret.wrap_err( [INFO] [stdout] 292 | r#" [INFO] [stdout] ... [INFO] [stdout] 298 | .trim(), [INFO] [stdout] 299 ~ ) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/compile.rs:73:23 [INFO] [stdout] | [INFO] [stdout] 73 | args.push(&manifest_path); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `manifest_path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/generator/special_func.rs:432:33 [INFO] [stdout] | [INFO] [stdout] 432 | / ... if let walrus::ir::Instr::Call(c) = instr { [INFO] [stdout] 433 | | ... if c.func == main_void_func_id { [INFO] [stdout] 434 | | ... c.func = fake_fn_id; [INFO] [stdout] 435 | | ... } [INFO] [stdout] 436 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 432 ~ if let walrus::ir::Instr::Call(c) = instr [INFO] [stdout] 433 ~ && c.func == main_void_func_id { [INFO] [stdout] 434 | c.func = fake_fn_id; [INFO] [stdout] 435 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/compile.rs:141:13 [INFO] [stdout] | [INFO] [stdout] 141 | if let Some(line) = msg_receiver.try_recv().ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] = note: `#[warn(clippy::match_result_ok)]` on by default [INFO] [stdout] help: consider matching on `Ok(line)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 141 - if let Some(line) = msg_receiver.try_recv().ok() { [INFO] [stdout] 141 + if let Ok(line) = msg_receiver.try_recv() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/compile.rs:158:25 [INFO] [stdout] | [INFO] [stdout] 158 | return Ok(false); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 158 - return Ok(false); [INFO] [stdout] 158 + Ok(false) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/generator/threads.rs:47:9 [INFO] [stdout] | [INFO] [stdout] 47 | / if let Some(normal_thread_spawn_fn_id) = [INFO] [stdout] 48 | | ("wasi", "thread-spawn").get_fid(&module.imports).ok() [INFO] [stdout] | |__________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] help: consider matching on `Ok(normal_thread_spawn_fn_id)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 47 - if let Some(normal_thread_spawn_fn_id) = [INFO] [stdout] 48 - ("wasi", "thread-spawn").get_fid(&module.imports).ok() [INFO] [stdout] 47 + if let Ok(normal_thread_spawn_fn_id) = ("wasi", "thread-spawn").get_fid(&module.imports) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/compile.rs:212:13 [INFO] [stdout] | [INFO] [stdout] 212 | if let Some(message) = parse_receiver.try_recv().ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] help: consider matching on `Ok(message)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 212 - if let Some(message) = parse_receiver.try_recv().ok() { [INFO] [stdout] 212 + if let Ok(message) = parse_receiver.try_recv() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/compile.rs:215:25 [INFO] [stdout] | [INFO] [stdout] 215 | / if building_crate.id == artifact.package_id { [INFO] [stdout] ... | [INFO] [stdout] 234 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 214 ~ cargo_metadata::Message::CompilerArtifact(artifact) [INFO] [stdout] 215 ~ if building_crate.id == artifact.package_id => { [INFO] [stdout] 216 | // let mut file = std::fs::OpenOptions::new() [INFO] [stdout] ... [INFO] [stdout] 233 | } [INFO] [stdout] 234 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead [INFO] [stdout] --> src/compile.rs:225:49 [INFO] [stdout] | [INFO] [stdout] 225 | ... if let Some(wasm) = artifact [INFO] [stdout] | ___________________________________________^ [INFO] [stdout] 226 | | ... .filenames [INFO] [stdout] 227 | | ... .iter() [INFO] [stdout] 228 | | ... .filter(|f| f.extension() == Some("wasm")) [INFO] [stdout] 229 | | ... .next() [INFO] [stdout] | |_________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next [INFO] [stdout] = note: `#[warn(clippy::filter_next)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 225 ~ if let Some(wasm) = artifact [INFO] [stdout] 226 + .filenames [INFO] [stdout] 227 + .iter().find(|f| f.extension() == Some("wasm")) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/generator/threads.rs:162:9 [INFO] [stdout] | [INFO] [stdout] 162 | / module [INFO] [stdout] 163 | | .imports [INFO] [stdout] 164 | | .find_mut(("wasi", "thread-spawn")) [INFO] [stdout] 165 | | .ok() [INFO] [stdout] 166 | | .map(|import| { [INFO] [stdout] 167 | | import.name = format!("__wasip1_vfs_wasi_thread_spawn_{name}"); [INFO] [stdout] 168 | | }); [INFO] [stdout] | |______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] = note: `#[warn(clippy::option_map_unit_fn)]` on by default [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 162 ~ if let Some(import) = module [INFO] [stdout] 163 + .imports [INFO] [stdout] 164 + .find_mut(("wasi", "thread-spawn")) [INFO] [stdout] 165 + .ok() { import.name = format!("__wasip1_vfs_wasi_thread_spawn_{name}"); } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/generator/threads.rs:170:9 [INFO] [stdout] | [INFO] [stdout] 170 | / module [INFO] [stdout] 171 | | .exports [INFO] [stdout] 172 | | .iter_mut() [INFO] [stdout] 173 | | .find(|export| export.name == "wasi_thread_start") [INFO] [stdout] 174 | | .map(|export| { [INFO] [stdout] 175 | | export.name = format!("__wasip1_vfs_wasi_thread_start_{name}"); [INFO] [stdout] 176 | | }); [INFO] [stdout] | |______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 170 ~ if let Some(export) = module [INFO] [stdout] 171 + .exports [INFO] [stdout] 172 + .iter_mut() [INFO] [stdout] 173 + .find(|export| export.name == "wasi_thread_start") { export.name = format!("__wasip1_vfs_wasi_thread_start_{name}"); } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `contains()` instead of `iter().any()` is more efficient [INFO] [stdout] --> src/compile.rs:323:25 [INFO] [stdout] | [INFO] [stdout] 323 | / workspace [INFO] [stdout] 324 | | .iter() [INFO] [stdout] 325 | | .any(|workspace_package| package.id == *workspace_package) [INFO] [stdout] | |______________________________________________________________________________________^ help: try: `workspace.contains(&package.id)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_contains [INFO] [stdout] = note: `#[warn(clippy::manual_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/generator/threads.rs:193:16 [INFO] [stdout] | [INFO] [stdout] 193 | if let Some(_) = initializer { [INFO] [stdout] | -------^^^^^^^-------------- help: try: `if initializer.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/generator/threads.rs:213:9 [INFO] [stdout] | [INFO] [stdout] 213 | / if ctx.unstable_print_debug { [INFO] [stdout] 214 | | if let Some(old_start) = old_start { [INFO] [stdout] 215 | | module.exports.add("__vfs_old_start", old_start); [INFO] [stdout] 216 | | } [INFO] [stdout] 217 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 213 ~ if ctx.unstable_print_debug [INFO] [stdout] 214 ~ && let Some(old_start) = old_start { [INFO] [stdout] 215 | module.exports.add("__vfs_old_start", old_start); [INFO] [stdout] 216 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: direct implementation of `ToString` [INFO] [stdout] --> src/generator/mod.rs:66:1 [INFO] [stdout] | [INFO] [stdout] 66 | / impl ToString for CompressNames { [INFO] [stdout] 67 | | fn to_string(&self) -> String { [INFO] [stdout] 68 | | self.names [INFO] [stdout] 69 | | .iter() [INFO] [stdout] ... | [INFO] [stdout] 77 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: prefer implementing `Display` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `TomlRestorers` [INFO] [stdout] --> src/config_checker.rs:18:5 [INFO] [stdout] | [INFO] [stdout] 18 | / pub fn new() -> Self { [INFO] [stdout] 19 | | Self(Vec::new()) [INFO] [stdout] 20 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 17 + impl Default for TomlRestorers { [INFO] [stdout] 18 + fn default() -> Self { [INFO] [stdout] 19 + Self::new() [INFO] [stdout] 20 + } [INFO] [stdout] 21 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/config_checker.rs:54:44 [INFO] [stdout] | [INFO] [stdout] 54 | let file_data = fs::read_to_string(&path).wrap_err("Failed to read manifest file")?; [INFO] [stdout] | ^^^^^ help: change this to: `path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/config_checker.rs:55:19 [INFO] [stdout] | [INFO] [stdout] 55 | fs::write(&path, &changed).wrap_err("Failed to write manifest file")?; [INFO] [stdout] | ^^^^^ help: change this to: `path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `&Box`. Consider using just `&T` [INFO] [stdout] --> src/generator/mod.rs:221:35 [INFO] [stdout] | [INFO] [stdout] 221 | pub fn target_names(&self) -> &Box<[LString]> { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `&[LString]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrowed_box [INFO] [stdout] = note: `#[warn(clippy::borrowed_box)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/config_checker.rs:150:35 [INFO] [stdout] | [INFO] [stdout] 150 | Item::Table(table) => table.get("features").map_or(false, |v| { [INFO] [stdout] | ___________________________________^ [INFO] [stdout] 151 | | v.as_array() [INFO] [stdout] 152 | | .map(|arr| arr.iter().any(|s| s.as_str() == Some(feature))) [INFO] [stdout] 153 | | .unwrap_or(false) [INFO] [stdout] 154 | | }), [INFO] [stdout] | |______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] = note: `#[warn(clippy::unnecessary_map_or)]` on by default [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 150 - Item::Table(table) => table.get("features").map_or(false, |v| { [INFO] [stdout] 150 + Item::Table(table) => table.get("features").is_some_and(|v| { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/config_checker.rs:156:17 [INFO] [stdout] | [INFO] [stdout] 156 | / inline.get("features").map_or(false, |v| { [INFO] [stdout] 157 | | v.as_array() [INFO] [stdout] 158 | | .map(|arr| arr.iter().any(|s| s.as_str() == Some(feature))) [INFO] [stdout] 159 | | .unwrap_or(false) [INFO] [stdout] 160 | | }) [INFO] [stdout] | |__________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 156 - inline.get("features").map_or(false, |v| { [INFO] [stdout] 156 + inline.get("features").is_some_and(|v| { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/config_checker.rs:168:32 [INFO] [stdout] | [INFO] [stdout] 168 | fs::read_to_string(&self.manifest_path).wrap_err("Failed to read manifest file")?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: change this to: `self.manifest_path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/config_checker.rs:178:44 [INFO] [stdout] | [INFO] [stdout] 178 | let file_data = fs::read_to_string(&self.root_manifest_path) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `self.root_manifest_path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/config_checker.rs:197:12 [INFO] [stdout] | [INFO] [stdout] 197 | if doc [INFO] [stdout] | ____________^ [INFO] [stdout] 198 | | .get("dependencies") [INFO] [stdout] 199 | | .map_or(true, |inner| inner.is_none()) [INFO] [stdout] | |__________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_none_or` instead [INFO] [stdout] | [INFO] [stdout] 199 - .map_or(true, |inner| inner.is_none()) [INFO] [stdout] 199 + .is_none_or(|inner| inner.is_none()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/config_checker.rs:204:12 [INFO] [stdout] | [INFO] [stdout] 204 | if doc["dependencies"] [INFO] [stdout] | ____________^ [INFO] [stdout] 205 | | .get(crate_name) [INFO] [stdout] 206 | | .map_or(true, |inner| inner.is_none()) [INFO] [stdout] | |__________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_none_or` instead [INFO] [stdout] | [INFO] [stdout] 206 - .map_or(true, |inner| inner.is_none()) [INFO] [stdout] 206 + .is_none_or(|inner| inner.is_none()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_none()` [INFO] [stdout] --> src/config_checker.rs:237:16 [INFO] [stdout] | [INFO] [stdout] 237 | if matches!(table.get("features"), None) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `table.get("features").is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_none()` [INFO] [stdout] --> src/config_checker.rs:251:16 [INFO] [stdout] | [INFO] [stdout] 251 | if matches!(table.get("features"), None) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `table.get("features").is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/config_checker.rs:311:42 [INFO] [stdout] | [INFO] [stdout] 311 | Ok(Some(TomlRestorer::with_write(&path, data.to_string())?)) [INFO] [stdout] | ^^^^^ help: change this to: `path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/config_checker.rs:356:9 [INFO] [stdout] | [INFO] [stdout] 356 | return TomlRestorer::with_write(&self.manifest_path, doc.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 356 - return TomlRestorer::with_write(&self.manifest_path, doc.to_string()); [INFO] [stdout] 356 + TomlRestorer::with_write(&self.manifest_path, doc.to_string()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/config_checker.rs:351:45 [INFO] [stdout] | [INFO] [stdout] 351 | return TomlRestorer::with_write(&self.root_manifest_path, doc.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `self.root_manifest_path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/config_checker.rs:356:41 [INFO] [stdout] | [INFO] [stdout] 356 | return TomlRestorer::with_write(&self.manifest_path, doc.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: change this to: `self.manifest_path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (9/7) [INFO] [stdout] --> src/generator/mod.rs:603:5 [INFO] [stdout] | [INFO] [stdout] 603 | / pub fn new( [INFO] [stdout] 604 | | path: WasmPath, [INFO] [stdout] 605 | | targets: Box<[WasmPath]>, [INFO] [stdout] 606 | | threads: bool, [INFO] [stdout] ... | [INFO] [stdout] 612 | | memory_hint: Box<[Option]>, [INFO] [stdout] 613 | | ) -> eyre::Result { [INFO] [stdout] | |___________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] = note: `#[warn(clippy::too_many_arguments)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: mutable key type [INFO] [stdout] --> src/generator/mod.rs:632:9 [INFO] [stdout] | [INFO] [stdout] 632 | / let memory_hint = memory_hint [INFO] [stdout] 633 | | .into_iter() [INFO] [stdout] 634 | | .zip(target_names.iter().cloned()) [INFO] [stdout] 635 | | .filter_map(|(hint, name)| hint.map(|h| (name, h))) [INFO] [stdout] 636 | | .collect::>(); [INFO] [stdout] | |________________________________________^ [INFO] [stdout] | [INFO] [stdout] = note: ... because it contains `LString`, which has interior mutability [INFO] [stdout] = note: ... because it contains `&Atomic`, which has interior mutability [INFO] [stdout] = note: ... because it contains `Atomic`, which has interior mutability [INFO] [stdout] = note: ... because it contains `UnsafeCell<::Storage>`, which has interior mutability [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mutable_key_type [INFO] [stdout] = note: `#[warn(clippy::mutable_key_type)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `&Box`. Consider using just `&T` [INFO] [stdout] --> src/generator/mod.rs:701:36 [INFO] [stdout] | [INFO] [stdout] 701 | pub const fn targets(&self) -> &Box<[WasmPath]> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try: `&[WasmPath]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrowed_box [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/generator/mod.rs:745:30 [INFO] [stdout] | [INFO] [stdout] 745 | if std::fs::metadata(&out_dir).is_ok() { [INFO] [stdout] | ^^^^^^^^ help: change this to: `out_dir` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/generator/mod.rs:746:37 [INFO] [stdout] | [INFO] [stdout] 746 | std::fs::remove_dir_all(&out_dir).expect("Failed to remove existing directory"); [INFO] [stdout] | ^^^^^^^^ help: change this to: `out_dir` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: passing a unit value to a function [INFO] [stdout] --> src/fallback_command.rs:170:9 [INFO] [stdout] | [INFO] [stdout] 170 | / Some(if buf.contains(WHITE_SPACE) { [INFO] [stdout] 171 | | () [INFO] [stdout] 172 | | } else { [INFO] [stdout] 173 | | return None; [INFO] [stdout] 174 | | }) [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unit_arg [INFO] [stdout] = note: `#[warn(clippy::unit_arg)]` on by default [INFO] [stdout] help: move the expression in front of the call and replace it with the unit literal `()` [INFO] [stdout] | [INFO] [stdout] 170 ~ let _: () = if buf.contains(WHITE_SPACE) { [INFO] [stdout] 171 + () [INFO] [stdout] 172 + } else { [INFO] [stdout] 173 + return None; [INFO] [stdout] 174 + }; [INFO] [stdout] 175 + Some(()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/generator/mod.rs:748:33 [INFO] [stdout] | [INFO] [stdout] 748 | std::fs::create_dir_all(&out_dir).expect("Failed to create output directory"); [INFO] [stdout] | ^^^^^^^^ help: change this to: `out_dir` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/generator/abi_connect.rs:26:13 [INFO] [stdout] | [INFO] [stdout] 26 | / if let Some(import_id) = ( [INFO] [stdout] 27 | | // CORE_MODULE_ROOT, [INFO] [stdout] 28 | | // &format!("[static]wasip1.{}-import", import.replace("_", "-")), [INFO] [stdout] 29 | | "wasi_snapshot_preview1", [INFO] [stdout] ... | [INFO] [stdout] 32 | | .get_fid(&module.imports) [INFO] [stdout] 33 | | .ok() [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] help: consider matching on `Ok(import_id)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 26 ~ if let Ok(import_id) = ( [INFO] [stdout] 27 + // CORE_MODULE_ROOT, [INFO] [stdout] 28 + // &format!("[static]wasip1.{}-import", import.replace("_", "-")), [INFO] [stdout] 29 + "wasi_snapshot_preview1", [INFO] [stdout] 30 + import, [INFO] [stdout] 31 + ) [INFO] [stdout] 32 + .get_fid(&module.imports) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/generator/abi_connect.rs:35:24 [INFO] [stdout] | [INFO] [stdout] 35 | if let Some(_) = export { [INFO] [stdout] | -------^^^^^^^--------- help: try: `if export.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/generator/abi_connect.rs:45:24 [INFO] [stdout] | [INFO] [stdout] 45 | if let Some(_) = export { [INFO] [stdout] | -------^^^^^^^--------- help: try: `if export.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/generator/abi_connect.rs:82:17 [INFO] [stdout] | [INFO] [stdout] 82 | / if let Some(import_id) = ("wasi_snapshot_preview1", import) [INFO] [stdout] 83 | | .get_fid(&module.imports) [INFO] [stdout] 84 | | .ok() [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] help: consider matching on `Ok(import_id)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 82 ~ if let Ok(import_id) = ("wasi_snapshot_preview1", import) [INFO] [stdout] 83 + .get_fid(&module.imports) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/generator/abi_connect.rs:121:25 [INFO] [stdout] | [INFO] [stdout] 121 | &format!("__wasip1_vfs_wasi_thread_start_{wasm}"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("__wasip1_vfs_wasi_thread_start_{wasm}")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/generator/abi_connect.rs:132:25 [INFO] [stdout] | [INFO] [stdout] 132 | &format!("__wasip1_vfs_wasi_thread_spawn_{wasm}"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("__wasip1_vfs_wasi_thread_spawn_{wasm}")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/generator/abi_connect.rs:154:13 [INFO] [stdout] | [INFO] [stdout] 154 | / if let Some(fid) = ("non_recursive_wasi_snapshot_preview1", import) [INFO] [stdout] 155 | | .get_fid(&module.imports) [INFO] [stdout] 156 | | .ok() [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] help: consider matching on `Ok(fid)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 154 ~ if let Ok(fid) = ("non_recursive_wasi_snapshot_preview1", import) [INFO] [stdout] 155 + .get_fid(&module.imports) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/generator/abi_connect.rs:159:17 [INFO] [stdout] | [INFO] [stdout] 159 | / if let Some(import_id) = ("wasi_snapshot_preview1", import) [INFO] [stdout] 160 | | .get_fid(&module.imports) [INFO] [stdout] 161 | | .ok() [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] help: consider matching on `Ok(import_id)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 159 ~ if let Ok(import_id) = ("wasi_snapshot_preview1", import) [INFO] [stdout] 160 + .get_fid(&module.imports) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/generator/mod.rs:973:10 [INFO] [stdout] | [INFO] [stdout] 973 | ) -> eyre::Result<(bool, CompactString, HashMap)> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/generator/mod.rs:1008:32 [INFO] [stdout] | [INFO] [stdout] 1008 | ... if !std::fs::metadata(&joined_dir).is_ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::fs::metadata(&joined_dir).is_err()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `camino::Utf8PathBuf` [INFO] [stdout] --> src/generator/mod.rs:996:37 [INFO] [stdout] | [INFO] [stdout] 996 | let file_name = camino::Utf8PathBuf::from(file_name); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `camino::Utf8PathBuf::from()`: `file_name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/generator/mod.rs:997:48 [INFO] [stdout] | [INFO] [stdout] 997 | std::fs::write(&file_name, &data).wrap_err_with(|| { [INFO] [stdout] | ^^^^^ help: change this to: `data` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/generator/check.rs:51:52 [INFO] [stdout] | [INFO] [stdout] 51 | .map(|s| (strsim::jaro_winkler(&s, wasm_name.as_ref()), s)) [INFO] [stdout] | ^^ help: change this to: `s` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/generator/mod.rs:1002:21 [INFO] [stdout] | [INFO] [stdout] 1002 | / if let Some(parent) = name.parent() { [INFO] [stdout] 1003 | | if !parent.as_str().is_empty() { [INFO] [stdout] 1004 | | let dir = name.ancestors().nth(1).wrap_err_with(|| { [INFO] [stdout] 1005 | | eyre::eyre!("Failed to get parent directory: {}", name) [INFO] [stdout] ... | [INFO] [stdout] 1017 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 1002 ~ if let Some(parent) = name.parent() [INFO] [stdout] 1003 ~ && !parent.as_str().is_empty() { [INFO] [stdout] 1004 | let dir = name.ancestors().nth(1).wrap_err_with(|| { [INFO] [stdout] ... [INFO] [stdout] 1015 | } [INFO] [stdout] 1016 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/generator/mod.rs:1018:48 [INFO] [stdout] | [INFO] [stdout] 1018 | std::fs::write(&file_name, &data).wrap_err_with(|| { [INFO] [stdout] | ^^^^^ help: change this to: `data` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `filter_map` with an identity function [INFO] [stdout] --> src/generator/debug.rs:66:18 [INFO] [stdout] | [INFO] [stdout] 66 | .filter_map(|v| v) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_map_identity [INFO] [stdout] = note: `#[warn(clippy::filter_map_identity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`u64` -> `u64`) [INFO] [stdout] --> src/generator/mod.rs:1234:25 [INFO] [stdout] | [INFO] [stdout] 1234 | mem.initial as u64, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `mem.initial` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`u64` -> `u64`) [INFO] [stdout] --> src/generator/mod.rs:1235:25 [INFO] [stdout] | [INFO] [stdout] 1235 | mem.maximum.unwrap_or(mem.initial) as u64, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `mem.maximum.unwrap_or(mem.initial)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/generator/mod.rs:1406:52 [INFO] [stdout] | [INFO] [stdout] 1406 | metadata_command.manifest_path(&manifest_path); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `manifest_path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/generator/mod.rs:1466:12 [INFO] [stdout] | [INFO] [stdout] 1466 | if !fs::metadata(&path).is_ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `fs::metadata(&path).is_err()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `filter_map` with an identity function [INFO] [stdout] --> src/generator/debug.rs:379:34 [INFO] [stdout] | [INFO] [stdout] 379 | ... .filter_map(|v| v) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_map_identity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/generator/mod.rs:1558:9 [INFO] [stdout] | [INFO] [stdout] 1550 | / let custom_section = custom_section_names [INFO] [stdout] 1551 | | .iter() [INFO] [stdout] 1552 | | .map(|id| { [INFO] [stdout] 1553 | | let section = vfs_module.customs.remove_raw(id); [INFO] [stdout] 1554 | | section.unwrap() [INFO] [stdout] 1555 | | }) [INFO] [stdout] 1556 | | .collect::>(); [INFO] [stdout] | |_________________________________- unnecessary `let` binding [INFO] [stdout] 1557 | [INFO] [stdout] 1558 | custom_section [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 1550 ~ [INFO] [stdout] 1551 | [INFO] [stdout] 1552 ~ custom_section_names [INFO] [stdout] 1553 + .iter() [INFO] [stdout] 1554 + .map(|id| { [INFO] [stdout] 1555 + let section = vfs_module.customs.remove_raw(id); [INFO] [stdout] 1556 + section.unwrap() [INFO] [stdout] 1557 + }) [INFO] [stdout] 1558 + .collect::>() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/generator/debug.rs:606:9 [INFO] [stdout] | [INFO] [stdout] 606 | if let Some(id) = "debug_wasip1_vfs_pre_init".get_fid(&module.exports).ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] help: consider matching on `Ok(id)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 606 - if let Some(id) = "debug_wasip1_vfs_pre_init".get_fid(&module.exports).ok() { [INFO] [stdout] 606 + if let Ok(id) = "debug_wasip1_vfs_pre_init".get_fid(&module.exports) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: direct implementation of `ToString` [INFO] [stdout] --> src/generator/memory.rs:106:1 [INFO] [stdout] | [INFO] [stdout] 106 | / impl ToString for HadSharedAndImported { [INFO] [stdout] 107 | | fn to_string(&self) -> String { [INFO] [stdout] 108 | | let n = self.had_shared as u8 [INFO] [stdout] 109 | | | (self.had_imported as u8) << 1 [INFO] [stdout] ... | [INFO] [stdout] 113 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: prefer implementing `Display` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl [INFO] [stdout] = note: `#[warn(clippy::to_string_trait_impl)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/util.rs:46:9 [INFO] [stdout] | [INFO] [stdout] 46 | / self.find_mut((other_module, other_name)) [INFO] [stdout] 47 | | .ok() [INFO] [stdout] 48 | | .map(|import| { [INFO] [stdout] 49 | | import.module = one_module; [INFO] [stdout] 50 | | import.name = one_name.clone(); [INFO] [stdout] 51 | | }); [INFO] [stdout] | |______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 46 ~ if let Some(import) = self.find_mut((other_module, other_name)) [INFO] [stdout] 47 + .ok() { ... } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/generator/memory.rs:328:13 [INFO] [stdout] | [INFO] [stdout] 328 | / if let Some(id) = (NAMESPACE, &with_name(wasm, "memory_copy_from")) [INFO] [stdout] 329 | | .get_fid(&module.imports) [INFO] [stdout] 330 | | .ok() [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] help: consider matching on `Ok(id)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 328 ~ if let Ok(id) = (NAMESPACE, &with_name(wasm, "memory_copy_from")) [INFO] [stdout] 329 + .get_fid(&module.imports) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/generator/memory.rs:353:13 [INFO] [stdout] | [INFO] [stdout] 353 | / if let Some(id) = (NAMESPACE, &with_name(wasm, "memory_copy_to")) [INFO] [stdout] 354 | | .get_fid(&module.imports) [INFO] [stdout] 355 | | .ok() [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] help: consider matching on `Ok(id)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 353 ~ if let Ok(id) = (NAMESPACE, &with_name(wasm, "memory_copy_to")) [INFO] [stdout] 354 + .get_fid(&module.imports) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/generator/memory.rs:406:13 [INFO] [stdout] | [INFO] [stdout] 406 | / if let Some(id) = (NAMESPACE, &with_name(wasm, "memory_trap")) [INFO] [stdout] 407 | | .get_fid(&module.imports) [INFO] [stdout] 408 | | .ok() [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] help: consider matching on `Ok(id)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 406 ~ if let Ok(id) = (NAMESPACE, &with_name(wasm, "memory_trap")) [INFO] [stdout] 407 + .get_fid(&module.imports) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of `Iterator::fold` on a type that implements `Try` [INFO] [stdout] --> src/util.rs:591:14 [INFO] [stdout] | [INFO] [stdout] 591 | .fold(Ok(Option::::None), |a, b| match a? { [INFO] [stdout] | ______________^ [INFO] [stdout] 592 | | Some(a) if a == b => Ok(Some(a)), [INFO] [stdout] 593 | | None => Ok(Some(b)), [INFO] [stdout] 594 | | Some(_) => eyre::bail!("Anchor access double memory, cannot determine memory id"), [INFO] [stdout] 595 | | })? [INFO] [stdout] | |______________^ help: use `try_fold` instead: `try_fold(Option::::None, |a, b| ...)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_try_fold [INFO] [stdout] = note: `#[warn(clippy::manual_try_fold)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/util.rs:714:21 [INFO] [stdout] | [INFO] [stdout] 714 | return Err(eyre::eyre!("Memory not found")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 714 - return Err(eyre::eyre!("Memory not found")); [INFO] [stdout] 714 + Err(eyre::eyre!("Memory not found")) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/generator/memory.rs:497:13 [INFO] [stdout] | [INFO] [stdout] 497 | / if let Some(id) = (NAMESPACE, &format!("__wasip1_vfs_{wasm}_memory_director")) [INFO] [stdout] 498 | | .get_fid(&module.imports) [INFO] [stdout] 499 | | .ok() [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] help: consider matching on `Ok(id)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 497 ~ if let Ok(id) = (NAMESPACE, &format!("__wasip1_vfs_{wasm}_memory_director")) [INFO] [stdout] 498 + .get_fid(&module.imports) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/util.rs:656:21 [INFO] [stdout] | [INFO] [stdout] 656 | / if matches!(ty, walrus_simple_interpreter::MemoryAccessType::Load) { [INFO] [stdout] 657 | | if let Some(v) = arg_ptr_c.lock().unwrap().as_ref() { [INFO] [stdout] 658 | | if v.contains(&address) { [INFO] [stdout] 659 | | if let Some(mem_id) = ret_mem_id_c.clone().lock().unwrap().as_ref() { [INFO] [stdout] ... | [INFO] [stdout] 670 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 656 ~ if matches!(ty, walrus_simple_interpreter::MemoryAccessType::Load) [INFO] [stdout] 657 ~ && let Some(v) = arg_ptr_c.lock().unwrap().as_ref() { [INFO] [stdout] 658 | if v.contains(&address) { [INFO] [stdout] ... [INFO] [stdout] 668 | } [INFO] [stdout] 669 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/util.rs:657:25 [INFO] [stdout] | [INFO] [stdout] 657 | / if let Some(v) = arg_ptr_c.lock().unwrap().as_ref() { [INFO] [stdout] 658 | | if v.contains(&address) { [INFO] [stdout] 659 | | if let Some(mem_id) = ret_mem_id_c.clone().lock().unwrap().as_ref() { [INFO] [stdout] 660 | | if *mem_id != id { [INFO] [stdout] ... | [INFO] [stdout] 669 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 657 ~ if let Some(v) = arg_ptr_c.lock().unwrap().as_ref() [INFO] [stdout] 658 ~ && v.contains(&address) { [INFO] [stdout] 659 | if let Some(mem_id) = ret_mem_id_c.clone().lock().unwrap().as_ref() { [INFO] [stdout] ... [INFO] [stdout] 667 | } [INFO] [stdout] 668 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `filter_map` with an identity function [INFO] [stdout] --> src/generator/shared_global.rs:78:14 [INFO] [stdout] | [INFO] [stdout] 78 | .filter_map(|v| v) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_map_identity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/util.rs:704:21 [INFO] [stdout] | [INFO] [stdout] 704 | / if let Err(e) = interpreter.call(fid, self, &args).to_eyre() { [INFO] [stdout] 705 | | if ret_mem_id.lock().unwrap().is_none() { [INFO] [stdout] 706 | | eprintln!("Error: {e}"); [INFO] [stdout] 707 | | } [INFO] [stdout] 708 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 704 ~ if let Err(e) = interpreter.call(fid, self, &args).to_eyre() [INFO] [stdout] 705 ~ && ret_mem_id.lock().unwrap().is_none() { [INFO] [stdout] 706 | eprintln!("Error: {e}"); [INFO] [stdout] 707 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary map of the identity function [INFO] [stdout] --> src/generator/shared_global.rs:132:20 [INFO] [stdout] | [INFO] [stdout] 132 | .last() [INFO] [stdout] | ____________________^ [INFO] [stdout] 133 | | .map(|g| g) [INFO] [stdout] | |_______________________^ help: remove the call to `map` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_identity [INFO] [stdout] = note: `#[warn(clippy::map_identity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/generator/shared_global.rs:327:17 [INFO] [stdout] | [INFO] [stdout] 327 | / if let Instr::Call(Call { func }) = instr { [INFO] [stdout] 328 | | if *func == alt_id { [INFO] [stdout] 329 | | *instr = Instr::MemoryGrow(MemoryGrow { memory: mem_id }); [INFO] [stdout] 330 | | } [INFO] [stdout] 331 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 327 ~ if let Instr::Call(Call { func }) = instr [INFO] [stdout] 328 ~ && *func == alt_id { [INFO] [stdout] 329 | *instr = Instr::MemoryGrow(MemoryGrow { memory: mem_id }); [INFO] [stdout] 330 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/generator/shared_global.rs:359:21 [INFO] [stdout] | [INFO] [stdout] 359 | / if let Instr::Call(Call { func }) = instr { [INFO] [stdout] 360 | | if *func == alt_id { [INFO] [stdout] 361 | | *instr = Instr::MemoryGrow(MemoryGrow { memory: mem_id }); [INFO] [stdout] 362 | | } [INFO] [stdout] 363 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 359 ~ if let Instr::Call(Call { func }) = instr [INFO] [stdout] 360 ~ && *func == alt_id { [INFO] [stdout] 361 | *instr = Instr::MemoryGrow(MemoryGrow { memory: mem_id }); [INFO] [stdout] 362 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/util.rs:998:25 [INFO] [stdout] | [INFO] [stdout] 998 | / if let walrus::ir::Instr::Call(call) = instr { [INFO] [stdout] 999 | | if call.func == old_id { [INFO] [stdout] 1000 | | call.func = new_id; [INFO] [stdout] 1001 | | } [INFO] [stdout] 1002 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 998 ~ if let walrus::ir::Instr::Call(call) = instr [INFO] [stdout] 999 ~ && call.func == old_id { [INFO] [stdout] 1000 | call.func = new_id; [INFO] [stdout] 1001 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/util.rs:1018:30 [INFO] [stdout] | [INFO] [stdout] 1018 | .filter(|export| match export.item { [INFO] [stdout] | ______________________________^ [INFO] [stdout] 1019 | | walrus::ExportItem::Function(f) if f == old_id => true, [INFO] [stdout] 1020 | | _ => false, [INFO] [stdout] 1021 | | }) [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] = note: `#[warn(clippy::match_like_matches_macro)]` on by default [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 1018 - .filter(|export| match export.item { [INFO] [stdout] 1019 - walrus::ExportItem::Function(f) if f == old_id => true, [INFO] [stdout] 1020 - _ => false, [INFO] [stdout] 1021 - }) [INFO] [stdout] 1018 + .filter(|export| matches!(export.item, walrus::ExportItem::Function(f) if f == old_id)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/util.rs:1044:62 [INFO] [stdout] | [INFO] [stdout] 1044 | let mut func = FunctionBuilder::new(&mut self.types, ¶ms, &results); [INFO] [stdout] | ^^^^^^^ help: change this to: `params` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/util.rs:1044:71 [INFO] [stdout] | [INFO] [stdout] 1044 | let mut func = FunctionBuilder::new(&mut self.types, ¶ms, &results); [INFO] [stdout] | ^^^^^^^^ help: change this to: `results` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/generator/special_func.rs:86:13 [INFO] [stdout] | [INFO] [stdout] 86 | if let Some(reset) = (NAMESPACE, &reset_name).get_fid(&module.imports).ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] help: consider matching on `Ok(reset)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 86 - if let Some(reset) = (NAMESPACE, &reset_name).get_fid(&module.imports).ok() { [INFO] [stdout] 86 + if let Ok(reset) = (NAMESPACE, &reset_name).get_fid(&module.imports) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/util.rs:1089:16 [INFO] [stdout] | [INFO] [stdout] 1089 | || self.types.get(self.funcs.get(id).ty()).results() != [] [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.types.get(self.funcs.get(id).ty()).results().is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] = note: `#[warn(clippy::comparison_to_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/util.rs:1142:26 [INFO] [stdout] | [INFO] [stdout] 1142 | .cmp(&fid_b) [INFO] [stdout] | ^^^^^^ help: change this to: `fid_b` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/util.rs:1144:69 [INFO] [stdout] | [INFO] [stdout] 1144 | std::cmp::Ordering::Equal => match seq_id_a.cmp(&seq_id_b) { [INFO] [stdout] | ^^^^^^^^^ help: change this to: `seq_id_b` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/util.rs:1145:64 [INFO] [stdout] | [INFO] [stdout] 1145 | std::cmp::Ordering::Equal => pos_a.cmp(&pos_b), [INFO] [stdout] | ^^^^^^ help: change this to: `pos_b` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `repeat().take()` can be written more concisely [INFO] [stdout] --> src/util.rs:1204:28 [INFO] [stdout] | [INFO] [stdout] 1204 | .chain(std::iter::repeat(ValType::I32).take(N)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `repeat_n()` instead: `std::iter::repeat_n(ValType::I32, N)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_repeat_n [INFO] [stdout] = note: `#[warn(clippy::manual_repeat_n)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Value` which implements the `Copy` trait [INFO] [stdout] --> src/generator/special_func.rs:94:39 [INFO] [stdout] | [INFO] [stdout] 94 | Some((g.id(), v.clone())) [INFO] [stdout] | ^^^^^^^^^ help: try removing the `clone` call: `v` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/util.rs:1236:21 [INFO] [stdout] | [INFO] [stdout] 1236 | / if let Some(ret) = filter(instr) { [INFO] [stdout] 1237 | | Some((ret, fid, pos)) [INFO] [stdout] 1238 | | } else { [INFO] [stdout] 1239 | | None [INFO] [stdout] 1240 | | } [INFO] [stdout] | |_____________________^ help: try: `filter(instr).map(|ret| (ret, fid, pos))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] = note: `#[warn(clippy::manual_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/util.rs:1257:58 [INFO] [stdout] | [INFO] [stdout] 1257 | let middle_fn_id = self.add_func(¶ms, ¶ms, |builder, args| { [INFO] [stdout] | ^^^^^^^ help: change this to: `params` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/util.rs:1257:67 [INFO] [stdout] | [INFO] [stdout] 1257 | let middle_fn_id = self.add_func(¶ms, ¶ms, |builder, args| { [INFO] [stdout] | ^^^^^^^ help: change this to: `params` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/util.rs:1294:26 [INFO] [stdout] | [INFO] [stdout] 1294 | .cmp(&fid_b) [INFO] [stdout] | ^^^^^^ help: change this to: `fid_b` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/util.rs:1296:69 [INFO] [stdout] | [INFO] [stdout] 1296 | std::cmp::Ordering::Equal => match seq_id_a.cmp(&seq_id_b) { [INFO] [stdout] | ^^^^^^^^^ help: change this to: `seq_id_b` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/util.rs:1297:64 [INFO] [stdout] | [INFO] [stdout] 1297 | std::cmp::Ordering::Equal => pos_a.cmp(&pos_b), [INFO] [stdout] | ^^^^^^ help: change this to: `pos_b` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/util.rs:1322:28 [INFO] [stdout] | [INFO] [stdout] 1322 | if let Some(_) = finalize { [INFO] [stdout] | -------^^^^^^^----------- help: try: `if finalize.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/util.rs:1325:28 [INFO] [stdout] | [INFO] [stdout] 1325 | if let Some(_) = inspector { [INFO] [stdout] | -------^^^^^^^------------ help: try: `if inspector.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Option>` which implements the `Copy` trait [INFO] [stdout] --> src/generator/special_func.rs:242:25 [INFO] [stdout] | [INFO] [stdout] 242 | let old_start = module.start.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `module.start` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/generator/special_func.rs:258:9 [INFO] [stdout] | [INFO] [stdout] 258 | / if let Some(start) = old_start { [INFO] [stdout] 259 | | if ctx.unstable_print_debug { [INFO] [stdout] 260 | | module.exports.add("__wasip1_vfs_start_init_old", start); [INFO] [stdout] 261 | | } [INFO] [stdout] 262 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 258 ~ if let Some(start) = old_start [INFO] [stdout] 259 ~ && ctx.unstable_print_debug { [INFO] [stdout] 260 | module.exports.add("__wasip1_vfs_start_init_old", start); [INFO] [stdout] 261 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/generator/special_func.rs:274:17 [INFO] [stdout] | [INFO] [stdout] 274 | / match &mut func.kind { [INFO] [stdout] 275 | | walrus::FunctionKind::Local(l) => { [INFO] [stdout] 276 | | l.builder_mut() [INFO] [stdout] 277 | | .func_body() [INFO] [stdout] ... | [INFO] [stdout] 280 | | _ => {} [INFO] [stdout] 281 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 274 ~ if let walrus::FunctionKind::Local(l) = &mut func.kind { [INFO] [stdout] 275 + l.builder_mut() [INFO] [stdout] 276 + .func_body() [INFO] [stdout] 277 + .retain(|instr, _| !instr.is_data_drop()); [INFO] [stdout] 278 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> src/util.rs:1424:17 [INFO] [stdout] | [INFO] [stdout] 1424 | / local_func_base [INFO] [stdout] 1425 | | .read(|instr, _| match instr { [INFO] [stdout] 1426 | | walrus::ir::Instr::LocalGet(walrus::ir::LocalGet { local }) => Some(*local), [INFO] [stdout] 1427 | | walrus::ir::Instr::LocalSet(walrus::ir::LocalSet { local }) => Some(*local), [INFO] [stdout] ... | [INFO] [stdout] 1434 | | .collect::>() [INFO] [stdout] 1435 | | .into_iter(), [INFO] [stdout] | |________________________________^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/3645249d79dfb136b5d8de3ce153d19d6698d92d/library/core/src/iter/traits/iterator.rs:510:11 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 1434 - .collect::>() [INFO] [stdout] 1435 - .into_iter(), [INFO] [stdout] 1434 + .collect::>(), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `filter_map` with an identity function [INFO] [stdout] --> src/util.rs:1432:22 [INFO] [stdout] | [INFO] [stdout] 1432 | .filter_map(|x| x) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_map_identity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/generator/special_func.rs:353:13 [INFO] [stdout] | [INFO] [stdout] 353 | / if let Some(fid) = (NAMESPACE, &format!("__wasip1_vfs_{wasm}___main_void")) [INFO] [stdout] 354 | | .get_fid(&module.imports) [INFO] [stdout] 355 | | .ok() [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] help: consider matching on `Ok(fid)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 353 ~ if let Ok(fid) = (NAMESPACE, &format!("__wasip1_vfs_{wasm}___main_void")) [INFO] [stdout] 354 + .get_fid(&module.imports) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/util.rs:1504:18 [INFO] [stdout] | [INFO] [stdout] 1504 | .map(|instr| match instr { [INFO] [stdout] | __________________^ [INFO] [stdout] 1505 | | Instr::Block(Block { seq }) => { [INFO] [stdout] 1506 | | vec![seq] [INFO] [stdout] ... | [INFO] [stdout] 1528 | | }) [INFO] [stdout] 1529 | | .flatten() [INFO] [stdout] | |__________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] = note: `#[warn(clippy::map_flatten)]` on by default [INFO] [stdout] help: try replacing `map` with `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 1504 ~ .flat_map(|instr| match instr { [INFO] [stdout] 1505 + Instr::Block(Block { seq }) => { [INFO] [stdout] 1506 + vec![seq] [INFO] [stdout] 1507 + } [INFO] [stdout] 1508 + Instr::Loop(Loop { seq }) => { [INFO] [stdout] 1509 + vec![seq] [INFO] [stdout] 1510 + } [INFO] [stdout] 1511 + Instr::Br(Br { block }) => { [INFO] [stdout] 1512 + vec![block] [INFO] [stdout] 1513 + } [INFO] [stdout] 1514 + Instr::BrIf(BrIf { block }) => { [INFO] [stdout] 1515 + vec![block] [INFO] [stdout] 1516 + } [INFO] [stdout] 1517 + Instr::IfElse(IfElse { [INFO] [stdout] 1518 + alternative, [INFO] [stdout] 1519 + consequent, [INFO] [stdout] 1520 + }) => { [INFO] [stdout] 1521 + vec![alternative, consequent] [INFO] [stdout] 1522 + } [INFO] [stdout] 1523 + Instr::BrTable(BrTable { blocks, default }) => blocks [INFO] [stdout] 1524 + .iter() [INFO] [stdout] 1525 + .chain(std::iter::once(default)) [INFO] [stdout] 1526 + .collect::>(), [INFO] [stdout] 1527 + _ => Vec::new(), [INFO] [stdout] 1528 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/util.rs:1531:46 [INFO] [stdout] | [INFO] [stdout] 1531 | if !seq_map.contains_key(&b) { [INFO] [stdout] | ^^ help: change this to: `b` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.into_iter().count()` on a `Vec` [INFO] [stdout] --> src/generator/special_func.rs:389:38 [INFO] [stdout] | [INFO] [stdout] 389 | let call_count = module [INFO] [stdout] | ______________________________________^ [INFO] [stdout] 390 | | .funcs [INFO] [stdout] 391 | | .flat_read( [INFO] [stdout] 392 | | |instr, _| { [INFO] [stdout] ... | [INFO] [stdout] 402 | | .into_iter() [INFO] [stdout] 403 | | .count(); [INFO] [stdout] | |________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_count [INFO] [stdout] = note: `#[warn(clippy::iter_count)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 389 ~ let call_count = module [INFO] [stdout] 390 + .funcs [INFO] [stdout] 391 + .flat_read( [INFO] [stdout] 392 + |instr, _| { [INFO] [stdout] 393 + if let walrus::ir::Instr::Call(c) = instr { [INFO] [stdout] 394 + if c.func == main_void_func_id { 1 } else { 0 } [INFO] [stdout] 395 + } else { [INFO] [stdout] 396 + 0 [INFO] [stdout] 397 + } [INFO] [stdout] 398 + }, [INFO] [stdout] 399 + start_fn_id, [INFO] [stdout] 400 + ) [INFO] [stdout] 401 ~ .wrap_err("Failed to read main_void calls")?.len(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/generator/special_func.rs:432:33 [INFO] [stdout] | [INFO] [stdout] 432 | / ... if let walrus::ir::Instr::Call(c) = instr { [INFO] [stdout] 433 | | ... if c.func == main_void_func_id { [INFO] [stdout] 434 | | ... c.func = fake_fn_id; [INFO] [stdout] 435 | | ... } [INFO] [stdout] 436 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 432 ~ if let walrus::ir::Instr::Call(c) = instr [INFO] [stdout] 433 ~ && c.func == main_void_func_id { [INFO] [stdout] 434 | c.func = fake_fn_id; [INFO] [stdout] 435 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/generator/threads.rs:47:9 [INFO] [stdout] | [INFO] [stdout] 47 | / if let Some(normal_thread_spawn_fn_id) = [INFO] [stdout] 48 | | ("wasi", "thread-spawn").get_fid(&module.imports).ok() [INFO] [stdout] | |__________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] help: consider matching on `Ok(normal_thread_spawn_fn_id)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 47 - if let Some(normal_thread_spawn_fn_id) = [INFO] [stdout] 48 - ("wasi", "thread-spawn").get_fid(&module.imports).ok() [INFO] [stdout] 47 + if let Ok(normal_thread_spawn_fn_id) = ("wasi", "thread-spawn").get_fid(&module.imports) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/generator/threads.rs:162:9 [INFO] [stdout] | [INFO] [stdout] 162 | / module [INFO] [stdout] 163 | | .imports [INFO] [stdout] 164 | | .find_mut(("wasi", "thread-spawn")) [INFO] [stdout] 165 | | .ok() [INFO] [stdout] 166 | | .map(|import| { [INFO] [stdout] 167 | | import.name = format!("__wasip1_vfs_wasi_thread_spawn_{name}"); [INFO] [stdout] 168 | | }); [INFO] [stdout] | |______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] = note: `#[warn(clippy::option_map_unit_fn)]` on by default [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 162 ~ if let Some(import) = module [INFO] [stdout] 163 + .imports [INFO] [stdout] 164 + .find_mut(("wasi", "thread-spawn")) [INFO] [stdout] 165 + .ok() { import.name = format!("__wasip1_vfs_wasi_thread_spawn_{name}"); } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/generator/threads.rs:170:9 [INFO] [stdout] | [INFO] [stdout] 170 | / module [INFO] [stdout] 171 | | .exports [INFO] [stdout] 172 | | .iter_mut() [INFO] [stdout] 173 | | .find(|export| export.name == "wasi_thread_start") [INFO] [stdout] 174 | | .map(|export| { [INFO] [stdout] 175 | | export.name = format!("__wasip1_vfs_wasi_thread_start_{name}"); [INFO] [stdout] 176 | | }); [INFO] [stdout] | |______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 170 ~ if let Some(export) = module [INFO] [stdout] 171 + .exports [INFO] [stdout] 172 + .iter_mut() [INFO] [stdout] 173 + .find(|export| export.name == "wasi_thread_start") { export.name = format!("__wasip1_vfs_wasi_thread_start_{name}"); } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/util.rs:1798:13 [INFO] [stdout] | [INFO] [stdout] 1798 | / match &self.get(fid).kind { [INFO] [stdout] 1799 | | FunctionKind::Local(imported_function) => { [INFO] [stdout] 1800 | | imported_function [INFO] [stdout] 1801 | | .read(|instr, _| { [INFO] [stdout] ... | [INFO] [stdout] 1826 | | _ => {} [INFO] [stdout] 1827 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 1798 ~ if let FunctionKind::Local(imported_function) = &self.get(fid).kind { [INFO] [stdout] 1799 + imported_function [INFO] [stdout] 1800 + .read(|instr, _| { [INFO] [stdout] 1801 + use walrus::ir::*; [INFO] [stdout] 1802 + match instr { [INFO] [stdout] 1803 + Instr::Call(Call { func }) [INFO] [stdout] 1804 + | Instr::ReturnCall(ReturnCall { func, .. }) => { [INFO] [stdout] 1805 + if !children.contains(func) { [INFO] [stdout] 1806 + children.push(*func); [INFO] [stdout] 1807 + stack.push(*func); [INFO] [stdout] 1808 + } [INFO] [stdout] 1809 + } [INFO] [stdout] 1810 + Instr::CallIndirect(call) if !allow_call_indirect => { [INFO] [stdout] 1811 + eyre::bail!("Call indirect found: {call:?} in find children"); [INFO] [stdout] 1812 + } [INFO] [stdout] 1813 + Instr::ReturnCallIndirect(call) if !allow_call_indirect => { [INFO] [stdout] 1814 + eyre::bail!( [INFO] [stdout] 1815 + "Return call indirect found: {call:?} in find children" [INFO] [stdout] 1816 + ); [INFO] [stdout] 1817 + } [INFO] [stdout] 1818 + _ => {} [INFO] [stdout] 1819 + } [INFO] [stdout] 1820 + Ok(()) [INFO] [stdout] 1821 + })? [INFO] [stdout] 1822 + .into_iter() [INFO] [stdout] 1823 + .collect::>>()?; [INFO] [stdout] 1824 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/util.rs:1806:37 [INFO] [stdout] | [INFO] [stdout] 1806 | / ... if !children.contains(func) { [INFO] [stdout] 1807 | | ... children.push(*func); [INFO] [stdout] 1808 | | ... stack.push(*func); [INFO] [stdout] 1809 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 1805 ~ | Instr::ReturnCall(ReturnCall { func, .. }) [INFO] [stdout] 1806 ~ if !children.contains(func) => { [INFO] [stdout] 1807 | children.push(*func); [INFO] [stdout] 1808 | stack.push(*func); [INFO] [stdout] 1809 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/generator/threads.rs:193:16 [INFO] [stdout] | [INFO] [stdout] 193 | if let Some(_) = initializer { [INFO] [stdout] | -------^^^^^^^-------------- help: try: `if initializer.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/generator/threads.rs:213:9 [INFO] [stdout] | [INFO] [stdout] 213 | / if ctx.unstable_print_debug { [INFO] [stdout] 214 | | if let Some(old_start) = old_start { [INFO] [stdout] 215 | | module.exports.add("__vfs_old_start", old_start); [INFO] [stdout] 216 | | } [INFO] [stdout] 217 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 213 ~ if ctx.unstable_print_debug [INFO] [stdout] 214 ~ && let Some(old_start) = old_start { [INFO] [stdout] 215 | module.exports.add("__vfs_old_start", old_start); [INFO] [stdout] 216 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `if let .. else` expression looks like `matches!` macro [INFO] [stdout] --> src/util.rs:1880:17 [INFO] [stdout] | [INFO] [stdout] 1880 | / if let walrus::FunctionKind::Local(_) = self.get(*fid).kind { [INFO] [stdout] 1881 | | true [INFO] [stdout] 1882 | | } else { [INFO] [stdout] 1883 | | false [INFO] [stdout] 1884 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 1880 - if let walrus::FunctionKind::Local(_) = self.get(*fid).kind { [INFO] [stdout] 1881 - true [INFO] [stdout] 1882 - } else { [INFO] [stdout] 1883 - false [INFO] [stdout] 1884 - } [INFO] [stdout] 1880 + matches!(self.get(*fid).kind, walrus::FunctionKind::Local(_)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `if let .. else` expression looks like `matches!` macro [INFO] [stdout] --> src/util.rs:1904:17 [INFO] [stdout] | [INFO] [stdout] 1904 | / if let walrus::FunctionKind::Local(_) = self.get(*fid).kind { [INFO] [stdout] 1905 | | true [INFO] [stdout] 1906 | | } else { [INFO] [stdout] 1907 | | false [INFO] [stdout] 1908 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 1904 - if let walrus::FunctionKind::Local(_) = self.get(*fid).kind { [INFO] [stdout] 1905 - true [INFO] [stdout] 1906 - } else { [INFO] [stdout] 1907 - false [INFO] [stdout] 1908 - } [INFO] [stdout] 1904 + matches!(self.get(*fid).kind, walrus::FunctionKind::Local(_)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: direct implementation of `ToString` [INFO] [stdout] --> src/generator/mod.rs:66:1 [INFO] [stdout] | [INFO] [stdout] 66 | / impl ToString for CompressNames { [INFO] [stdout] 67 | | fn to_string(&self) -> String { [INFO] [stdout] 68 | | self.names [INFO] [stdout] 69 | | .iter() [INFO] [stdout] ... | [INFO] [stdout] 77 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: prefer implementing `Display` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `&Box`. Consider using just `&T` [INFO] [stdout] --> src/generator/mod.rs:221:35 [INFO] [stdout] | [INFO] [stdout] 221 | pub fn target_names(&self) -> &Box<[LString]> { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `&[LString]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrowed_box [INFO] [stdout] = note: `#[warn(clippy::borrowed_box)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/util.rs:2158:33 [INFO] [stdout] | [INFO] [stdout] 2158 | if self.iter().any(|im| match im.kind { [INFO] [stdout] | _________________________________^ [INFO] [stdout] 2159 | | walrus::ImportKind::Function(f) if f == fid => true, [INFO] [stdout] 2160 | | _ => false, [INFO] [stdout] 2161 | | }) { [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 2158 - if self.iter().any(|im| match im.kind { [INFO] [stdout] 2159 - walrus::ImportKind::Function(f) if f == fid => true, [INFO] [stdout] 2160 - _ => false, [INFO] [stdout] 2161 - }) { [INFO] [stdout] 2158 + if self.iter().any(|im| matches!(im.kind, walrus::ImportKind::Function(f) if f == fid)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/util.rs:2169:33 [INFO] [stdout] | [INFO] [stdout] 2169 | if self.iter().any(|im| match im.kind { [INFO] [stdout] | _________________________________^ [INFO] [stdout] 2170 | | walrus::ImportKind::Function(f) if f == fid => true, [INFO] [stdout] 2171 | | _ => false, [INFO] [stdout] 2172 | | }) { [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 2169 - if self.iter().any(|im| match im.kind { [INFO] [stdout] 2170 - walrus::ImportKind::Function(f) if f == fid => true, [INFO] [stdout] 2171 - _ => false, [INFO] [stdout] 2172 - }) { [INFO] [stdout] 2169 + if self.iter().any(|im| matches!(im.kind, walrus::ImportKind::Function(f) if f == fid)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/util.rs:2232:33 [INFO] [stdout] | [INFO] [stdout] 2232 | if self.iter().any(|ex| match ex.item { [INFO] [stdout] | _________________________________^ [INFO] [stdout] 2233 | | walrus::ExportItem::Function(f) if f == fid => true, [INFO] [stdout] 2234 | | _ => false, [INFO] [stdout] 2235 | | }) { [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 2232 - if self.iter().any(|ex| match ex.item { [INFO] [stdout] 2233 - walrus::ExportItem::Function(f) if f == fid => true, [INFO] [stdout] 2234 - _ => false, [INFO] [stdout] 2235 - }) { [INFO] [stdout] 2232 + if self.iter().any(|ex| matches!(ex.item, walrus::ExportItem::Function(f) if f == fid)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/util.rs:2243:33 [INFO] [stdout] | [INFO] [stdout] 2243 | if self.iter().any(|ex| match ex.item { [INFO] [stdout] | _________________________________^ [INFO] [stdout] 2244 | | walrus::ExportItem::Function(f) if f == fid => true, [INFO] [stdout] 2245 | | _ => false, [INFO] [stdout] 2246 | | }) { [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 2243 - if self.iter().any(|ex| match ex.item { [INFO] [stdout] 2244 - walrus::ExportItem::Function(f) if f == fid => true, [INFO] [stdout] 2245 - _ => false, [INFO] [stdout] 2246 - }) { [INFO] [stdout] 2243 + if self.iter().any(|ex| matches!(ex.item, walrus::ExportItem::Function(f) if f == fid)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/util.rs:2375:9 [INFO] [stdout] | [INFO] [stdout] 2375 | &self.0 [INFO] [stdout] | ^^^^^^^ help: change this to: `self.0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/util.rs:2380:9 [INFO] [stdout] | [INFO] [stdout] 2380 | &self.0 [INFO] [stdout] | ^^^^^^^ help: change this to: `self.0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/generator/mod.rs:1620:13 [INFO] [stdout] | [INFO] [stdout] 1620 | if let Some(_) = $runner.get_generator_ref::<$ty>().ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] ::: src/lib.rs:70:9 [INFO] [stdout] | [INFO] [stdout] 70 | add_generator!(component_runner); [INFO] [stdout] | -------------------------------- in this macro invocation [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] = note: this warning originates in the macro `generator::add_generators_by_type` which comes from the expansion of the macro `add_generator` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] help: consider matching on `Ok(_)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 1620 - if let Some(_) = $runner.get_generator_ref::<$ty>().ok() { [INFO] [stdout] 1620 + if let Ok(_) = $runner.get_generator_ref::<$ty>() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (9/7) [INFO] [stdout] --> src/generator/mod.rs:603:5 [INFO] [stdout] | [INFO] [stdout] 603 | / pub fn new( [INFO] [stdout] 604 | | path: WasmPath, [INFO] [stdout] 605 | | targets: Box<[WasmPath]>, [INFO] [stdout] 606 | | threads: bool, [INFO] [stdout] ... | [INFO] [stdout] 612 | | memory_hint: Box<[Option]>, [INFO] [stdout] 613 | | ) -> eyre::Result { [INFO] [stdout] | |___________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] = note: `#[warn(clippy::too_many_arguments)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: mutable key type [INFO] [stdout] --> src/generator/mod.rs:632:9 [INFO] [stdout] | [INFO] [stdout] 632 | / let memory_hint = memory_hint [INFO] [stdout] 633 | | .into_iter() [INFO] [stdout] 634 | | .zip(target_names.iter().cloned()) [INFO] [stdout] 635 | | .filter_map(|(hint, name)| hint.map(|h| (name, h))) [INFO] [stdout] 636 | | .collect::>(); [INFO] [stdout] | |________________________________________^ [INFO] [stdout] | [INFO] [stdout] = note: ... because it contains `LString`, which has interior mutability [INFO] [stdout] = note: ... because it contains `&Atomic`, which has interior mutability [INFO] [stdout] = note: ... because it contains `Atomic`, which has interior mutability [INFO] [stdout] = note: ... because it contains `UnsafeCell<::Storage>`, which has interior mutability [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mutable_key_type [INFO] [stdout] = note: `#[warn(clippy::mutable_key_type)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `&Box`. Consider using just `&T` [INFO] [stdout] --> src/generator/mod.rs:701:36 [INFO] [stdout] | [INFO] [stdout] 701 | pub const fn targets(&self) -> &Box<[WasmPath]> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try: `&[WasmPath]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrowed_box [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/lib.rs:94:13 [INFO] [stdout] | [INFO] [stdout] 94 | &vfs_manifest_path, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: change this to: `vfs_manifest_path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/generator/mod.rs:745:30 [INFO] [stdout] | [INFO] [stdout] 745 | if std::fs::metadata(&out_dir).is_ok() { [INFO] [stdout] | ^^^^^^^^ help: change this to: `out_dir` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/generator/mod.rs:746:37 [INFO] [stdout] | [INFO] [stdout] 746 | std::fs::remove_dir_all(&out_dir).expect("Failed to remove existing directory"); [INFO] [stdout] | ^^^^^^^^ help: change this to: `out_dir` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/generator/mod.rs:748:33 [INFO] [stdout] | [INFO] [stdout] 748 | std::fs::create_dir_all(&out_dir).expect("Failed to create output directory"); [INFO] [stdout] | ^^^^^^^^ help: change this to: `out_dir` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/lib.rs:118:13 [INFO] [stdout] | [INFO] [stdout] 118 | &vfs_manifest_path, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: change this to: `vfs_manifest_path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/lib.rs:137:13 [INFO] [stdout] | [INFO] [stdout] 137 | &vfs_manifest_path, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: change this to: `vfs_manifest_path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/lib.rs:152:13 [INFO] [stdout] | [INFO] [stdout] 152 | &vfs_manifest_path, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: change this to: `vfs_manifest_path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/generator/mod.rs:1620:13 [INFO] [stdout] | [INFO] [stdout] 1620 | if let Some(_) = $runner.get_generator_ref::<$ty>().ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] ::: src/lib.rs:175:5 [INFO] [stdout] | [INFO] [stdout] 175 | add_generator!(generator); [INFO] [stdout] | ------------------------- in this macro invocation [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] = note: this warning originates in the macro `generator::add_generators_by_type` which comes from the expansion of the macro `add_generator` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] help: consider matching on `Ok(_)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 1620 - if let Some(_) = $runner.get_generator_ref::<$ty>().ok() { [INFO] [stdout] 1620 + if let Ok(_) = $runner.get_generator_ref::<$ty>() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/generator/mod.rs:973:10 [INFO] [stdout] | [INFO] [stdout] 973 | ) -> eyre::Result<(bool, CompactString, HashMap)> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/generator/mod.rs:1008:32 [INFO] [stdout] | [INFO] [stdout] 1008 | ... if !std::fs::metadata(&joined_dir).is_ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::fs::metadata(&joined_dir).is_err()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `camino::Utf8PathBuf` [INFO] [stdout] --> src/generator/mod.rs:996:37 [INFO] [stdout] | [INFO] [stdout] 996 | let file_name = camino::Utf8PathBuf::from(file_name); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `camino::Utf8PathBuf::from()`: `file_name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/generator/mod.rs:997:48 [INFO] [stdout] | [INFO] [stdout] 997 | std::fs::write(&file_name, &data).wrap_err_with(|| { [INFO] [stdout] | ^^^^^ help: change this to: `data` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/generator/mod.rs:1002:21 [INFO] [stdout] | [INFO] [stdout] 1002 | / if let Some(parent) = name.parent() { [INFO] [stdout] 1003 | | if !parent.as_str().is_empty() { [INFO] [stdout] 1004 | | let dir = name.ancestors().nth(1).wrap_err_with(|| { [INFO] [stdout] 1005 | | eyre::eyre!("Failed to get parent directory: {}", name) [INFO] [stdout] ... | [INFO] [stdout] 1017 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 1002 ~ if let Some(parent) = name.parent() [INFO] [stdout] 1003 ~ && !parent.as_str().is_empty() { [INFO] [stdout] 1004 | let dir = name.ancestors().nth(1).wrap_err_with(|| { [INFO] [stdout] ... [INFO] [stdout] 1015 | } [INFO] [stdout] 1016 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/generator/mod.rs:1018:48 [INFO] [stdout] | [INFO] [stdout] 1018 | std::fs::write(&file_name, &data).wrap_err_with(|| { [INFO] [stdout] | ^^^^^ help: change this to: `data` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`u64` -> `u64`) [INFO] [stdout] --> src/generator/mod.rs:1234:25 [INFO] [stdout] | [INFO] [stdout] 1234 | mem.initial as u64, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `mem.initial` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`u64` -> `u64`) [INFO] [stdout] --> src/generator/mod.rs:1235:25 [INFO] [stdout] | [INFO] [stdout] 1235 | mem.maximum.unwrap_or(mem.initial) as u64, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `mem.maximum.unwrap_or(mem.initial)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/generator/mod.rs:1406:52 [INFO] [stdout] | [INFO] [stdout] 1406 | metadata_command.manifest_path(&manifest_path); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `manifest_path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/generator/mod.rs:1466:12 [INFO] [stdout] | [INFO] [stdout] 1466 | if !fs::metadata(&path).is_ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `fs::metadata(&path).is_err()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/generator/mod.rs:1558:9 [INFO] [stdout] | [INFO] [stdout] 1550 | / let custom_section = custom_section_names [INFO] [stdout] 1551 | | .iter() [INFO] [stdout] 1552 | | .map(|id| { [INFO] [stdout] 1553 | | let section = vfs_module.customs.remove_raw(id); [INFO] [stdout] 1554 | | section.unwrap() [INFO] [stdout] 1555 | | }) [INFO] [stdout] 1556 | | .collect::>(); [INFO] [stdout] | |_________________________________- unnecessary `let` binding [INFO] [stdout] 1557 | [INFO] [stdout] 1558 | custom_section [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 1550 ~ [INFO] [stdout] 1551 | [INFO] [stdout] 1552 ~ custom_section_names [INFO] [stdout] 1553 + .iter() [INFO] [stdout] 1554 + .map(|id| { [INFO] [stdout] 1555 + let section = vfs_module.customs.remove_raw(id); [INFO] [stdout] 1556 + section.unwrap() [INFO] [stdout] 1557 + }) [INFO] [stdout] 1558 + .collect::>() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/util.rs:46:9 [INFO] [stdout] | [INFO] [stdout] 46 | / self.find_mut((other_module, other_name)) [INFO] [stdout] 47 | | .ok() [INFO] [stdout] 48 | | .map(|import| { [INFO] [stdout] 49 | | import.module = one_module; [INFO] [stdout] 50 | | import.name = one_name.clone(); [INFO] [stdout] 51 | | }); [INFO] [stdout] | |______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 46 ~ if let Some(import) = self.find_mut((other_module, other_name)) [INFO] [stdout] 47 + .ok() { ... } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of `Iterator::fold` on a type that implements `Try` [INFO] [stdout] --> src/util.rs:591:14 [INFO] [stdout] | [INFO] [stdout] 591 | .fold(Ok(Option::::None), |a, b| match a? { [INFO] [stdout] | ______________^ [INFO] [stdout] 592 | | Some(a) if a == b => Ok(Some(a)), [INFO] [stdout] 593 | | None => Ok(Some(b)), [INFO] [stdout] 594 | | Some(_) => eyre::bail!("Anchor access double memory, cannot determine memory id"), [INFO] [stdout] 595 | | })? [INFO] [stdout] | |______________^ help: use `try_fold` instead: `try_fold(Option::::None, |a, b| ...)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_try_fold [INFO] [stdout] = note: `#[warn(clippy::manual_try_fold)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/util.rs:714:21 [INFO] [stdout] | [INFO] [stdout] 714 | return Err(eyre::eyre!("Memory not found")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 714 - return Err(eyre::eyre!("Memory not found")); [INFO] [stdout] 714 + Err(eyre::eyre!("Memory not found")) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/util.rs:656:21 [INFO] [stdout] | [INFO] [stdout] 656 | / if matches!(ty, walrus_simple_interpreter::MemoryAccessType::Load) { [INFO] [stdout] 657 | | if let Some(v) = arg_ptr_c.lock().unwrap().as_ref() { [INFO] [stdout] 658 | | if v.contains(&address) { [INFO] [stdout] 659 | | if let Some(mem_id) = ret_mem_id_c.clone().lock().unwrap().as_ref() { [INFO] [stdout] ... | [INFO] [stdout] 670 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 656 ~ if matches!(ty, walrus_simple_interpreter::MemoryAccessType::Load) [INFO] [stdout] 657 ~ && let Some(v) = arg_ptr_c.lock().unwrap().as_ref() { [INFO] [stdout] 658 | if v.contains(&address) { [INFO] [stdout] ... [INFO] [stdout] 668 | } [INFO] [stdout] 669 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/util.rs:657:25 [INFO] [stdout] | [INFO] [stdout] 657 | / if let Some(v) = arg_ptr_c.lock().unwrap().as_ref() { [INFO] [stdout] 658 | | if v.contains(&address) { [INFO] [stdout] 659 | | if let Some(mem_id) = ret_mem_id_c.clone().lock().unwrap().as_ref() { [INFO] [stdout] 660 | | if *mem_id != id { [INFO] [stdout] ... | [INFO] [stdout] 669 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 657 ~ if let Some(v) = arg_ptr_c.lock().unwrap().as_ref() [INFO] [stdout] 658 ~ && v.contains(&address) { [INFO] [stdout] 659 | if let Some(mem_id) = ret_mem_id_c.clone().lock().unwrap().as_ref() { [INFO] [stdout] ... [INFO] [stdout] 667 | } [INFO] [stdout] 668 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/util.rs:704:21 [INFO] [stdout] | [INFO] [stdout] 704 | / if let Err(e) = interpreter.call(fid, self, &args).to_eyre() { [INFO] [stdout] 705 | | if ret_mem_id.lock().unwrap().is_none() { [INFO] [stdout] 706 | | eprintln!("Error: {e}"); [INFO] [stdout] 707 | | } [INFO] [stdout] 708 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 704 ~ if let Err(e) = interpreter.call(fid, self, &args).to_eyre() [INFO] [stdout] 705 ~ && ret_mem_id.lock().unwrap().is_none() { [INFO] [stdout] 706 | eprintln!("Error: {e}"); [INFO] [stdout] 707 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/util.rs:998:25 [INFO] [stdout] | [INFO] [stdout] 998 | / if let walrus::ir::Instr::Call(call) = instr { [INFO] [stdout] 999 | | if call.func == old_id { [INFO] [stdout] 1000 | | call.func = new_id; [INFO] [stdout] 1001 | | } [INFO] [stdout] 1002 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 998 ~ if let walrus::ir::Instr::Call(call) = instr [INFO] [stdout] 999 ~ && call.func == old_id { [INFO] [stdout] 1000 | call.func = new_id; [INFO] [stdout] 1001 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/util.rs:1018:30 [INFO] [stdout] | [INFO] [stdout] 1018 | .filter(|export| match export.item { [INFO] [stdout] | ______________________________^ [INFO] [stdout] 1019 | | walrus::ExportItem::Function(f) if f == old_id => true, [INFO] [stdout] 1020 | | _ => false, [INFO] [stdout] 1021 | | }) [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] = note: `#[warn(clippy::match_like_matches_macro)]` on by default [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 1018 - .filter(|export| match export.item { [INFO] [stdout] 1019 - walrus::ExportItem::Function(f) if f == old_id => true, [INFO] [stdout] 1020 - _ => false, [INFO] [stdout] 1021 - }) [INFO] [stdout] 1018 + .filter(|export| matches!(export.item, walrus::ExportItem::Function(f) if f == old_id)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/util.rs:1044:62 [INFO] [stdout] | [INFO] [stdout] 1044 | let mut func = FunctionBuilder::new(&mut self.types, ¶ms, &results); [INFO] [stdout] | ^^^^^^^ help: change this to: `params` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/util.rs:1044:71 [INFO] [stdout] | [INFO] [stdout] 1044 | let mut func = FunctionBuilder::new(&mut self.types, ¶ms, &results); [INFO] [stdout] | ^^^^^^^^ help: change this to: `results` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/util.rs:1089:16 [INFO] [stdout] | [INFO] [stdout] 1089 | || self.types.get(self.funcs.get(id).ty()).results() != [] [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.types.get(self.funcs.get(id).ty()).results().is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] = note: `#[warn(clippy::comparison_to_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/util.rs:1142:26 [INFO] [stdout] | [INFO] [stdout] 1142 | .cmp(&fid_b) [INFO] [stdout] | ^^^^^^ help: change this to: `fid_b` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/util.rs:1144:69 [INFO] [stdout] | [INFO] [stdout] 1144 | std::cmp::Ordering::Equal => match seq_id_a.cmp(&seq_id_b) { [INFO] [stdout] | ^^^^^^^^^ help: change this to: `seq_id_b` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/util.rs:1145:64 [INFO] [stdout] | [INFO] [stdout] 1145 | std::cmp::Ordering::Equal => pos_a.cmp(&pos_b), [INFO] [stdout] | ^^^^^^ help: change this to: `pos_b` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `repeat().take()` can be written more concisely [INFO] [stdout] --> src/util.rs:1204:28 [INFO] [stdout] | [INFO] [stdout] 1204 | .chain(std::iter::repeat(ValType::I32).take(N)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `repeat_n()` instead: `std::iter::repeat_n(ValType::I32, N)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_repeat_n [INFO] [stdout] = note: `#[warn(clippy::manual_repeat_n)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/util.rs:1236:21 [INFO] [stdout] | [INFO] [stdout] 1236 | / if let Some(ret) = filter(instr) { [INFO] [stdout] 1237 | | Some((ret, fid, pos)) [INFO] [stdout] 1238 | | } else { [INFO] [stdout] 1239 | | None [INFO] [stdout] 1240 | | } [INFO] [stdout] | |_____________________^ help: try: `filter(instr).map(|ret| (ret, fid, pos))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] = note: `#[warn(clippy::manual_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/util.rs:1257:58 [INFO] [stdout] | [INFO] [stdout] 1257 | let middle_fn_id = self.add_func(¶ms, ¶ms, |builder, args| { [INFO] [stdout] | ^^^^^^^ help: change this to: `params` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/util.rs:1257:67 [INFO] [stdout] | [INFO] [stdout] 1257 | let middle_fn_id = self.add_func(¶ms, ¶ms, |builder, args| { [INFO] [stdout] | ^^^^^^^ help: change this to: `params` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/util.rs:1294:26 [INFO] [stdout] | [INFO] [stdout] 1294 | .cmp(&fid_b) [INFO] [stdout] | ^^^^^^ help: change this to: `fid_b` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/util.rs:1296:69 [INFO] [stdout] | [INFO] [stdout] 1296 | std::cmp::Ordering::Equal => match seq_id_a.cmp(&seq_id_b) { [INFO] [stdout] | ^^^^^^^^^ help: change this to: `seq_id_b` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/util.rs:1297:64 [INFO] [stdout] | [INFO] [stdout] 1297 | std::cmp::Ordering::Equal => pos_a.cmp(&pos_b), [INFO] [stdout] | ^^^^^^ help: change this to: `pos_b` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/util.rs:1322:28 [INFO] [stdout] | [INFO] [stdout] 1322 | if let Some(_) = finalize { [INFO] [stdout] | -------^^^^^^^----------- help: try: `if finalize.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/util.rs:1325:28 [INFO] [stdout] | [INFO] [stdout] 1325 | if let Some(_) = inspector { [INFO] [stdout] | -------^^^^^^^------------ help: try: `if inspector.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> src/util.rs:1424:17 [INFO] [stdout] | [INFO] [stdout] 1424 | / local_func_base [INFO] [stdout] 1425 | | .read(|instr, _| match instr { [INFO] [stdout] 1426 | | walrus::ir::Instr::LocalGet(walrus::ir::LocalGet { local }) => Some(*local), [INFO] [stdout] 1427 | | walrus::ir::Instr::LocalSet(walrus::ir::LocalSet { local }) => Some(*local), [INFO] [stdout] ... | [INFO] [stdout] 1434 | | .collect::>() [INFO] [stdout] 1435 | | .into_iter(), [INFO] [stdout] | |________________________________^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/3645249d79dfb136b5d8de3ce153d19d6698d92d/library/core/src/iter/traits/iterator.rs:510:11 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 1434 - .collect::>() [INFO] [stdout] 1435 - .into_iter(), [INFO] [stdout] 1434 + .collect::>(), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `filter_map` with an identity function [INFO] [stdout] --> src/util.rs:1432:22 [INFO] [stdout] | [INFO] [stdout] 1432 | .filter_map(|x| x) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_map_identity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/util.rs:1504:18 [INFO] [stdout] | [INFO] [stdout] 1504 | .map(|instr| match instr { [INFO] [stdout] | __________________^ [INFO] [stdout] 1505 | | Instr::Block(Block { seq }) => { [INFO] [stdout] 1506 | | vec![seq] [INFO] [stdout] ... | [INFO] [stdout] 1528 | | }) [INFO] [stdout] 1529 | | .flatten() [INFO] [stdout] | |__________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] = note: `#[warn(clippy::map_flatten)]` on by default [INFO] [stdout] help: try replacing `map` with `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 1504 ~ .flat_map(|instr| match instr { [INFO] [stdout] 1505 + Instr::Block(Block { seq }) => { [INFO] [stdout] 1506 + vec![seq] [INFO] [stdout] 1507 + } [INFO] [stdout] 1508 + Instr::Loop(Loop { seq }) => { [INFO] [stdout] 1509 + vec![seq] [INFO] [stdout] 1510 + } [INFO] [stdout] 1511 + Instr::Br(Br { block }) => { [INFO] [stdout] 1512 + vec![block] [INFO] [stdout] 1513 + } [INFO] [stdout] 1514 + Instr::BrIf(BrIf { block }) => { [INFO] [stdout] 1515 + vec![block] [INFO] [stdout] 1516 + } [INFO] [stdout] 1517 + Instr::IfElse(IfElse { [INFO] [stdout] 1518 + alternative, [INFO] [stdout] 1519 + consequent, [INFO] [stdout] 1520 + }) => { [INFO] [stdout] 1521 + vec![alternative, consequent] [INFO] [stdout] 1522 + } [INFO] [stdout] 1523 + Instr::BrTable(BrTable { blocks, default }) => blocks [INFO] [stdout] 1524 + .iter() [INFO] [stdout] 1525 + .chain(std::iter::once(default)) [INFO] [stdout] 1526 + .collect::>(), [INFO] [stdout] 1527 + _ => Vec::new(), [INFO] [stdout] 1528 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/util.rs:1531:46 [INFO] [stdout] | [INFO] [stdout] 1531 | if !seq_map.contains_key(&b) { [INFO] [stdout] | ^^ help: change this to: `b` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/util.rs:1798:13 [INFO] [stdout] | [INFO] [stdout] 1798 | / match &self.get(fid).kind { [INFO] [stdout] 1799 | | FunctionKind::Local(imported_function) => { [INFO] [stdout] 1800 | | imported_function [INFO] [stdout] 1801 | | .read(|instr, _| { [INFO] [stdout] ... | [INFO] [stdout] 1826 | | _ => {} [INFO] [stdout] 1827 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 1798 ~ if let FunctionKind::Local(imported_function) = &self.get(fid).kind { [INFO] [stdout] 1799 + imported_function [INFO] [stdout] 1800 + .read(|instr, _| { [INFO] [stdout] 1801 + use walrus::ir::*; [INFO] [stdout] 1802 + match instr { [INFO] [stdout] 1803 + Instr::Call(Call { func }) [INFO] [stdout] 1804 + | Instr::ReturnCall(ReturnCall { func, .. }) => { [INFO] [stdout] 1805 + if !children.contains(func) { [INFO] [stdout] 1806 + children.push(*func); [INFO] [stdout] 1807 + stack.push(*func); [INFO] [stdout] 1808 + } [INFO] [stdout] 1809 + } [INFO] [stdout] 1810 + Instr::CallIndirect(call) if !allow_call_indirect => { [INFO] [stdout] 1811 + eyre::bail!("Call indirect found: {call:?} in find children"); [INFO] [stdout] 1812 + } [INFO] [stdout] 1813 + Instr::ReturnCallIndirect(call) if !allow_call_indirect => { [INFO] [stdout] 1814 + eyre::bail!( [INFO] [stdout] 1815 + "Return call indirect found: {call:?} in find children" [INFO] [stdout] 1816 + ); [INFO] [stdout] 1817 + } [INFO] [stdout] 1818 + _ => {} [INFO] [stdout] 1819 + } [INFO] [stdout] 1820 + Ok(()) [INFO] [stdout] 1821 + })? [INFO] [stdout] 1822 + .into_iter() [INFO] [stdout] 1823 + .collect::>>()?; [INFO] [stdout] 1824 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/util.rs:1806:37 [INFO] [stdout] | [INFO] [stdout] 1806 | / ... if !children.contains(func) { [INFO] [stdout] 1807 | | ... children.push(*func); [INFO] [stdout] 1808 | | ... stack.push(*func); [INFO] [stdout] 1809 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 1805 ~ | Instr::ReturnCall(ReturnCall { func, .. }) [INFO] [stdout] 1806 ~ if !children.contains(func) => { [INFO] [stdout] 1807 | children.push(*func); [INFO] [stdout] 1808 | stack.push(*func); [INFO] [stdout] 1809 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `if let .. else` expression looks like `matches!` macro [INFO] [stdout] --> src/util.rs:1880:17 [INFO] [stdout] | [INFO] [stdout] 1880 | / if let walrus::FunctionKind::Local(_) = self.get(*fid).kind { [INFO] [stdout] 1881 | | true [INFO] [stdout] 1882 | | } else { [INFO] [stdout] 1883 | | false [INFO] [stdout] 1884 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 1880 - if let walrus::FunctionKind::Local(_) = self.get(*fid).kind { [INFO] [stdout] 1881 - true [INFO] [stdout] 1882 - } else { [INFO] [stdout] 1883 - false [INFO] [stdout] 1884 - } [INFO] [stdout] 1880 + matches!(self.get(*fid).kind, walrus::FunctionKind::Local(_)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `if let .. else` expression looks like `matches!` macro [INFO] [stdout] --> src/util.rs:1904:17 [INFO] [stdout] | [INFO] [stdout] 1904 | / if let walrus::FunctionKind::Local(_) = self.get(*fid).kind { [INFO] [stdout] 1905 | | true [INFO] [stdout] 1906 | | } else { [INFO] [stdout] 1907 | | false [INFO] [stdout] 1908 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 1904 - if let walrus::FunctionKind::Local(_) = self.get(*fid).kind { [INFO] [stdout] 1905 - true [INFO] [stdout] 1906 - } else { [INFO] [stdout] 1907 - false [INFO] [stdout] 1908 - } [INFO] [stdout] 1904 + matches!(self.get(*fid).kind, walrus::FunctionKind::Local(_)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/util.rs:2158:33 [INFO] [stdout] | [INFO] [stdout] 2158 | if self.iter().any(|im| match im.kind { [INFO] [stdout] | _________________________________^ [INFO] [stdout] 2159 | | walrus::ImportKind::Function(f) if f == fid => true, [INFO] [stdout] 2160 | | _ => false, [INFO] [stdout] 2161 | | }) { [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 2158 - if self.iter().any(|im| match im.kind { [INFO] [stdout] 2159 - walrus::ImportKind::Function(f) if f == fid => true, [INFO] [stdout] 2160 - _ => false, [INFO] [stdout] 2161 - }) { [INFO] [stdout] 2158 + if self.iter().any(|im| matches!(im.kind, walrus::ImportKind::Function(f) if f == fid)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/util.rs:2169:33 [INFO] [stdout] | [INFO] [stdout] 2169 | if self.iter().any(|im| match im.kind { [INFO] [stdout] | _________________________________^ [INFO] [stdout] 2170 | | walrus::ImportKind::Function(f) if f == fid => true, [INFO] [stdout] 2171 | | _ => false, [INFO] [stdout] 2172 | | }) { [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 2169 - if self.iter().any(|im| match im.kind { [INFO] [stdout] 2170 - walrus::ImportKind::Function(f) if f == fid => true, [INFO] [stdout] 2171 - _ => false, [INFO] [stdout] 2172 - }) { [INFO] [stdout] 2169 + if self.iter().any(|im| matches!(im.kind, walrus::ImportKind::Function(f) if f == fid)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/util.rs:2232:33 [INFO] [stdout] | [INFO] [stdout] 2232 | if self.iter().any(|ex| match ex.item { [INFO] [stdout] | _________________________________^ [INFO] [stdout] 2233 | | walrus::ExportItem::Function(f) if f == fid => true, [INFO] [stdout] 2234 | | _ => false, [INFO] [stdout] 2235 | | }) { [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 2232 - if self.iter().any(|ex| match ex.item { [INFO] [stdout] 2233 - walrus::ExportItem::Function(f) if f == fid => true, [INFO] [stdout] 2234 - _ => false, [INFO] [stdout] 2235 - }) { [INFO] [stdout] 2232 + if self.iter().any(|ex| matches!(ex.item, walrus::ExportItem::Function(f) if f == fid)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/util.rs:2243:33 [INFO] [stdout] | [INFO] [stdout] 2243 | if self.iter().any(|ex| match ex.item { [INFO] [stdout] | _________________________________^ [INFO] [stdout] 2244 | | walrus::ExportItem::Function(f) if f == fid => true, [INFO] [stdout] 2245 | | _ => false, [INFO] [stdout] 2246 | | }) { [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 2243 - if self.iter().any(|ex| match ex.item { [INFO] [stdout] 2244 - walrus::ExportItem::Function(f) if f == fid => true, [INFO] [stdout] 2245 - _ => false, [INFO] [stdout] 2246 - }) { [INFO] [stdout] 2243 + if self.iter().any(|ex| matches!(ex.item, walrus::ExportItem::Function(f) if f == fid)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/util.rs:2375:9 [INFO] [stdout] | [INFO] [stdout] 2375 | &self.0 [INFO] [stdout] | ^^^^^^^ help: change this to: `self.0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/util.rs:2380:9 [INFO] [stdout] | [INFO] [stdout] 2380 | &self.0 [INFO] [stdout] | ^^^^^^^ help: change this to: `self.0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/generator/mod.rs:1620:13 [INFO] [stdout] | [INFO] [stdout] 1620 | if let Some(_) = $runner.get_generator_ref::<$ty>().ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] ::: src/lib.rs:70:9 [INFO] [stdout] | [INFO] [stdout] 70 | add_generator!(component_runner); [INFO] [stdout] | -------------------------------- in this macro invocation [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] = note: this warning originates in the macro `generator::add_generators_by_type` which comes from the expansion of the macro `add_generator` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] help: consider matching on `Ok(_)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 1620 - if let Some(_) = $runner.get_generator_ref::<$ty>().ok() { [INFO] [stdout] 1620 + if let Ok(_) = $runner.get_generator_ref::<$ty>() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/lib.rs:94:13 [INFO] [stdout] | [INFO] [stdout] 94 | &vfs_manifest_path, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: change this to: `vfs_manifest_path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/lib.rs:118:13 [INFO] [stdout] | [INFO] [stdout] 118 | &vfs_manifest_path, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: change this to: `vfs_manifest_path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/lib.rs:137:13 [INFO] [stdout] | [INFO] [stdout] 137 | &vfs_manifest_path, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: change this to: `vfs_manifest_path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/lib.rs:152:13 [INFO] [stdout] | [INFO] [stdout] 152 | &vfs_manifest_path, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: change this to: `vfs_manifest_path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/generator/mod.rs:1620:13 [INFO] [stdout] | [INFO] [stdout] 1620 | if let Some(_) = $runner.get_generator_ref::<$ty>().ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] ::: src/lib.rs:175:5 [INFO] [stdout] | [INFO] [stdout] 175 | add_generator!(generator); [INFO] [stdout] | ------------------------- in this macro invocation [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] = note: this warning originates in the macro `generator::add_generators_by_type` which comes from the expansion of the macro `add_generator` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] help: consider matching on `Ok(_)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 1620 - if let Some(_) = $runner.get_generator_ref::<$ty>().ok() { [INFO] [stdout] 1620 + if let Ok(_) = $runner.get_generator_ref::<$ty>() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 59.36s [INFO] running `Command { std: "docker" "inspect" "6307cd28dec0fa5df0c9e59be437d9d32b08d6580612ac2e91042fd5bdaeda9b", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "6307cd28dec0fa5df0c9e59be437d9d32b08d6580612ac2e91042fd5bdaeda9b", kill_on_drop: false }` [INFO] [stdout] 6307cd28dec0fa5df0c9e59be437d9d32b08d6580612ac2e91042fd5bdaeda9b