[INFO] fetching crate ferrisup 0.2.5... [INFO] linting ferrisup-0.2.5 against nightly for clippy-nonminimal_bool-denied [INFO] extracting crate ferrisup 0.2.5 into /workspace/builds/worker-2-tc1/source [INFO] started tweaking crates.io crate ferrisup 0.2.5 [INFO] removed 0 missing tests [INFO] finished tweaking crates.io crate ferrisup 0.2.5 [INFO] tweaked toml for crates.io crate ferrisup 0.2.5 written to /workspace/builds/worker-2-tc1/source/Cargo.toml [INFO] validating manifest of crates.io crate ferrisup 0.2.5 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 ferrisup 0.2.5 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 security-framework-sys v2.14.0 [INFO] [stderr] Downloaded simd-adler32 v0.3.7 [INFO] [stderr] Downloaded libredox v0.1.3 [INFO] [stderr] Downloaded tempfile v3.20.0 [INFO] [stderr] Downloaded dirs v5.0.1 [INFO] [stderr] Downloaded is-terminal v0.4.16 [INFO] [stderr] Downloaded anstyle-query v1.1.3 [INFO] [stderr] Downloaded shell-words v1.1.0 [INFO] [stderr] Downloaded weezl v0.1.10 [INFO] [stderr] Downloaded anstream v0.6.19 [INFO] [stderr] Downloaded env_logger v0.10.2 [INFO] [stderr] Downloaded clap_derive v4.5.40 [INFO] [stderr] Downloaded bytemuck v1.23.1 [INFO] [stderr] Downloaded handlebars v4.5.0 [INFO] [stderr] Downloaded rayon v1.10.0 [INFO] [stderr] Downloaded flate2 v1.1.2 [INFO] [stderr] Downloaded rayon-core v1.12.1 [INFO] [stderr] Downloaded h2 v0.3.26 [INFO] [stderr] Downloaded schannel v0.1.27 [INFO] [stderr] Downloaded unicode-width v0.2.1 [INFO] [stderr] Downloaded gif v0.13.1 [INFO] [stderr] Downloaded slab v0.4.10 [INFO] [stderr] Downloaded dialoguer v0.10.4 [INFO] [stderr] Downloaded exr v1.73.0 [INFO] [stderr] Downloaded humantime v2.2.0 [INFO] [stderr] Downloaded bit_field v0.10.2 [INFO] [stderr] Downloaded ferrisup-common v0.2.5 [INFO] [stderr] Downloaded anstyle-wincon v3.0.9 [INFO] [stderr] Downloaded lebe v0.5.2 [INFO] [stderr] Downloaded term_size v0.3.2 [INFO] [stderr] Downloaded jpeg-decoder v0.3.1 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-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] 7cad89b4c65f809447f5c5e9e8b1b78fbd38a907a96907906f3f0fdfa3510977 [INFO] running `Command { std: "docker" "start" "-a" "7cad89b4c65f809447f5c5e9e8b1b78fbd38a907a96907906f3f0fdfa3510977", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "7cad89b4c65f809447f5c5e9e8b1b78fbd38a907a96907906f3f0fdfa3510977", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "7cad89b4c65f809447f5c5e9e8b1b78fbd38a907a96907906f3f0fdfa3510977", kill_on_drop: false }` [INFO] [stdout] 7cad89b4c65f809447f5c5e9e8b1b78fbd38a907a96907906f3f0fdfa3510977 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-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] cdbcb9df559b6b481f1d0a214058ba734489591a3f33d28b344fa4f80be87e5c [INFO] running `Command { std: "docker" "start" "-a" "cdbcb9df559b6b481f1d0a214058ba734489591a3f33d28b344fa4f80be87e5c", kill_on_drop: false }` [INFO] [stderr] Compiling libc v0.2.174 [INFO] [stderr] Checking once_cell v1.21.3 [INFO] [stderr] Checking stable_deref_trait v1.2.0 [INFO] [stderr] Checking memchr v2.7.5 [INFO] [stderr] Compiling shlex v1.3.0 [INFO] [stderr] Compiling pkg-config v0.3.32 [INFO] [stderr] Compiling vcpkg v0.2.15 [INFO] [stderr] Checking pin-project-lite v0.2.16 [INFO] [stderr] Checking bytes v1.10.1 [INFO] [stderr] Compiling thiserror v2.0.12 [INFO] [stderr] Checking litemap v0.8.0 [INFO] [stderr] Checking writeable v0.6.1 [INFO] [stderr] Checking hashbrown v0.15.4 [INFO] [stderr] Checking simd-adler32 v0.3.7 [INFO] [stderr] Compiling syn v2.0.106 [INFO] [stderr] Compiling icu_properties_data v2.0.1 [INFO] [stderr] Compiling icu_normalizer_data v2.0.0 [INFO] [stderr] Checking smallvec v1.15.1 [INFO] [stderr] Compiling rayon-core v1.12.1 [INFO] [stderr] Checking futures-core v0.3.31 [INFO] [stderr] Compiling cc v1.2.27 [INFO] [stderr] Checking fnv v1.0.7 [INFO] [stderr] Checking foreign-types-shared v0.1.1 [INFO] [stderr] Checking log v0.4.27 [INFO] [stderr] Compiling openssl v0.10.73 [INFO] [stderr] Checking foreign-types v0.3.2 [INFO] [stderr] Checking miniz_oxide v0.8.9 [INFO] [stderr] Checking tracing-core v0.1.34 [INFO] [stderr] Compiling native-tls v0.2.14 [INFO] [stderr] Compiling getrandom v0.3.3 [INFO] [stderr] Checking futures-io v0.3.31 [INFO] [stderr] Compiling rustix v1.0.7 [INFO] [stderr] Checking futures-task v0.3.31 [INFO] [stderr] Compiling ucd-trie v0.1.7 [INFO] [stderr] Checking slab v0.4.10 [INFO] [stderr] Checking futures-sink v0.3.31 [INFO] [stderr] Checking pin-utils v0.1.0 [INFO] [stderr] Compiling httparse v1.10.1 [INFO] [stderr] Checking crc32fast v1.4.2 [INFO] [stderr] Checking try-lock v0.2.5 [INFO] [stderr] Checking futures-util v0.3.31 [INFO] [stderr] Compiling serde_json v1.0.140 [INFO] [stderr] Checking tracing v0.1.41 [INFO] [stderr] Checking percent-encoding v2.3.1 [INFO] [stderr] Checking http v0.2.12 [INFO] [stderr] Checking openssl-probe v0.1.6 [INFO] [stderr] Checking mio v1.0.4 [INFO] [stderr] Checking socket2 v0.6.0 [INFO] [stderr] Checking form_urlencoded v1.2.1 [INFO] [stderr] Checking socket2 v0.5.10 [INFO] [stderr] Checking rayon v1.10.0 [INFO] [stderr] Checking want v0.3.1 [INFO] [stderr] Checking flate2 v1.1.2 [INFO] [stderr] Checking aho-corasick v1.1.3 [INFO] [stderr] Checking futures-channel v0.3.31 [INFO] [stderr] Checking unicode-width v0.2.1 [INFO] [stderr] Checking httpdate v1.0.3 [INFO] [stderr] Checking tokio v1.47.1 [INFO] [stderr] Checking indexmap v2.9.0 [INFO] [stderr] Checking winnow v0.7.11 [INFO] [stderr] Checking utf8_iter v1.0.4 [INFO] [stderr] Checking toml_write v0.1.2 [INFO] [stderr] Checking tower-service v0.3.3 [INFO] [stderr] Checking weezl v0.1.10 [INFO] [stderr] Compiling anyhow v1.0.98 [INFO] [stderr] Compiling portable-atomic v1.11.1 [INFO] [stderr] Checking anstyle-query v1.1.3 [INFO] [stderr] Checking console v0.15.11 [INFO] [stderr] Checking anstream v0.6.19 [INFO] [stderr] Checking http-body v0.4.6 [INFO] [stderr] Checking zune-inflate v0.2.54 [INFO] [stderr] Checking fdeflate v0.3.7 [INFO] [stderr] Checking half v2.6.0 [INFO] [stderr] Checking bitflags v1.3.2 [INFO] [stderr] Checking base64 v0.21.7 [INFO] [stderr] Checking option-ext v0.2.0 [INFO] [stderr] Checking lebe v0.5.2 [INFO] [stderr] Checking color_quant v1.1.0 [INFO] [stderr] Checking bytemuck v1.23.1 [INFO] [stderr] Checking bit_field v0.10.2 [INFO] [stderr] Checking dirs-sys v0.4.1 [INFO] [stderr] Checking gif v0.13.1 [INFO] [stderr] Checking png v0.17.16 [INFO] [stderr] Checking clap_builder v4.5.40 [INFO] [stderr] Checking exr v1.73.0 [INFO] [stderr] Checking rustls-pemfile v1.0.4 [INFO] [stderr] Compiling openssl-sys v0.9.109 [INFO] [stderr] Checking qoi v0.4.1 [INFO] [stderr] Checking is-terminal v0.4.16 [INFO] [stderr] Checking encoding_rs v0.8.35 [INFO] [stderr] Checking regex-automata v0.4.9 [INFO] [stderr] Checking sync_wrapper v0.1.2 [INFO] [stderr] Checking termcolor v1.4.1 [INFO] [stderr] Checking iana-time-zone v0.1.63 [INFO] [stderr] Checking ipnet v2.11.0 [INFO] [stderr] Checking colored v3.0.0 [INFO] [stderr] Checking tempfile v3.20.0 [INFO] [stderr] Checking shell-words v1.1.0 [INFO] [stderr] Compiling ferrisup v0.2.5 (/opt/rustwide/workdir) [INFO] [stderr] Checking zeroize v1.8.1 [INFO] [stderr] Checking mime v0.3.17 [INFO] [stderr] Checking humantime v2.2.0 [INFO] [stderr] Checking number_prefix v0.4.0 [INFO] [stderr] Checking byteorder v1.5.0 [INFO] [stderr] Checking chrono v0.4.41 [INFO] [stderr] Checking dirs v5.0.1 [INFO] [stderr] Checking term_size v0.3.2 [INFO] [stderr] Checking lazy_static v1.5.0 [INFO] [stderr] Checking fs_extra v1.3.0 [INFO] [stderr] Checking dialoguer v0.10.4 [INFO] [stderr] Checking indicatif v0.17.11 [INFO] [stderr] Checking jpeg-decoder v0.3.1 [INFO] [stderr] Checking tiff v0.9.1 [INFO] [stderr] Checking regex v1.11.1 [INFO] [stderr] Checking env_logger v0.10.2 [INFO] [stderr] Compiling synstructure v0.13.2 [INFO] [stderr] Checking image v0.24.9 [INFO] [stderr] Compiling zerofrom-derive v0.1.6 [INFO] [stderr] Compiling yoke-derive v0.8.0 [INFO] [stderr] Compiling zerovec-derive v0.11.1 [INFO] [stderr] Compiling displaydoc v0.2.5 [INFO] [stderr] Compiling serde_derive v1.0.219 [INFO] [stderr] Compiling thiserror-impl v2.0.12 [INFO] [stderr] Compiling openssl-macros v0.1.1 [INFO] [stderr] Compiling thiserror-impl v1.0.69 [INFO] [stderr] Compiling clap_derive v4.5.40 [INFO] [stderr] Checking tokio-util v0.7.15 [INFO] [stderr] Checking h2 v0.3.26 [INFO] [stderr] Checking pest v2.8.1 [INFO] [stderr] Checking zerofrom v0.1.6 [INFO] [stderr] Checking yoke v0.8.0 [INFO] [stderr] Checking zerovec v0.11.2 [INFO] [stderr] Checking zerotrie v0.2.2 [INFO] [stderr] Checking thiserror v1.0.69 [INFO] [stderr] Checking clap v4.5.40 [INFO] [stderr] Compiling pest_meta v2.8.1 [INFO] [stderr] Checking tinystr v0.8.1 [INFO] [stderr] Checking potential_utf v0.1.2 [INFO] [stderr] Checking icu_locale_core v2.0.0 [INFO] [stderr] Checking icu_collections v2.0.0 [INFO] [stderr] Compiling pest_generator v2.8.1 [INFO] [stderr] Checking hyper v0.14.32 [INFO] [stderr] Checking serde v1.0.219 [INFO] [stderr] Checking icu_provider v2.0.0 [INFO] [stderr] Checking icu_normalizer v2.0.0 [INFO] [stderr] Checking icu_properties v2.0.1 [INFO] [stderr] Compiling pest_derive v2.8.1 [INFO] [stderr] Checking tokio-native-tls v0.3.1 [INFO] [stderr] Checking idna_adapter v1.2.1 [INFO] [stderr] Checking idna v1.0.3 [INFO] [stderr] Checking url v2.5.4 [INFO] [stderr] Checking toml_datetime v0.6.11 [INFO] [stderr] Checking serde_spanned v0.6.9 [INFO] [stderr] Checking serde_urlencoded v0.7.1 [INFO] [stderr] Checking hyper-tls v0.5.0 [INFO] [stderr] Checking toml_edit v0.22.27 [INFO] [stderr] Checking handlebars v4.5.0 [INFO] [stderr] Checking reqwest v0.11.27 [INFO] [stderr] Checking toml v0.8.23 [INFO] [stderr] Checking ferrisup-common v0.2.5 [INFO] [stdout] warning: duplicated attribute [INFO] [stdout] --> src/project/templates/manager.rs:683:9 [INFO] [stdout] | [INFO] [stdout] 683 | #[allow(dead_code)] [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: first defined here [INFO] [stdout] --> src/project/templates/manager.rs:679:9 [INFO] [stdout] | [INFO] [stdout] 679 | #[allow(dead_code)] [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] help: remove this attribute [INFO] [stdout] --> src/project/templates/manager.rs:683:9 [INFO] [stdout] | [INFO] [stdout] 683 | #[allow(dead_code)] [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#duplicated_attributes [INFO] [stdout] = note: `#[warn(clippy::duplicated_attributes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty line after outer attribute [INFO] [stdout] --> src/project/templates/manager.rs:679:1 [INFO] [stdout] | [INFO] [stdout] 679 | / #[allow(dead_code)] [INFO] [stdout] 680 | | // Removed unused import [INFO] [stdout] 681 | | [INFO] [stdout] | |_^ [INFO] [stdout] ... [INFO] [stdout] 684 | fn evaluate_condition(condition: &str, variables: &Value) -> bool { [INFO] [stdout] | --------------------- the attribute applies to this function [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_outer_attr [INFO] [stdout] = note: `#[warn(clippy::empty_line_after_outer_attr)]` on by default [INFO] [stdout] = help: if the empty line is unintentional, remove it [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: duplicated attribute [INFO] [stdout] --> src/project/templates/manager.rs:683:9 [INFO] [stdout] | [INFO] [stdout] 683 | #[allow(dead_code)] [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: first defined here [INFO] [stdout] --> src/project/templates/manager.rs:679:9 [INFO] [stdout] | [INFO] [stdout] 679 | #[allow(dead_code)] [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] help: remove this attribute [INFO] [stdout] --> src/project/templates/manager.rs:683:9 [INFO] [stdout] | [INFO] [stdout] 683 | #[allow(dead_code)] [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#duplicated_attributes [INFO] [stdout] = note: `#[warn(clippy::duplicated_attributes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty line after outer attribute [INFO] [stdout] --> src/project/templates/manager.rs:679:1 [INFO] [stdout] | [INFO] [stdout] 679 | / #[allow(dead_code)] [INFO] [stdout] 680 | | // Removed unused import [INFO] [stdout] 681 | | [INFO] [stdout] | |_^ [INFO] [stdout] ... [INFO] [stdout] 684 | fn evaluate_condition(condition: &str, variables: &Value) -> bool { [INFO] [stdout] | --------------------- the attribute applies to this function [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_outer_attr [INFO] [stdout] = note: `#[warn(clippy::empty_line_after_outer_attr)]` on by default [INFO] [stdout] = help: if the empty line is unintentional, remove it [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/project/handlers/cli.rs:41:5 [INFO] [stdout] | [INFO] [stdout] 41 | / pub fn new( [INFO] [stdout] 42 | | name: &str, [INFO] [stdout] 43 | | description: &str, [INFO] [stdout] 44 | | templates: Vec, [INFO] [stdout] ... | [INFO] [stdout] 49 | | version_check_command: Option, [INFO] [stdout] 50 | | ) -> Self { [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: manual implementation of `Iterator::find` [INFO] [stdout] --> src/project/handlers/mod.rs:178:5 [INFO] [stdout] | [INFO] [stdout] 178 | / for handler in get_handlers() { [INFO] [stdout] 179 | | if handler.can_handle(template_name, variables) { [INFO] [stdout] 180 | | return Some(handler); [INFO] [stdout] ... | [INFO] [stdout] 184 | | None [INFO] [stdout] | |________^ help: replace with an iterator: `get_handlers().into_iter().find(|handler| handler.can_handle(template_name, variables)).map(|v| v as _)` [INFO] [stdout] | [INFO] [stdout] = note: you may need to dereference some variables [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: this `map_or` can be simplified [INFO] [stdout] --> src/project/templates/manager.rs:266:12 [INFO] [stdout] | [INFO] [stdout] 266 | if source_abs_path.extension().map_or(false, |ext| ext == "template") { [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] 266 - if source_abs_path.extension().map_or(false, |ext| ext == "template") { [INFO] [stdout] 266 + if source_abs_path.extension().is_some_and(|ext| ext == "template") { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/project/templates/manager.rs:364:48 [INFO] [stdout] | [INFO] [stdout] 364 | ... if source_abs_path.extension().map_or(false, |ext| ext == "template") { [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] 364 - if source_abs_path.extension().map_or(false, |ext| ext == "template") { [INFO] [stdout] 364 + if source_abs_path.extension().is_some_and(|ext| ext == "template") { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/project/templates/manager.rs:762:9 [INFO] [stdout] | [INFO] [stdout] 762 | temp_cargo_content.push_str("\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `temp_cargo_content.push('\n')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] = note: `#[warn(clippy::single_char_add_str)]` 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/project/templates/mod.rs:340:51 [INFO] [stdout] | [INFO] [stdout] 340 | process_template_directory(&template_dir, &target_dir, &template_vars, &mut handlebars)?; [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `target_dir` [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 `map_or` can be simplified [INFO] [stdout] --> src/project/templates/mod.rs:383:16 [INFO] [stdout] | [INFO] [stdout] 383 | if path.extension().map_or(false, |ext| [INFO] [stdout] | ________________^ [INFO] [stdout] 384 | | ext == "template" || ext == "rs" || ext == "md" || ext == "toml" || [INFO] [stdout] 385 | | ext == "html" || ext == "css" || ext == "json" || ext == "yml" || ext == "yaml" [INFO] [stdout] 386 | | ) { [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] 383 - if path.extension().map_or(false, |ext| [INFO] [stdout] 383 + if path.extension().is_some_and(|ext| [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/project/handlers/cli.rs:41:5 [INFO] [stdout] | [INFO] [stdout] 41 | / pub fn new( [INFO] [stdout] 42 | | name: &str, [INFO] [stdout] 43 | | description: &str, [INFO] [stdout] 44 | | templates: Vec, [INFO] [stdout] ... | [INFO] [stdout] 49 | | version_check_command: Option, [INFO] [stdout] 50 | | ) -> Self { [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: this `map_or` can be simplified [INFO] [stdout] --> src/project/templates/mod.rs:406:16 [INFO] [stdout] | [INFO] [stdout] 406 | if target_path.extension().map_or(false, |ext| ext == "sh") { [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] 406 - if target_path.extension().map_or(false, |ext| ext == "sh") { [INFO] [stdout] 406 + if target_path.extension().is_some_and(|ext| ext == "sh") { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Iterator::find` [INFO] [stdout] --> src/project/handlers/mod.rs:178:5 [INFO] [stdout] | [INFO] [stdout] 178 | / for handler in get_handlers() { [INFO] [stdout] 179 | | if handler.can_handle(template_name, variables) { [INFO] [stdout] 180 | | return Some(handler); [INFO] [stdout] ... | [INFO] [stdout] 184 | | None [INFO] [stdout] | |________^ help: replace with an iterator: `get_handlers().into_iter().find(|handler| handler.can_handle(template_name, variables)).map(|v| v as _)` [INFO] [stdout] | [INFO] [stdout] = note: you may need to dereference some variables [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: this `map_or` can be simplified [INFO] [stdout] --> src/project/templates/manager.rs:266:12 [INFO] [stdout] | [INFO] [stdout] 266 | if source_abs_path.extension().map_or(false, |ext| ext == "template") { [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] 266 - if source_abs_path.extension().map_or(false, |ext| ext == "template") { [INFO] [stdout] 266 + if source_abs_path.extension().is_some_and(|ext| ext == "template") { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/project/templates/manager.rs:364:48 [INFO] [stdout] | [INFO] [stdout] 364 | ... if source_abs_path.extension().map_or(false, |ext| ext == "template") { [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] 364 - if source_abs_path.extension().map_or(false, |ext| ext == "template") { [INFO] [stdout] 364 + if source_abs_path.extension().is_some_and(|ext| ext == "template") { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/project/templates/manager.rs:762:9 [INFO] [stdout] | [INFO] [stdout] 762 | temp_cargo_content.push_str("\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `temp_cargo_content.push('\n')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] = note: `#[warn(clippy::single_char_add_str)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/project/templates/mod.rs:1100:21 [INFO] [stdout] | [INFO] [stdout] 1100 | .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [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] 1100 - .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [INFO] [stdout] 1100 + .filter(|e| e.path().extension().is_some_and(|ext| ext == "rs")); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: replacing text with itself [INFO] [stdout] --> src/project/templates/mod.rs:1125:31 [INFO] [stdout] | [INFO] [stdout] 1125 | updated_content = updated_content.replace("fn batch(&self, items: Vec<", "fn batch(&self, items: Vec<"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#no_effect_replace [INFO] [stdout] = note: `#[warn(clippy::no_effect_replace)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/project/templates/mod.rs:1141:21 [INFO] [stdout] | [INFO] [stdout] 1141 | .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [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] 1141 - .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [INFO] [stdout] 1141 + .filter(|e| e.path().extension().is_some_and(|ext| ext == "rs")); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/project/templates/mod.rs:1155:31 [INFO] [stdout] | [INFO] [stdout] 1155 | updated_content = Regex::new(r"\.early_stopping\(MetricEarlyStoppingStrategy::new\(\s*&([a-zA-Z0-9_::<>]+)::new\(\),") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/project/templates/mod.rs:1143:5 [INFO] [stdout] | [INFO] [stdout] 1143 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] = note: `#[warn(clippy::regex_creation_in_loops)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/project/templates/mod.rs:1167:31 [INFO] [stdout] | [INFO] [stdout] 1167 | ... updated_content = Regex::new(r"\.early_stopping\(MetricEarlyStoppingStrategy::new\(\s*&([a-zA-Z0-9_]+)::<([a-zA-Z0-9_]+)>::n... [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/project/templates/mod.rs:1143:5 [INFO] [stdout] | [INFO] [stdout] 1143 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/project/templates/mod.rs:1198:21 [INFO] [stdout] | [INFO] [stdout] 1198 | .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [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] 1198 - .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [INFO] [stdout] 1198 + .filter(|e| e.path().extension().is_some_and(|ext| ext == "rs")); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/project/templates/mod.rs:1246:31 [INFO] [stdout] | [INFO] [stdout] 1246 | updated_content = Regex::new(r"Tensor::from_data\(([^,]+),\s*device\)") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/project/templates/mod.rs:1200:5 [INFO] [stdout] | [INFO] [stdout] 1200 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/project/templates/mod.rs:1252:31 [INFO] [stdout] | [INFO] [stdout] 1252 | updated_content = Regex::new(r"Tensor::from_data\(([^,]+),\s*&device\)") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/project/templates/mod.rs:1200:5 [INFO] [stdout] | [INFO] [stdout] 1200 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/project/templates/mod.rs:1286:25 [INFO] [stdout] | [INFO] [stdout] 1286 | .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [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] 1286 - .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [INFO] [stdout] 1286 + .filter(|e| e.path().extension().is_some_and(|ext| ext == "rs")); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/project/templates/mod.rs:1360:13 [INFO] [stdout] | [INFO] [stdout] 1360 | updated_content = updated_content + "\n\n[lib]\ncrate-type = [\"cdylib\", \"rlib\"]\n"; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `updated_content += "\n\n[lib]\ncrate-type = [\"cdylib\", \"rlib\"]\n"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/project/templates/mod.rs:1395:21 [INFO] [stdout] | [INFO] [stdout] 1395 | .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [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] 1395 - .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [INFO] [stdout] 1395 + .filter(|e| e.path().extension().is_some_and(|ext| ext == "rs")); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/project/templates/mod.rs:1409:31 [INFO] [stdout] | [INFO] [stdout] 1409 | updated_content = Regex::new(r"SGD::new\(\s*([a-zA-Z0-9_]+),\s*SGDConfig") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/project/templates/mod.rs:1397:5 [INFO] [stdout] | [INFO] [stdout] 1397 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/project/templates/mod.rs:1417:31 [INFO] [stdout] | [INFO] [stdout] 1417 | updated_content = Regex::new(r"Adam::new\(\s*([a-zA-Z0-9_]+),\s*AdamConfig") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/project/templates/mod.rs:1397:5 [INFO] [stdout] | [INFO] [stdout] 1397 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/project/templates/mod.rs:1425:31 [INFO] [stdout] | [INFO] [stdout] 1425 | updated_content = Regex::new(r"RMSprop::new\(\s*([a-zA-Z0-9_]+),\s*RMSpropConfig") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/project/templates/mod.rs:1397:5 [INFO] [stdout] | [INFO] [stdout] 1397 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/project/templates/mod.rs:1433:31 [INFO] [stdout] | [INFO] [stdout] 1433 | updated_content = Regex::new(r"AdamW::new\(\s*([a-zA-Z0-9_]+),\s*AdamWConfig") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/project/templates/mod.rs:1397:5 [INFO] [stdout] | [INFO] [stdout] 1397 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/project/templates/mod.rs:1441:31 [INFO] [stdout] | [INFO] [stdout] 1441 | updated_content = Regex::new(r"([a-zA-Z0-9_]+)\.step\(\s*([a-zA-Z0-9_]+),\s*&mut\s+([a-zA-Z0-9_]+)\s*\)") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/project/templates/mod.rs:1397:5 [INFO] [stdout] | [INFO] [stdout] 1397 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/project/templates/mod.rs:1462:21 [INFO] [stdout] | [INFO] [stdout] 1462 | .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [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] 1462 - .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [INFO] [stdout] 1462 + .filter(|e| e.path().extension().is_some_and(|ext| ext == "rs")); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: replacing text with itself [INFO] [stdout] --> src/project/templates/mod.rs:1489:31 [INFO] [stdout] | [INFO] [stdout] 1489 | updated_content = updated_content.replace( [INFO] [stdout] | _______________________________^ [INFO] [stdout] 1490 | | "use burn::loss::Loss;", [INFO] [stdout] 1491 | | "use burn::loss::Loss;" [INFO] [stdout] 1492 | | ); [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#no_effect_replace [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/project/templates/mod.rs:340:51 [INFO] [stdout] | [INFO] [stdout] 340 | process_template_directory(&template_dir, &target_dir, &template_vars, &mut handlebars)?; [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `target_dir` [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: replacing text with itself [INFO] [stdout] --> src/project/templates/mod.rs:1495:31 [INFO] [stdout] | [INFO] [stdout] 1495 | updated_content = updated_content.replace( [INFO] [stdout] | _______________________________^ [INFO] [stdout] 1496 | | "use burn::loss::MSELoss;", [INFO] [stdout] 1497 | | "use burn::loss::MSELoss;" [INFO] [stdout] 1498 | | ); [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#no_effect_replace [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: replacing text with itself [INFO] [stdout] --> src/project/templates/mod.rs:1501:31 [INFO] [stdout] | [INFO] [stdout] 1501 | updated_content = updated_content.replace( [INFO] [stdout] | _______________________________^ [INFO] [stdout] 1502 | | "use burn::loss::CrossEntropyLoss;", [INFO] [stdout] 1503 | | "use burn::loss::CrossEntropyLoss;" [INFO] [stdout] 1504 | | ); [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#no_effect_replace [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: replacing text with itself [INFO] [stdout] --> src/project/templates/mod.rs:1507:31 [INFO] [stdout] | [INFO] [stdout] 1507 | updated_content = updated_content.replace( [INFO] [stdout] | _______________________________^ [INFO] [stdout] 1508 | | "use burn::loss::NLLLoss;", [INFO] [stdout] 1509 | | "use burn::loss::NLLLoss;" [INFO] [stdout] 1510 | | ); [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#no_effect_replace [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/project/templates/mod.rs:1533:21 [INFO] [stdout] | [INFO] [stdout] 1533 | .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [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] 1533 - .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [INFO] [stdout] 1533 + .filter(|e| e.path().extension().is_some_and(|ext| ext == "rs")); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/project/templates/mod.rs:1547:31 [INFO] [stdout] | [INFO] [stdout] 1547 | updated_content = Regex::new(r"Learner::new\(\s*([a-zA-Z0-9_]+),\s*([a-zA-Z0-9_]+)\s*\)") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/project/templates/mod.rs:1535:5 [INFO] [stdout] | [INFO] [stdout] 1535 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/project/templates/mod.rs:1555:31 [INFO] [stdout] | [INFO] [stdout] 1555 | updated_content = Regex::new(r"TrainingStep::new\(\s*([a-zA-Z0-9_]+),\s*([a-zA-Z0-9_]+)\s*\)") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/project/templates/mod.rs:1535:5 [INFO] [stdout] | [INFO] [stdout] 1535 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/project/templates/mod.rs:1563:45 [INFO] [stdout] | [INFO] [stdout] 1563 | let optimizer_pattern = Regex::new(r"let\s+([a-zA-Z0-9_]+)\s*=\s*[A-Za-z0-9_]+::new\(").unwrap(); [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/project/templates/mod.rs:1535:5 [INFO] [stdout] | [INFO] [stdout] 1535 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/project/templates/mod.rs:383:16 [INFO] [stdout] | [INFO] [stdout] 383 | if path.extension().map_or(false, |ext| [INFO] [stdout] | ________________^ [INFO] [stdout] 384 | | ext == "template" || ext == "rs" || ext == "md" || ext == "toml" || [INFO] [stdout] 385 | | ext == "html" || ext == "css" || ext == "json" || ext == "yml" || ext == "yaml" [INFO] [stdout] 386 | | ) { [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] 383 - if path.extension().map_or(false, |ext| [INFO] [stdout] 383 + if path.extension().is_some_and(|ext| [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/project/templates/mod.rs:1577:31 [INFO] [stdout] | [INFO] [stdout] 1577 | updated_content = Regex::new(r"([a-zA-Z0-9_]+)\.forward\(([a-zA-Z0-9_]+)\)") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/project/templates/mod.rs:1535:5 [INFO] [stdout] | [INFO] [stdout] 1535 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/project/templates/mod.rs:1585:31 [INFO] [stdout] | [INFO] [stdout] 1585 | updated_content = Regex::new(r"([a-zA-Z0-9_]+)\.step\(([a-zA-Z0-9_]+)\)") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/project/templates/mod.rs:1535:5 [INFO] [stdout] | [INFO] [stdout] 1535 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/project/templates/mod.rs:1611:21 [INFO] [stdout] | [INFO] [stdout] 1611 | .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [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] 1611 - .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [INFO] [stdout] 1611 + .filter(|e| e.path().extension().is_some_and(|ext| ext == "rs")); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: replacing text with itself [INFO] [stdout] --> src/project/templates/mod.rs:1635:31 [INFO] [stdout] | [INFO] [stdout] 1635 | updated_content = updated_content.replace( [INFO] [stdout] | _______________________________^ [INFO] [stdout] 1636 | | "use burn::nn::", [INFO] [stdout] 1637 | | "use burn::nn::" [INFO] [stdout] 1638 | | ); [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#no_effect_replace [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/project/templates/mod.rs:1649:31 [INFO] [stdout] | [INFO] [stdout] 1649 | updated_content = Regex::new(r"fn\s+forward\(\s*&self,\s*([a-zA-Z0-9_]+)\s*:\s*Tensor<([^>]+)>\s*\)") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/project/templates/mod.rs:1613:5 [INFO] [stdout] | [INFO] [stdout] 1613 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/project/templates/mod.rs:1689:31 [INFO] [stdout] | [INFO] [stdout] 1689 | updated_content = Regex::new(r"(self\.forward)\(([a-zA-Z0-9_\.]+)\)") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/project/templates/mod.rs:1613:5 [INFO] [stdout] | [INFO] [stdout] 1613 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/project/templates/mod.rs:1704:31 [INFO] [stdout] | [INFO] [stdout] 1704 | updated_content = Regex::new(r"(self\.[a-zA-Z0-9_]+)\.forward\(([a-zA-Z0-9_\.]+)\)") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/project/templates/mod.rs:1613:5 [INFO] [stdout] | [INFO] [stdout] 1613 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/project/templates/mod.rs:406:16 [INFO] [stdout] | [INFO] [stdout] 406 | if target_path.extension().map_or(false, |ext| ext == "sh") { [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] 406 - if target_path.extension().map_or(false, |ext| ext == "sh") { [INFO] [stdout] 406 + if target_path.extension().is_some_and(|ext| ext == "sh") { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/project/templates/mod.rs:1717:53 [INFO] [stdout] | [INFO] [stdout] 1717 | module_name.contains("gelu") { [INFO] [stdout] | _____________________________________________________^ [INFO] [stdout] 1718 | | format!("{}.forward({})", module_name, input) [INFO] [stdout] 1719 | | } else if input.starts_with("&") { [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/project/templates/mod.rs:1719:54 [INFO] [stdout] | [INFO] [stdout] 1719 | } else if input.starts_with("&") { [INFO] [stdout] | ______________________________________________________^ [INFO] [stdout] 1720 | | format!("{}.forward({})", module_name, input) [INFO] [stdout] 1721 | | } else { [INFO] [stdout] | |_____________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] = note: `#[warn(clippy::if_same_then_else)]` 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/template_manager/mod.rs:612:51 [INFO] [stdout] | [INFO] [stdout] 612 | process_template_directory(&template_dir, &target_dir, &template_vars, &mut handlebars)?; [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `target_dir` [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/template_manager/mod.rs:615:43 [INFO] [stdout] | [INFO] [stdout] 615 | if let Ok(entries) = fs::read_dir(&target_dir) { [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `target_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] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> src/template_manager/mod.rs:616:13 [INFO] [stdout] | [INFO] [stdout] 616 | / for entry in entries { [INFO] [stdout] 617 | | if let Ok(entry) = entry { [INFO] [stdout] 618 | | let path = entry.path(); [INFO] [stdout] 619 | | let file_name = entry.file_name(); [INFO] [stdout] ... | [INFO] [stdout] 645 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/template_manager/mod.rs:617:17 [INFO] [stdout] | [INFO] [stdout] 617 | / if let Ok(entry) = entry { [INFO] [stdout] 618 | | let path = entry.path(); [INFO] [stdout] 619 | | let file_name = entry.file_name(); [INFO] [stdout] 620 | | let file_name_str = file_name.to_string_lossy(); [INFO] [stdout] ... | [INFO] [stdout] 644 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] = note: `#[warn(clippy::manual_flatten)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 616 ~ for entry in entries.flatten() { [INFO] [stdout] 617 + let path = entry.path(); [INFO] [stdout] 618 + let file_name = entry.file_name(); [INFO] [stdout] 619 + let file_name_str = file_name.to_string_lossy(); [INFO] [stdout] 620 + [INFO] [stdout] 621 + if path.is_file() && file_name_str.ends_with(".template") { [INFO] [stdout] 622 + println!("Post-processing template file: {}", path.display()); [INFO] [stdout] 623 + [INFO] [stdout] 624 + // Read the template file [INFO] [stdout] 625 + let content = fs::read_to_string(&path)?; [INFO] [stdout] 626 + [INFO] [stdout] 627 + // Render with handlebars [INFO] [stdout] 628 + let rendered = handlebars.render_template(&content, &template_vars) [INFO] [stdout] 629 + .map_err(|e| anyhow!("Failed to render template {}: {}", path.display(), e))?; [INFO] [stdout] 630 + [INFO] [stdout] 631 + // Create the target path without .template extension [INFO] [stdout] 632 + let new_name = file_name_str.trim_end_matches(".template"); [INFO] [stdout] 633 + let target_path = target_dir.join(new_name); [INFO] [stdout] 634 + [INFO] [stdout] 635 + // Write the rendered content [INFO] [stdout] 636 + fs::write(&target_path, rendered)?; [INFO] [stdout] 637 + [INFO] [stdout] 638 + // Remove the original .template file [INFO] [stdout] 639 + fs::remove_file(&path)?; [INFO] [stdout] 640 + [INFO] [stdout] 641 + println!("Processed template file: {} -> {}", path.display(), target_path.display()); [INFO] [stdout] 642 + } [INFO] [stdout] 643 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/project/templates/mod.rs:1100:21 [INFO] [stdout] | [INFO] [stdout] 1100 | .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [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] 1100 - .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [INFO] [stdout] 1100 + .filter(|e| e.path().extension().is_some_and(|ext| ext == "rs")); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: replacing text with itself [INFO] [stdout] --> src/project/templates/mod.rs:1125:31 [INFO] [stdout] | [INFO] [stdout] 1125 | updated_content = updated_content.replace("fn batch(&self, items: Vec<", "fn batch(&self, items: Vec<"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#no_effect_replace [INFO] [stdout] = note: `#[warn(clippy::no_effect_replace)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/project/templates/mod.rs:1141:21 [INFO] [stdout] | [INFO] [stdout] 1141 | .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [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] 1141 - .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [INFO] [stdout] 1141 + .filter(|e| e.path().extension().is_some_and(|ext| ext == "rs")); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/project/templates/mod.rs:1155:31 [INFO] [stdout] | [INFO] [stdout] 1155 | updated_content = Regex::new(r"\.early_stopping\(MetricEarlyStoppingStrategy::new\(\s*&([a-zA-Z0-9_::<>]+)::new\(\),") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/project/templates/mod.rs:1143:5 [INFO] [stdout] | [INFO] [stdout] 1143 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] = note: `#[warn(clippy::regex_creation_in_loops)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/project/templates/mod.rs:1167:31 [INFO] [stdout] | [INFO] [stdout] 1167 | ... updated_content = Regex::new(r"\.early_stopping\(MetricEarlyStoppingStrategy::new\(\s*&([a-zA-Z0-9_]+)::<([a-zA-Z0-9_]+)>::n... [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/project/templates/mod.rs:1143:5 [INFO] [stdout] | [INFO] [stdout] 1143 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/project/templates/mod.rs:1198:21 [INFO] [stdout] | [INFO] [stdout] 1198 | .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [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] 1198 - .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [INFO] [stdout] 1198 + .filter(|e| e.path().extension().is_some_and(|ext| ext == "rs")); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/template_manager/mod.rs:706:28 [INFO] [stdout] | [INFO] [stdout] 706 | if source_path.extension().map_or(false, |ext| ext == "template") { [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] 706 - if source_path.extension().map_or(false, |ext| ext == "template") { [INFO] [stdout] 706 + if source_path.extension().is_some_and(|ext| ext == "template") { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/project/templates/mod.rs:1246:31 [INFO] [stdout] | [INFO] [stdout] 1246 | updated_content = Regex::new(r"Tensor::from_data\(([^,]+),\s*device\)") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/project/templates/mod.rs:1200:5 [INFO] [stdout] | [INFO] [stdout] 1200 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/project/templates/mod.rs:1252:31 [INFO] [stdout] | [INFO] [stdout] 1252 | updated_content = Regex::new(r"Tensor::from_data\(([^,]+),\s*&device\)") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/project/templates/mod.rs:1200:5 [INFO] [stdout] | [INFO] [stdout] 1200 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/project/templates/mod.rs:1286:25 [INFO] [stdout] | [INFO] [stdout] 1286 | .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [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] 1286 - .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [INFO] [stdout] 1286 + .filter(|e| e.path().extension().is_some_and(|ext| ext == "rs")); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/project/templates/mod.rs:1360:13 [INFO] [stdout] | [INFO] [stdout] 1360 | updated_content = updated_content + "\n\n[lib]\ncrate-type = [\"cdylib\", \"rlib\"]\n"; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `updated_content += "\n\n[lib]\ncrate-type = [\"cdylib\", \"rlib\"]\n"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/project/templates/mod.rs:1395:21 [INFO] [stdout] | [INFO] [stdout] 1395 | .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [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] 1395 - .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [INFO] [stdout] 1395 + .filter(|e| e.path().extension().is_some_and(|ext| ext == "rs")); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/project/templates/mod.rs:1409:31 [INFO] [stdout] | [INFO] [stdout] 1409 | updated_content = Regex::new(r"SGD::new\(\s*([a-zA-Z0-9_]+),\s*SGDConfig") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/project/templates/mod.rs:1397:5 [INFO] [stdout] | [INFO] [stdout] 1397 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/project/templates/mod.rs:1417:31 [INFO] [stdout] | [INFO] [stdout] 1417 | updated_content = Regex::new(r"Adam::new\(\s*([a-zA-Z0-9_]+),\s*AdamConfig") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/project/templates/mod.rs:1397:5 [INFO] [stdout] | [INFO] [stdout] 1397 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/project/templates/mod.rs:1425:31 [INFO] [stdout] | [INFO] [stdout] 1425 | updated_content = Regex::new(r"RMSprop::new\(\s*([a-zA-Z0-9_]+),\s*RMSpropConfig") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/project/templates/mod.rs:1397:5 [INFO] [stdout] | [INFO] [stdout] 1397 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/project/templates/mod.rs:1433:31 [INFO] [stdout] | [INFO] [stdout] 1433 | updated_content = Regex::new(r"AdamW::new\(\s*([a-zA-Z0-9_]+),\s*AdamWConfig") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/project/templates/mod.rs:1397:5 [INFO] [stdout] | [INFO] [stdout] 1397 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/project/templates/mod.rs:1441:31 [INFO] [stdout] | [INFO] [stdout] 1441 | updated_content = Regex::new(r"([a-zA-Z0-9_]+)\.step\(\s*([a-zA-Z0-9_]+),\s*&mut\s+([a-zA-Z0-9_]+)\s*\)") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/project/templates/mod.rs:1397:5 [INFO] [stdout] | [INFO] [stdout] 1397 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/project/templates/mod.rs:1462:21 [INFO] [stdout] | [INFO] [stdout] 1462 | .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [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] 1462 - .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [INFO] [stdout] 1462 + .filter(|e| e.path().extension().is_some_and(|ext| ext == "rs")); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: replacing text with itself [INFO] [stdout] --> src/project/templates/mod.rs:1489:31 [INFO] [stdout] | [INFO] [stdout] 1489 | updated_content = updated_content.replace( [INFO] [stdout] | _______________________________^ [INFO] [stdout] 1490 | | "use burn::loss::Loss;", [INFO] [stdout] 1491 | | "use burn::loss::Loss;" [INFO] [stdout] 1492 | | ); [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#no_effect_replace [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: replacing text with itself [INFO] [stdout] --> src/project/templates/mod.rs:1495:31 [INFO] [stdout] | [INFO] [stdout] 1495 | updated_content = updated_content.replace( [INFO] [stdout] | _______________________________^ [INFO] [stdout] 1496 | | "use burn::loss::MSELoss;", [INFO] [stdout] 1497 | | "use burn::loss::MSELoss;" [INFO] [stdout] 1498 | | ); [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#no_effect_replace [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: replacing text with itself [INFO] [stdout] --> src/project/templates/mod.rs:1501:31 [INFO] [stdout] | [INFO] [stdout] 1501 | updated_content = updated_content.replace( [INFO] [stdout] | _______________________________^ [INFO] [stdout] 1502 | | "use burn::loss::CrossEntropyLoss;", [INFO] [stdout] 1503 | | "use burn::loss::CrossEntropyLoss;" [INFO] [stdout] 1504 | | ); [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#no_effect_replace [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: replacing text with itself [INFO] [stdout] --> src/project/templates/mod.rs:1507:31 [INFO] [stdout] | [INFO] [stdout] 1507 | updated_content = updated_content.replace( [INFO] [stdout] | _______________________________^ [INFO] [stdout] 1508 | | "use burn::loss::NLLLoss;", [INFO] [stdout] 1509 | | "use burn::loss::NLLLoss;" [INFO] [stdout] 1510 | | ); [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#no_effect_replace [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/project/templates/mod.rs:1533:21 [INFO] [stdout] | [INFO] [stdout] 1533 | .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [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] 1533 - .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [INFO] [stdout] 1533 + .filter(|e| e.path().extension().is_some_and(|ext| ext == "rs")); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/project/templates/mod.rs:1547:31 [INFO] [stdout] | [INFO] [stdout] 1547 | updated_content = Regex::new(r"Learner::new\(\s*([a-zA-Z0-9_]+),\s*([a-zA-Z0-9_]+)\s*\)") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/project/templates/mod.rs:1535:5 [INFO] [stdout] | [INFO] [stdout] 1535 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/project/templates/mod.rs:1555:31 [INFO] [stdout] | [INFO] [stdout] 1555 | updated_content = Regex::new(r"TrainingStep::new\(\s*([a-zA-Z0-9_]+),\s*([a-zA-Z0-9_]+)\s*\)") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/project/templates/mod.rs:1535:5 [INFO] [stdout] | [INFO] [stdout] 1535 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/project/templates/mod.rs:1563:45 [INFO] [stdout] | [INFO] [stdout] 1563 | let optimizer_pattern = Regex::new(r"let\s+([a-zA-Z0-9_]+)\s*=\s*[A-Za-z0-9_]+::new\(").unwrap(); [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/project/templates/mod.rs:1535:5 [INFO] [stdout] | [INFO] [stdout] 1535 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/template_manager/mod.rs:1013:16 [INFO] [stdout] | [INFO] [stdout] 1013 | if target_path.extension().map_or(false, |ext| ext == "sh") { [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] 1013 - if target_path.extension().map_or(false, |ext| ext == "sh") { [INFO] [stdout] 1013 + if target_path.extension().is_some_and(|ext| ext == "sh") { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/project/templates/mod.rs:1577:31 [INFO] [stdout] | [INFO] [stdout] 1577 | updated_content = Regex::new(r"([a-zA-Z0-9_]+)\.forward\(([a-zA-Z0-9_]+)\)") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/project/templates/mod.rs:1535:5 [INFO] [stdout] | [INFO] [stdout] 1535 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/project/templates/mod.rs:1585:31 [INFO] [stdout] | [INFO] [stdout] 1585 | updated_content = Regex::new(r"([a-zA-Z0-9_]+)\.step\(([a-zA-Z0-9_]+)\)") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/project/templates/mod.rs:1535:5 [INFO] [stdout] | [INFO] [stdout] 1535 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/project/templates/mod.rs:1611:21 [INFO] [stdout] | [INFO] [stdout] 1611 | .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [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] 1611 - .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [INFO] [stdout] 1611 + .filter(|e| e.path().extension().is_some_and(|ext| ext == "rs")); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: replacing text with itself [INFO] [stdout] --> src/project/templates/mod.rs:1635:31 [INFO] [stdout] | [INFO] [stdout] 1635 | updated_content = updated_content.replace( [INFO] [stdout] | _______________________________^ [INFO] [stdout] 1636 | | "use burn::nn::", [INFO] [stdout] 1637 | | "use burn::nn::" [INFO] [stdout] 1638 | | ); [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#no_effect_replace [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/project/templates/mod.rs:1649:31 [INFO] [stdout] | [INFO] [stdout] 1649 | updated_content = Regex::new(r"fn\s+forward\(\s*&self,\s*([a-zA-Z0-9_]+)\s*:\s*Tensor<([^>]+)>\s*\)") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/project/templates/mod.rs:1613:5 [INFO] [stdout] | [INFO] [stdout] 1613 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/project/templates/mod.rs:1689:31 [INFO] [stdout] | [INFO] [stdout] 1689 | updated_content = Regex::new(r"(self\.forward)\(([a-zA-Z0-9_\.]+)\)") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/project/templates/mod.rs:1613:5 [INFO] [stdout] | [INFO] [stdout] 1613 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> src/template_manager/mod.rs:1041:17 [INFO] [stdout] | [INFO] [stdout] 1041 | / for target_entry in target_entries { [INFO] [stdout] 1042 | | if let Ok(target_entry) = target_entry { [INFO] [stdout] 1043 | | let target_path = target_entry.path(); [INFO] [stdout] 1044 | | let target_file_name = target_entry.file_name(); [INFO] [stdout] ... | [INFO] [stdout] 1070 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/template_manager/mod.rs:1042:21 [INFO] [stdout] | [INFO] [stdout] 1042 | / if let Ok(target_entry) = target_entry { [INFO] [stdout] 1043 | | let target_path = target_entry.path(); [INFO] [stdout] 1044 | | let target_file_name = target_entry.file_name(); [INFO] [stdout] 1045 | | let target_file_str = target_file_name.to_string_lossy(); [INFO] [stdout] ... | [INFO] [stdout] 1069 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 1041 ~ for target_entry in target_entries.flatten() { [INFO] [stdout] 1042 + let target_path = target_entry.path(); [INFO] [stdout] 1043 + let target_file_name = target_entry.file_name(); [INFO] [stdout] 1044 + let target_file_str = target_file_name.to_string_lossy(); [INFO] [stdout] 1045 + [INFO] [stdout] 1046 + if target_path.is_file() && target_file_str.ends_with(".template") { [INFO] [stdout] 1047 + println!("Processing remaining template file: {}", target_path.display()); [INFO] [stdout] 1048 + [INFO] [stdout] 1049 + // Read the template file [INFO] [stdout] 1050 + let content = fs::read_to_string(&target_path)?; [INFO] [stdout] 1051 + [INFO] [stdout] 1052 + // Render with handlebars [INFO] [stdout] 1053 + let rendered = handlebars.render_template(&content, template_vars) [INFO] [stdout] 1054 + .map_err(|e| anyhow!("Failed to render template {}: {}", target_path.display(), e))?; [INFO] [stdout] 1055 + [INFO] [stdout] 1056 + // Create the target path without .template extension [INFO] [stdout] 1057 + let new_name = target_file_str.trim_end_matches(".template"); [INFO] [stdout] 1058 + let new_target_path = target_dir.join(new_name); [INFO] [stdout] 1059 + [INFO] [stdout] 1060 + // Write the rendered content [INFO] [stdout] 1061 + fs::write(&new_target_path, rendered)?; [INFO] [stdout] 1062 + [INFO] [stdout] 1063 + // Remove the original .template file [INFO] [stdout] 1064 + fs::remove_file(&target_path)?; [INFO] [stdout] 1065 + [INFO] [stdout] 1066 + println!("Processed template file: {} -> {}", target_path.display(), new_target_path.display()); [INFO] [stdout] 1067 + } [INFO] [stdout] 1068 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/project/templates/mod.rs:1704:31 [INFO] [stdout] | [INFO] [stdout] 1704 | updated_content = Regex::new(r"(self\.[a-zA-Z0-9_]+)\.forward\(([a-zA-Z0-9_\.]+)\)") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/project/templates/mod.rs:1613:5 [INFO] [stdout] | [INFO] [stdout] 1613 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/project/templates/mod.rs:1717:53 [INFO] [stdout] | [INFO] [stdout] 1717 | module_name.contains("gelu") { [INFO] [stdout] | _____________________________________________________^ [INFO] [stdout] 1718 | | format!("{}.forward({})", module_name, input) [INFO] [stdout] 1719 | | } else if input.starts_with("&") { [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/project/templates/mod.rs:1719:54 [INFO] [stdout] | [INFO] [stdout] 1719 | } else if input.starts_with("&") { [INFO] [stdout] | ______________________________________________________^ [INFO] [stdout] 1720 | | format!("{}.forward({})", module_name, input) [INFO] [stdout] 1721 | | } else { [INFO] [stdout] | |_____________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] = note: `#[warn(clippy::if_same_then_else)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/template_manager/mod.rs:1660:21 [INFO] [stdout] | [INFO] [stdout] 1660 | .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [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] 1660 - .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [INFO] [stdout] 1660 + .filter(|e| e.path().extension().is_some_and(|ext| ext == "rs")); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: replacing text with itself [INFO] [stdout] --> src/template_manager/mod.rs:1685:31 [INFO] [stdout] | [INFO] [stdout] 1685 | updated_content = updated_content.replace("fn batch(&self, items: Vec<", "fn batch(&self, items: Vec<"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#no_effect_replace [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/template_manager/mod.rs:1701:21 [INFO] [stdout] | [INFO] [stdout] 1701 | .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [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] 1701 - .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [INFO] [stdout] 1701 + .filter(|e| e.path().extension().is_some_and(|ext| ext == "rs")); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/template_manager/mod.rs:1715:31 [INFO] [stdout] | [INFO] [stdout] 1715 | updated_content = Regex::new(r"\.early_stopping\(MetricEarlyStoppingStrategy::new\(\s*&([a-zA-Z0-9_::<>]+)::new\(\),") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/template_manager/mod.rs:1703:5 [INFO] [stdout] | [INFO] [stdout] 1703 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/template_manager/mod.rs:1727:31 [INFO] [stdout] | [INFO] [stdout] 1727 | ... updated_content = Regex::new(r"\.early_stopping\(MetricEarlyStoppingStrategy::new\(\s*&([a-zA-Z0-9_]+)::<([a-zA-Z0-9_]+)>::n... [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/template_manager/mod.rs:1703:5 [INFO] [stdout] | [INFO] [stdout] 1703 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/template_manager/mod.rs:1758:21 [INFO] [stdout] | [INFO] [stdout] 1758 | .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [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] 1758 - .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [INFO] [stdout] 1758 + .filter(|e| e.path().extension().is_some_and(|ext| ext == "rs")); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/template_manager/mod.rs:1806:31 [INFO] [stdout] | [INFO] [stdout] 1806 | updated_content = Regex::new(r"Tensor::from_data\(([^,]+),\s*device\)") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/template_manager/mod.rs:1760:5 [INFO] [stdout] | [INFO] [stdout] 1760 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/template_manager/mod.rs:1812:31 [INFO] [stdout] | [INFO] [stdout] 1812 | updated_content = Regex::new(r"Tensor::from_data\(([^,]+),\s*&device\)") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/template_manager/mod.rs:1760:5 [INFO] [stdout] | [INFO] [stdout] 1760 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/template_manager/mod.rs:1846:25 [INFO] [stdout] | [INFO] [stdout] 1846 | .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [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] 1846 - .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [INFO] [stdout] 1846 + .filter(|e| e.path().extension().is_some_and(|ext| ext == "rs")); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/template_manager/mod.rs:1920:13 [INFO] [stdout] | [INFO] [stdout] 1920 | updated_content = updated_content + "\n\n[lib]\ncrate-type = [\"cdylib\", \"rlib\"]\n"; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `updated_content += "\n\n[lib]\ncrate-type = [\"cdylib\", \"rlib\"]\n"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/template_manager/mod.rs:2049:21 [INFO] [stdout] | [INFO] [stdout] 2049 | .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [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] 2049 - .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [INFO] [stdout] 2049 + .filter(|e| e.path().extension().is_some_and(|ext| ext == "rs")); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/template_manager/mod.rs:2063:31 [INFO] [stdout] | [INFO] [stdout] 2063 | updated_content = Regex::new(r"SGD::new\(\s*([a-zA-Z0-9_]+),\s*SGDConfig") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/template_manager/mod.rs:2051:5 [INFO] [stdout] | [INFO] [stdout] 2051 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/template_manager/mod.rs:2071:31 [INFO] [stdout] | [INFO] [stdout] 2071 | updated_content = Regex::new(r"Adam::new\(\s*([a-zA-Z0-9_]+),\s*AdamConfig") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/template_manager/mod.rs:2051:5 [INFO] [stdout] | [INFO] [stdout] 2051 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/template_manager/mod.rs:2079:31 [INFO] [stdout] | [INFO] [stdout] 2079 | updated_content = Regex::new(r"RMSprop::new\(\s*([a-zA-Z0-9_]+),\s*RMSpropConfig") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/template_manager/mod.rs:2051:5 [INFO] [stdout] | [INFO] [stdout] 2051 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/template_manager/mod.rs:2087:31 [INFO] [stdout] | [INFO] [stdout] 2087 | updated_content = Regex::new(r"AdamW::new\(\s*([a-zA-Z0-9_]+),\s*AdamWConfig") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/template_manager/mod.rs:2051:5 [INFO] [stdout] | [INFO] [stdout] 2051 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/template_manager/mod.rs:2095:31 [INFO] [stdout] | [INFO] [stdout] 2095 | updated_content = Regex::new(r"([a-zA-Z0-9_]+)\.step\(\s*([a-zA-Z0-9_]+),\s*&mut\s+([a-zA-Z0-9_]+)\s*\)") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/template_manager/mod.rs:2051:5 [INFO] [stdout] | [INFO] [stdout] 2051 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/template_manager/mod.rs:2119:21 [INFO] [stdout] | [INFO] [stdout] 2119 | .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [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] 2119 - .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [INFO] [stdout] 2119 + .filter(|e| e.path().extension().is_some_and(|ext| ext == "rs")); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: replacing text with itself [INFO] [stdout] --> src/template_manager/mod.rs:2146:31 [INFO] [stdout] | [INFO] [stdout] 2146 | updated_content = updated_content.replace( [INFO] [stdout] | _______________________________^ [INFO] [stdout] 2147 | | "use burn::loss::Loss;", [INFO] [stdout] 2148 | | "use burn::loss::Loss;" [INFO] [stdout] 2149 | | ); [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#no_effect_replace [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: replacing text with itself [INFO] [stdout] --> src/template_manager/mod.rs:2152:31 [INFO] [stdout] | [INFO] [stdout] 2152 | updated_content = updated_content.replace( [INFO] [stdout] | _______________________________^ [INFO] [stdout] 2153 | | "use burn::loss::MSELoss;", [INFO] [stdout] 2154 | | "use burn::loss::MSELoss;" [INFO] [stdout] 2155 | | ); [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#no_effect_replace [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: replacing text with itself [INFO] [stdout] --> src/template_manager/mod.rs:2158:31 [INFO] [stdout] | [INFO] [stdout] 2158 | updated_content = updated_content.replace( [INFO] [stdout] | _______________________________^ [INFO] [stdout] 2159 | | "use burn::loss::CrossEntropyLoss;", [INFO] [stdout] 2160 | | "use burn::loss::CrossEntropyLoss;" [INFO] [stdout] 2161 | | ); [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#no_effect_replace [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: replacing text with itself [INFO] [stdout] --> src/template_manager/mod.rs:2164:31 [INFO] [stdout] | [INFO] [stdout] 2164 | updated_content = updated_content.replace( [INFO] [stdout] | _______________________________^ [INFO] [stdout] 2165 | | "use burn::loss::NLLLoss;", [INFO] [stdout] 2166 | | "use burn::loss::NLLLoss;" [INFO] [stdout] 2167 | | ); [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#no_effect_replace [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/template_manager/mod.rs:2190:21 [INFO] [stdout] | [INFO] [stdout] 2190 | .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [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] 2190 - .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [INFO] [stdout] 2190 + .filter(|e| e.path().extension().is_some_and(|ext| ext == "rs")); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/template_manager/mod.rs:2204:31 [INFO] [stdout] | [INFO] [stdout] 2204 | updated_content = Regex::new(r"Learner::new\(\s*([a-zA-Z0-9_]+),\s*([a-zA-Z0-9_]+)\s*\)") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/template_manager/mod.rs:2192:5 [INFO] [stdout] | [INFO] [stdout] 2192 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/template_manager/mod.rs:2212:31 [INFO] [stdout] | [INFO] [stdout] 2212 | updated_content = Regex::new(r"TrainingStep::new\(\s*([a-zA-Z0-9_]+),\s*([a-zA-Z0-9_]+)\s*\)") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/template_manager/mod.rs:2192:5 [INFO] [stdout] | [INFO] [stdout] 2192 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/template_manager/mod.rs:2220:45 [INFO] [stdout] | [INFO] [stdout] 2220 | let optimizer_pattern = Regex::new(r"let\s+([a-zA-Z0-9_]+)\s*=\s*[A-Za-z0-9_]+::new\(").unwrap(); [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/template_manager/mod.rs:2192:5 [INFO] [stdout] | [INFO] [stdout] 2192 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/template_manager/mod.rs:2234:31 [INFO] [stdout] | [INFO] [stdout] 2234 | updated_content = Regex::new(r"([a-zA-Z0-9_]+)\.forward\(([a-zA-Z0-9_]+)\)") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/template_manager/mod.rs:2192:5 [INFO] [stdout] | [INFO] [stdout] 2192 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/template_manager/mod.rs:612:51 [INFO] [stdout] | [INFO] [stdout] 612 | process_template_directory(&template_dir, &target_dir, &template_vars, &mut handlebars)?; [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `target_dir` [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/template_manager/mod.rs:615:43 [INFO] [stdout] | [INFO] [stdout] 615 | if let Ok(entries) = fs::read_dir(&target_dir) { [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `target_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] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/template_manager/mod.rs:2242:31 [INFO] [stdout] | [INFO] [stdout] 2242 | updated_content = Regex::new(r"([a-zA-Z0-9_]+)\.step\(([a-zA-Z0-9_]+)\)") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/template_manager/mod.rs:2192:5 [INFO] [stdout] | [INFO] [stdout] 2192 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> src/template_manager/mod.rs:616:13 [INFO] [stdout] | [INFO] [stdout] 616 | / for entry in entries { [INFO] [stdout] 617 | | if let Ok(entry) = entry { [INFO] [stdout] 618 | | let path = entry.path(); [INFO] [stdout] 619 | | let file_name = entry.file_name(); [INFO] [stdout] ... | [INFO] [stdout] 645 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/template_manager/mod.rs:617:17 [INFO] [stdout] | [INFO] [stdout] 617 | / if let Ok(entry) = entry { [INFO] [stdout] 618 | | let path = entry.path(); [INFO] [stdout] 619 | | let file_name = entry.file_name(); [INFO] [stdout] 620 | | let file_name_str = file_name.to_string_lossy(); [INFO] [stdout] ... | [INFO] [stdout] 644 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] = note: `#[warn(clippy::manual_flatten)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 616 ~ for entry in entries.flatten() { [INFO] [stdout] 617 + let path = entry.path(); [INFO] [stdout] 618 + let file_name = entry.file_name(); [INFO] [stdout] 619 + let file_name_str = file_name.to_string_lossy(); [INFO] [stdout] 620 + [INFO] [stdout] 621 + if path.is_file() && file_name_str.ends_with(".template") { [INFO] [stdout] 622 + println!("Post-processing template file: {}", path.display()); [INFO] [stdout] 623 + [INFO] [stdout] 624 + // Read the template file [INFO] [stdout] 625 + let content = fs::read_to_string(&path)?; [INFO] [stdout] 626 + [INFO] [stdout] 627 + // Render with handlebars [INFO] [stdout] 628 + let rendered = handlebars.render_template(&content, &template_vars) [INFO] [stdout] 629 + .map_err(|e| anyhow!("Failed to render template {}: {}", path.display(), e))?; [INFO] [stdout] 630 + [INFO] [stdout] 631 + // Create the target path without .template extension [INFO] [stdout] 632 + let new_name = file_name_str.trim_end_matches(".template"); [INFO] [stdout] 633 + let target_path = target_dir.join(new_name); [INFO] [stdout] 634 + [INFO] [stdout] 635 + // Write the rendered content [INFO] [stdout] 636 + fs::write(&target_path, rendered)?; [INFO] [stdout] 637 + [INFO] [stdout] 638 + // Remove the original .template file [INFO] [stdout] 639 + fs::remove_file(&path)?; [INFO] [stdout] 640 + [INFO] [stdout] 641 + println!("Processed template file: {} -> {}", path.display(), target_path.display()); [INFO] [stdout] 642 + } [INFO] [stdout] 643 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/template_manager/mod.rs:2268:21 [INFO] [stdout] | [INFO] [stdout] 2268 | .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [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] 2268 - .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [INFO] [stdout] 2268 + .filter(|e| e.path().extension().is_some_and(|ext| ext == "rs")); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: replacing text with itself [INFO] [stdout] --> src/template_manager/mod.rs:2292:31 [INFO] [stdout] | [INFO] [stdout] 2292 | updated_content = updated_content.replace( [INFO] [stdout] | _______________________________^ [INFO] [stdout] 2293 | | "use burn::nn::", [INFO] [stdout] 2294 | | "use burn::nn::" [INFO] [stdout] 2295 | | ); [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#no_effect_replace [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/template_manager/mod.rs:2306:31 [INFO] [stdout] | [INFO] [stdout] 2306 | updated_content = Regex::new(r"fn\s+forward\(\s*&self,\s*([a-zA-Z0-9_]+)\s*:\s*Tensor<([^>]+)>\s*\)") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/template_manager/mod.rs:2270:5 [INFO] [stdout] | [INFO] [stdout] 2270 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/template_manager/mod.rs:706:28 [INFO] [stdout] | [INFO] [stdout] 706 | if source_path.extension().map_or(false, |ext| ext == "template") { [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] 706 - if source_path.extension().map_or(false, |ext| ext == "template") { [INFO] [stdout] 706 + if source_path.extension().is_some_and(|ext| ext == "template") { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/template_manager/mod.rs:2346:31 [INFO] [stdout] | [INFO] [stdout] 2346 | updated_content = Regex::new(r"(self\.forward)\(([a-zA-Z0-9_\.]+)\)") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/template_manager/mod.rs:2270:5 [INFO] [stdout] | [INFO] [stdout] 2270 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/template_manager/mod.rs:2361:31 [INFO] [stdout] | [INFO] [stdout] 2361 | updated_content = Regex::new(r"(self\.[a-zA-Z0-9_]+)\.forward\(([a-zA-Z0-9_\.]+)\)") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/template_manager/mod.rs:2270:5 [INFO] [stdout] | [INFO] [stdout] 2270 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/template_manager/mod.rs:1013:16 [INFO] [stdout] | [INFO] [stdout] 1013 | if target_path.extension().map_or(false, |ext| ext == "sh") { [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] 1013 - if target_path.extension().map_or(false, |ext| ext == "sh") { [INFO] [stdout] 1013 + if target_path.extension().is_some_and(|ext| ext == "sh") { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/template_manager/mod.rs:2374:53 [INFO] [stdout] | [INFO] [stdout] 2374 | module_name.contains("gelu") { [INFO] [stdout] | _____________________________________________________^ [INFO] [stdout] 2375 | | format!("{}.forward({})", module_name, input) [INFO] [stdout] 2376 | | } else if input.starts_with("&") { [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/template_manager/mod.rs:2376:54 [INFO] [stdout] | [INFO] [stdout] 2376 | } else if input.starts_with("&") { [INFO] [stdout] | ______________________________________________________^ [INFO] [stdout] 2377 | | format!("{}.forward({})", module_name, input) [INFO] [stdout] 2378 | | } else { [INFO] [stdout] | |_____________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> src/template_manager/mod.rs:1041:17 [INFO] [stdout] | [INFO] [stdout] 1041 | / for target_entry in target_entries { [INFO] [stdout] 1042 | | if let Ok(target_entry) = target_entry { [INFO] [stdout] 1043 | | let target_path = target_entry.path(); [INFO] [stdout] 1044 | | let target_file_name = target_entry.file_name(); [INFO] [stdout] ... | [INFO] [stdout] 1070 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/template_manager/mod.rs:1042:21 [INFO] [stdout] | [INFO] [stdout] 1042 | / if let Ok(target_entry) = target_entry { [INFO] [stdout] 1043 | | let target_path = target_entry.path(); [INFO] [stdout] 1044 | | let target_file_name = target_entry.file_name(); [INFO] [stdout] 1045 | | let target_file_str = target_file_name.to_string_lossy(); [INFO] [stdout] ... | [INFO] [stdout] 1069 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 1041 ~ for target_entry in target_entries.flatten() { [INFO] [stdout] 1042 + let target_path = target_entry.path(); [INFO] [stdout] 1043 + let target_file_name = target_entry.file_name(); [INFO] [stdout] 1044 + let target_file_str = target_file_name.to_string_lossy(); [INFO] [stdout] 1045 + [INFO] [stdout] 1046 + if target_path.is_file() && target_file_str.ends_with(".template") { [INFO] [stdout] 1047 + println!("Processing remaining template file: {}", target_path.display()); [INFO] [stdout] 1048 + [INFO] [stdout] 1049 + // Read the template file [INFO] [stdout] 1050 + let content = fs::read_to_string(&target_path)?; [INFO] [stdout] 1051 + [INFO] [stdout] 1052 + // Render with handlebars [INFO] [stdout] 1053 + let rendered = handlebars.render_template(&content, template_vars) [INFO] [stdout] 1054 + .map_err(|e| anyhow!("Failed to render template {}: {}", target_path.display(), e))?; [INFO] [stdout] 1055 + [INFO] [stdout] 1056 + // Create the target path without .template extension [INFO] [stdout] 1057 + let new_name = target_file_str.trim_end_matches(".template"); [INFO] [stdout] 1058 + let new_target_path = target_dir.join(new_name); [INFO] [stdout] 1059 + [INFO] [stdout] 1060 + // Write the rendered content [INFO] [stdout] 1061 + fs::write(&new_target_path, rendered)?; [INFO] [stdout] 1062 + [INFO] [stdout] 1063 + // Remove the original .template file [INFO] [stdout] 1064 + fs::remove_file(&target_path)?; [INFO] [stdout] 1065 + [INFO] [stdout] 1066 + println!("Processed template file: {} -> {}", target_path.display(), new_target_path.display()); [INFO] [stdout] 1067 + } [INFO] [stdout] 1068 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (9/7) [INFO] [stdout] --> src/commands/new.rs:21:1 [INFO] [stdout] | [INFO] [stdout] 21 | / pub fn execute( [INFO] [stdout] 22 | | name: Option<&str>, [INFO] [stdout] 23 | | component_type: Option<&str>, [INFO] [stdout] 24 | | framework: Option<&str>, [INFO] [stdout] ... | [INFO] [stdout] 30 | | _project_type: Option<&str>, [INFO] [stdout] 31 | | ) -> 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] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/template_manager/mod.rs:1660:21 [INFO] [stdout] | [INFO] [stdout] 1660 | .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [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] 1660 - .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [INFO] [stdout] 1660 + .filter(|e| e.path().extension().is_some_and(|ext| ext == "rs")); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: replacing text with itself [INFO] [stdout] --> src/template_manager/mod.rs:1685:31 [INFO] [stdout] | [INFO] [stdout] 1685 | updated_content = updated_content.replace("fn batch(&self, items: Vec<", "fn batch(&self, items: Vec<"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#no_effect_replace [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/template_manager/mod.rs:1701:21 [INFO] [stdout] | [INFO] [stdout] 1701 | .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [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] 1701 - .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [INFO] [stdout] 1701 + .filter(|e| e.path().extension().is_some_and(|ext| ext == "rs")); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/template_manager/mod.rs:1715:31 [INFO] [stdout] | [INFO] [stdout] 1715 | updated_content = Regex::new(r"\.early_stopping\(MetricEarlyStoppingStrategy::new\(\s*&([a-zA-Z0-9_::<>]+)::new\(\),") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/template_manager/mod.rs:1703:5 [INFO] [stdout] | [INFO] [stdout] 1703 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/template_manager/mod.rs:1727:31 [INFO] [stdout] | [INFO] [stdout] 1727 | ... updated_content = Regex::new(r"\.early_stopping\(MetricEarlyStoppingStrategy::new\(\s*&([a-zA-Z0-9_]+)::<([a-zA-Z0-9_]+)>::n... [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/template_manager/mod.rs:1703:5 [INFO] [stdout] | [INFO] [stdout] 1703 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/template_manager/mod.rs:1758:21 [INFO] [stdout] | [INFO] [stdout] 1758 | .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [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] 1758 - .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [INFO] [stdout] 1758 + .filter(|e| e.path().extension().is_some_and(|ext| ext == "rs")); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this pattern reimplements `Option::unwrap_or` [INFO] [stdout] --> src/commands/new.rs:416:13 [INFO] [stdout] | [INFO] [stdout] 416 | / if let Some(provider) = vars.get("cloud_provider").and_then(|p| p.as_str()) { [INFO] [stdout] 417 | | provider [INFO] [stdout] 418 | | } else { [INFO] [stdout] ... | [INFO] [stdout] 421 | | } [INFO] [stdout] | |_____________^ help: replace with: `vars.get("cloud_provider").and_then(|p| p.as_str()).unwrap_or("aws")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or [INFO] [stdout] = note: `#[warn(clippy::manual_unwrap_or)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/template_manager/mod.rs:1806:31 [INFO] [stdout] | [INFO] [stdout] 1806 | updated_content = Regex::new(r"Tensor::from_data\(([^,]+),\s*device\)") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/template_manager/mod.rs:1760:5 [INFO] [stdout] | [INFO] [stdout] 1760 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/template_manager/mod.rs:1812:31 [INFO] [stdout] | [INFO] [stdout] 1812 | updated_content = Regex::new(r"Tensor::from_data\(([^,]+),\s*&device\)") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/template_manager/mod.rs:1760:5 [INFO] [stdout] | [INFO] [stdout] 1760 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/template_manager/mod.rs:1846:25 [INFO] [stdout] | [INFO] [stdout] 1846 | .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [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] 1846 - .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [INFO] [stdout] 1846 + .filter(|e| e.path().extension().is_some_and(|ext| ext == "rs")); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/template_manager/mod.rs:1920:13 [INFO] [stdout] | [INFO] [stdout] 1920 | updated_content = updated_content + "\n\n[lib]\ncrate-type = [\"cdylib\", \"rlib\"]\n"; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `updated_content += "\n\n[lib]\ncrate-type = [\"cdylib\", \"rlib\"]\n"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/commands/new.rs:583:92 [INFO] [stdout] | [INFO] [stdout] 583 | ... if let Some(_provider_redirect) = app_redirect.get(&selected_provider) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: change this to: `selected_provider` [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/template_manager/mod.rs:2049:21 [INFO] [stdout] | [INFO] [stdout] 2049 | .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [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] 2049 - .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [INFO] [stdout] 2049 + .filter(|e| e.path().extension().is_some_and(|ext| ext == "rs")); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/template_manager/mod.rs:2063:31 [INFO] [stdout] | [INFO] [stdout] 2063 | updated_content = Regex::new(r"SGD::new\(\s*([a-zA-Z0-9_]+),\s*SGDConfig") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/template_manager/mod.rs:2051:5 [INFO] [stdout] | [INFO] [stdout] 2051 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/template_manager/mod.rs:2071:31 [INFO] [stdout] | [INFO] [stdout] 2071 | updated_content = Regex::new(r"Adam::new\(\s*([a-zA-Z0-9_]+),\s*AdamConfig") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/template_manager/mod.rs:2051:5 [INFO] [stdout] | [INFO] [stdout] 2051 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/template_manager/mod.rs:2079:31 [INFO] [stdout] | [INFO] [stdout] 2079 | updated_content = Regex::new(r"RMSprop::new\(\s*([a-zA-Z0-9_]+),\s*RMSpropConfig") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/template_manager/mod.rs:2051:5 [INFO] [stdout] | [INFO] [stdout] 2051 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/template_manager/mod.rs:2087:31 [INFO] [stdout] | [INFO] [stdout] 2087 | updated_content = Regex::new(r"AdamW::new\(\s*([a-zA-Z0-9_]+),\s*AdamWConfig") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/template_manager/mod.rs:2051:5 [INFO] [stdout] | [INFO] [stdout] 2051 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/template_manager/mod.rs:2095:31 [INFO] [stdout] | [INFO] [stdout] 2095 | updated_content = Regex::new(r"([a-zA-Z0-9_]+)\.step\(\s*([a-zA-Z0-9_]+),\s*&mut\s+([a-zA-Z0-9_]+)\s*\)") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/template_manager/mod.rs:2051:5 [INFO] [stdout] | [INFO] [stdout] 2051 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/template_manager/mod.rs:2119:21 [INFO] [stdout] | [INFO] [stdout] 2119 | .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [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] 2119 - .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [INFO] [stdout] 2119 + .filter(|e| e.path().extension().is_some_and(|ext| ext == "rs")); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: replacing text with itself [INFO] [stdout] --> src/template_manager/mod.rs:2146:31 [INFO] [stdout] | [INFO] [stdout] 2146 | updated_content = updated_content.replace( [INFO] [stdout] | _______________________________^ [INFO] [stdout] 2147 | | "use burn::loss::Loss;", [INFO] [stdout] 2148 | | "use burn::loss::Loss;" [INFO] [stdout] 2149 | | ); [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#no_effect_replace [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: replacing text with itself [INFO] [stdout] --> src/template_manager/mod.rs:2152:31 [INFO] [stdout] | [INFO] [stdout] 2152 | updated_content = updated_content.replace( [INFO] [stdout] | _______________________________^ [INFO] [stdout] 2153 | | "use burn::loss::MSELoss;", [INFO] [stdout] 2154 | | "use burn::loss::MSELoss;" [INFO] [stdout] 2155 | | ); [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#no_effect_replace [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: replacing text with itself [INFO] [stdout] --> src/template_manager/mod.rs:2158:31 [INFO] [stdout] | [INFO] [stdout] 2158 | updated_content = updated_content.replace( [INFO] [stdout] | _______________________________^ [INFO] [stdout] 2159 | | "use burn::loss::CrossEntropyLoss;", [INFO] [stdout] 2160 | | "use burn::loss::CrossEntropyLoss;" [INFO] [stdout] 2161 | | ); [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#no_effect_replace [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: replacing text with itself [INFO] [stdout] --> src/template_manager/mod.rs:2164:31 [INFO] [stdout] | [INFO] [stdout] 2164 | updated_content = updated_content.replace( [INFO] [stdout] | _______________________________^ [INFO] [stdout] 2165 | | "use burn::loss::NLLLoss;", [INFO] [stdout] 2166 | | "use burn::loss::NLLLoss;" [INFO] [stdout] 2167 | | ); [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#no_effect_replace [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/template_manager/mod.rs:2190:21 [INFO] [stdout] | [INFO] [stdout] 2190 | .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [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] 2190 - .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [INFO] [stdout] 2190 + .filter(|e| e.path().extension().is_some_and(|ext| ext == "rs")); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/template_manager/mod.rs:2204:31 [INFO] [stdout] | [INFO] [stdout] 2204 | updated_content = Regex::new(r"Learner::new\(\s*([a-zA-Z0-9_]+),\s*([a-zA-Z0-9_]+)\s*\)") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/template_manager/mod.rs:2192:5 [INFO] [stdout] | [INFO] [stdout] 2192 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/template_manager/mod.rs:2212:31 [INFO] [stdout] | [INFO] [stdout] 2212 | updated_content = Regex::new(r"TrainingStep::new\(\s*([a-zA-Z0-9_]+),\s*([a-zA-Z0-9_]+)\s*\)") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/template_manager/mod.rs:2192:5 [INFO] [stdout] | [INFO] [stdout] 2192 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this block may be rewritten with the `?` operator [INFO] [stdout] --> src/commands/new.rs:802:13 [INFO] [stdout] | [INFO] [stdout] 802 | / if let Err(e) = template_manager::apply_template( [INFO] [stdout] 803 | | &template_path, [INFO] [stdout] 804 | | app_path, [INFO] [stdout] 805 | | &name, [INFO] [stdout] ... | [INFO] [stdout] 808 | | return Err(e); [INFO] [stdout] 809 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] = note: `#[warn(clippy::question_mark)]` on by default [INFO] [stdout] help: replace it with [INFO] [stdout] | [INFO] [stdout] 802 ~ template_manager::apply_template( [INFO] [stdout] 803 + &template_path, [INFO] [stdout] 804 + app_path, [INFO] [stdout] 805 + &name, [INFO] [stdout] 806 + additional_vars, [INFO] [stdout] 807 + )?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/template_manager/mod.rs:2220:45 [INFO] [stdout] | [INFO] [stdout] 2220 | let optimizer_pattern = Regex::new(r"let\s+([a-zA-Z0-9_]+)\s*=\s*[A-Za-z0-9_]+::new\(").unwrap(); [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/template_manager/mod.rs:2192:5 [INFO] [stdout] | [INFO] [stdout] 2192 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/template_manager/mod.rs:2234:31 [INFO] [stdout] | [INFO] [stdout] 2234 | updated_content = Regex::new(r"([a-zA-Z0-9_]+)\.forward\(([a-zA-Z0-9_]+)\)") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/template_manager/mod.rs:2192:5 [INFO] [stdout] | [INFO] [stdout] 2192 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/template_manager/mod.rs:2242:31 [INFO] [stdout] | [INFO] [stdout] 2242 | updated_content = Regex::new(r"([a-zA-Z0-9_]+)\.step\(([a-zA-Z0-9_]+)\)") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/template_manager/mod.rs:2192:5 [INFO] [stdout] | [INFO] [stdout] 2192 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/template_manager/mod.rs:2268:21 [INFO] [stdout] | [INFO] [stdout] 2268 | .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [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] 2268 - .filter(|e| e.path().extension().map_or(false, |ext| ext == "rs")); [INFO] [stdout] 2268 + .filter(|e| e.path().extension().is_some_and(|ext| ext == "rs")); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: replacing text with itself [INFO] [stdout] --> src/template_manager/mod.rs:2292:31 [INFO] [stdout] | [INFO] [stdout] 2292 | updated_content = updated_content.replace( [INFO] [stdout] | _______________________________^ [INFO] [stdout] 2293 | | "use burn::nn::", [INFO] [stdout] 2294 | | "use burn::nn::" [INFO] [stdout] 2295 | | ); [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#no_effect_replace [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/template_manager/mod.rs:2306:31 [INFO] [stdout] | [INFO] [stdout] 2306 | updated_content = Regex::new(r"fn\s+forward\(\s*&self,\s*([a-zA-Z0-9_]+)\s*:\s*Tensor<([^>]+)>\s*\)") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/template_manager/mod.rs:2270:5 [INFO] [stdout] | [INFO] [stdout] 2270 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/template_manager/mod.rs:2346:31 [INFO] [stdout] | [INFO] [stdout] 2346 | updated_content = Regex::new(r"(self\.forward)\(([a-zA-Z0-9_\.]+)\)") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/template_manager/mod.rs:2270:5 [INFO] [stdout] | [INFO] [stdout] 2270 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/template_manager/mod.rs:2361:31 [INFO] [stdout] | [INFO] [stdout] 2361 | updated_content = Regex::new(r"(self\.[a-zA-Z0-9_]+)\.forward\(([a-zA-Z0-9_\.]+)\)") [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/template_manager/mod.rs:2270:5 [INFO] [stdout] | [INFO] [stdout] 2270 | for entry in entries { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/template_manager/mod.rs:2374:53 [INFO] [stdout] | [INFO] [stdout] 2374 | module_name.contains("gelu") { [INFO] [stdout] | _____________________________________________________^ [INFO] [stdout] 2375 | | format!("{}.forward({})", module_name, input) [INFO] [stdout] 2376 | | } else if input.starts_with("&") { [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/template_manager/mod.rs:2376:54 [INFO] [stdout] | [INFO] [stdout] 2376 | } else if input.starts_with("&") { [INFO] [stdout] | ______________________________________________________^ [INFO] [stdout] 2377 | | format!("{}.forward({})", module_name, input) [INFO] [stdout] 2378 | | } else { [INFO] [stdout] | |_____________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (9/7) [INFO] [stdout] --> src/commands/new.rs:21:1 [INFO] [stdout] | [INFO] [stdout] 21 | / pub fn execute( [INFO] [stdout] 22 | | name: Option<&str>, [INFO] [stdout] 23 | | component_type: Option<&str>, [INFO] [stdout] 24 | | framework: Option<&str>, [INFO] [stdout] ... | [INFO] [stdout] 30 | | _project_type: Option<&str>, [INFO] [stdout] 31 | | ) -> 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] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/commands/new.rs:1765:56 [INFO] [stdout] | [INFO] [stdout] 1765 | "project_name_pascal_case": to_pascal_case(&name), [INFO] [stdout] | ^^^^^ help: change this to: `name` [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/commands/new.rs:1820:52 [INFO] [stdout] | [INFO] [stdout] 1820 | "project_name_pascal_case": to_pascal_case(&name), [INFO] [stdout] | ^^^^^ help: change this to: `name` [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/commands/new.rs:1865:56 [INFO] [stdout] | [INFO] [stdout] 1865 | "project_name_pascal_case": to_pascal_case(&name), [INFO] [stdout] | ^^^^^ help: change this to: `name` [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/commands/new.rs:1926:60 [INFO] [stdout] | [INFO] [stdout] 1926 | "project_name_pascal_case": to_pascal_case(&name), [INFO] [stdout] | ^^^^^ help: change this to: `name` [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 pattern reimplements `Option::unwrap_or` [INFO] [stdout] --> src/commands/new.rs:416:13 [INFO] [stdout] | [INFO] [stdout] 416 | / if let Some(provider) = vars.get("cloud_provider").and_then(|p| p.as_str()) { [INFO] [stdout] 417 | | provider [INFO] [stdout] 418 | | } else { [INFO] [stdout] ... | [INFO] [stdout] 421 | | } [INFO] [stdout] | |_____________^ help: replace with: `vars.get("cloud_provider").and_then(|p| p.as_str()).unwrap_or("aws")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or [INFO] [stdout] = note: `#[warn(clippy::manual_unwrap_or)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/commands/new.rs:583:92 [INFO] [stdout] | [INFO] [stdout] 583 | ... if let Some(_provider_redirect) = app_redirect.get(&selected_provider) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: change this to: `selected_provider` [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 block may be rewritten with the `?` operator [INFO] [stdout] --> src/commands/new.rs:802:13 [INFO] [stdout] | [INFO] [stdout] 802 | / if let Err(e) = template_manager::apply_template( [INFO] [stdout] 803 | | &template_path, [INFO] [stdout] 804 | | app_path, [INFO] [stdout] 805 | | &name, [INFO] [stdout] ... | [INFO] [stdout] 808 | | return Err(e); [INFO] [stdout] 809 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] = note: `#[warn(clippy::question_mark)]` on by default [INFO] [stdout] help: replace it with [INFO] [stdout] | [INFO] [stdout] 802 ~ template_manager::apply_template( [INFO] [stdout] 803 + &template_path, [INFO] [stdout] 804 + app_path, [INFO] [stdout] 805 + &name, [INFO] [stdout] 806 + additional_vars, [INFO] [stdout] 807 + )?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/commands/preview.rs:358:48 [INFO] [stdout] | [INFO] [stdout] 358 | for (_i, app) in client.apps.iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index [INFO] [stdout] = note: `#[warn(clippy::unused_enumerate_index)]` on by default [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 358 - for (_i, app) in client.apps.iter().enumerate() { [INFO] [stdout] 358 + for app in client.apps.iter() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/commands/preview.rs:992:9 [INFO] [stdout] | [INFO] [stdout] 992 | components.minimal = Some(Minimal { name: "example".to_string() }); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `commands::preview::Components { minimal: Some(Minimal { name: "example".to_string() }), ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/commands/preview.rs:990:9 [INFO] [stdout] | [INFO] [stdout] 990 | let mut components = Components::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] = note: `#[warn(clippy::field_reassign_with_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/commands/transform/project_structure.rs:32:43 [INFO] [stdout] | [INFO] [stdout] 32 | cargo_doc.get("bin").is_some() || !cargo_doc.get("package").is_none() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `cargo_doc.get("package").is_some()` [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: this `if` statement can be collapsed [INFO] [stdout] --> src/commands/transform/workspace.rs:46:5 [INFO] [stdout] | [INFO] [stdout] 46 | / if component_name == "ferrisup_common" || component_name == "shared" || component_name.ends_with("-common") || component_name.... [INFO] [stdout] 47 | | if !is_test_mode() { [INFO] [stdout] 48 | | // Keep prompting until we get an available name [INFO] [stdout] 49 | | let mut is_available = false; [INFO] [stdout] ... | [INFO] [stdout] 86 | | } [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] 46 ~ if (component_name == "ferrisup_common" || component_name == "shared" || component_name.ends_with("-common") || component_name.ends_with("_common")) { [INFO] [stdout] 47 ~ && !is_test_mode() { [INFO] [stdout] 48 | // Keep prompting until we get an available name [INFO] [stdout] ... [INFO] [stdout] 84 | } [INFO] [stdout] 85 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/commands/new.rs:1765:56 [INFO] [stdout] | [INFO] [stdout] 1765 | "project_name_pascal_case": to_pascal_case(&name), [INFO] [stdout] | ^^^^^ help: change this to: `name` [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/commands/new.rs:1820:52 [INFO] [stdout] | [INFO] [stdout] 1820 | "project_name_pascal_case": to_pascal_case(&name), [INFO] [stdout] | ^^^^^ help: change this to: `name` [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/commands/new.rs:1865:56 [INFO] [stdout] | [INFO] [stdout] 1865 | "project_name_pascal_case": to_pascal_case(&name), [INFO] [stdout] | ^^^^^ help: change this to: `name` [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/commands/new.rs:1926:60 [INFO] [stdout] | [INFO] [stdout] 1926 | "project_name_pascal_case": to_pascal_case(&name), [INFO] [stdout] | ^^^^^ help: change this to: `name` [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` can be collapsed into the outer `match` [INFO] [stdout] --> src/commands/transform/component.rs:327:21 [INFO] [stdout] | [INFO] [stdout] 327 | / if deps_table.get("axum").is_none() { [INFO] [stdout] 328 | | deps_table.insert("axum", toml_edit::value("0.7.4")); [INFO] [stdout] 329 | | let mut tokio_table = toml_edit::Table::new(); [INFO] [stdout] 330 | | tokio_table.insert("version", toml_edit::value("1.36.0")); [INFO] [stdout] ... | [INFO] [stdout] 334 | | deps_table.insert("tokio", toml_edit::Item::Table(tokio_table)); [INFO] [stdout] 335 | | } [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] 326 ~ "axum" [INFO] [stdout] 327 ~ if deps_table.get("axum").is_none() => { [INFO] [stdout] 328 | deps_table.insert("axum", toml_edit::value("0.7.4")); [INFO] [stdout] ... [INFO] [stdout] 334 | deps_table.insert("tokio", toml_edit::Item::Table(tokio_table)); [INFO] [stdout] 335 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/commands/transform/component.rs:338:21 [INFO] [stdout] | [INFO] [stdout] 338 | / if deps_table.get("actix-web").is_none() { [INFO] [stdout] 339 | | deps_table.insert("actix-web", toml_edit::value("4.5.1")); [INFO] [stdout] 340 | | } [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] 337 ~ "actix" [INFO] [stdout] 338 ~ if deps_table.get("actix-web").is_none() => { [INFO] [stdout] 339 | deps_table.insert("actix-web", toml_edit::value("4.5.1")); [INFO] [stdout] 340 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/commands/transform/component.rs:343:21 [INFO] [stdout] | [INFO] [stdout] 343 | / if deps_table.get("poem").is_none() { [INFO] [stdout] 344 | | deps_table.insert("poem", toml_edit::value("2.0.0")); [INFO] [stdout] 345 | | } [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] 342 ~ "poem" [INFO] [stdout] 343 ~ if deps_table.get("poem").is_none() => { [INFO] [stdout] 344 | deps_table.insert("poem", toml_edit::value("2.0.0")); [INFO] [stdout] 345 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/commands/transform/component.rs:348:21 [INFO] [stdout] | [INFO] [stdout] 348 | / if deps_table.get("leptos").is_none() { [INFO] [stdout] 349 | | deps_table.insert("leptos", toml_edit::value("0.6.5")); [INFO] [stdout] 350 | | } [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] 347 ~ "leptos" [INFO] [stdout] 348 ~ if deps_table.get("leptos").is_none() => { [INFO] [stdout] 349 | deps_table.insert("leptos", toml_edit::value("0.6.5")); [INFO] [stdout] 350 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/commands/transform/component.rs:353:21 [INFO] [stdout] | [INFO] [stdout] 353 | / if deps_table.get("dioxus").is_none() { [INFO] [stdout] 354 | | deps_table.insert("dioxus", toml_edit::value("0.4.3")); [INFO] [stdout] 355 | | deps_table.insert("dioxus-web", toml_edit::value("0.4.3")); [INFO] [stdout] 356 | | } [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] 352 ~ "dioxus" [INFO] [stdout] 353 ~ if deps_table.get("dioxus").is_none() => { [INFO] [stdout] 354 | deps_table.insert("dioxus", toml_edit::value("0.4.3")); [INFO] [stdout] 355 | deps_table.insert("dioxus-web", toml_edit::value("0.4.3")); [INFO] [stdout] 356 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/commands/transform/component.rs:359:21 [INFO] [stdout] | [INFO] [stdout] 359 | / if deps_table.get("tauri").is_none() { [INFO] [stdout] 360 | | let mut tauri_table = toml_edit::Table::new(); [INFO] [stdout] 361 | | tauri_table.insert("version", toml_edit::value("1.6.0")); [INFO] [stdout] 362 | | let mut features_array = toml_edit::Array::new(); [INFO] [stdout] ... | [INFO] [stdout] 365 | | deps_table.insert("tauri", toml_edit::Item::Table(tauri_table)); [INFO] [stdout] 366 | | } [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] 358 ~ "tauri" [INFO] [stdout] 359 ~ if deps_table.get("tauri").is_none() => { [INFO] [stdout] 360 | let mut tauri_table = toml_edit::Table::new(); [INFO] [stdout] ... [INFO] [stdout] 365 | deps_table.insert("tauri", toml_edit::Item::Table(tauri_table)); [INFO] [stdout] 366 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/commands/transform/component.rs:369:21 [INFO] [stdout] | [INFO] [stdout] 369 | / if deps_table.get("polars").is_none() { [INFO] [stdout] 370 | | let mut polars_table = toml_edit::Table::new(); [INFO] [stdout] 371 | | polars_table.insert("version", toml_edit::value("0.38.1")); [INFO] [stdout] 372 | | let mut features_array = toml_edit::Array::new(); [INFO] [stdout] ... | [INFO] [stdout] 377 | | deps_table.insert("polars", toml_edit::Item::Table(polars_table)); [INFO] [stdout] 378 | | } [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] 368 ~ "polars" [INFO] [stdout] 369 ~ if deps_table.get("polars").is_none() => { [INFO] [stdout] 370 | let mut polars_table = toml_edit::Table::new(); [INFO] [stdout] ... [INFO] [stdout] 377 | deps_table.insert("polars", toml_edit::Item::Table(polars_table)); [INFO] [stdout] 378 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/commands/transform/component.rs:381:21 [INFO] [stdout] | [INFO] [stdout] 381 | / if deps_table.get("linfa").is_none() { [INFO] [stdout] 382 | | deps_table.insert("linfa", toml_edit::value("0.7.0")); [INFO] [stdout] 383 | | deps_table.insert("ndarray", toml_edit::value("0.15.6")); [INFO] [stdout] 384 | | } [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] 380 ~ "linfa" [INFO] [stdout] 381 ~ if deps_table.get("linfa").is_none() => { [INFO] [stdout] 382 | deps_table.insert("linfa", toml_edit::value("0.7.0")); [INFO] [stdout] 383 | deps_table.insert("ndarray", toml_edit::value("0.15.6")); [INFO] [stdout] 384 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/commands/transform/utils.rs:29:89 [INFO] [stdout] | [INFO] [stdout] 29 | let updated_content_str = crate_regex.replace_all(&updated_content, format!("{}", new_name).as_str()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `new_name.to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/commands/preview.rs:358:48 [INFO] [stdout] | [INFO] [stdout] 358 | for (_i, app) in client.apps.iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index [INFO] [stdout] = note: `#[warn(clippy::unused_enumerate_index)]` on by default [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 358 - for (_i, app) in client.apps.iter().enumerate() { [INFO] [stdout] 358 + for app in client.apps.iter() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/commands/transform/utils.rs:434:29 [INFO] [stdout] | [INFO] [stdout] 434 | let src_regex = format!(r"(src/[\w\-\.\/]+)"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `r"(src/[\w\-\.\/]+)".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/commands/transform/ui.rs:41:45 [INFO] [stdout] | [INFO] [stdout] 41 | pub fn select_option(prompt: &str, options: &Vec, default: usize) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 41 - pub fn select_option(prompt: &str, options: &Vec, default: usize) -> Result { [INFO] [stdout] 41 + pub fn select_option(prompt: &str, options: &[String], default: usize) -> Result { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/commands/transform/workspace_utils.rs:18:6 [INFO] [stdout] | [INFO] [stdout] 18 | ) -> Result<(Vec, Vec, Vec, Vec)> { [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/commands/transform/project_structure.rs:32:43 [INFO] [stdout] | [INFO] [stdout] 32 | cargo_doc.get("bin").is_some() || !cargo_doc.get("package").is_none() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `cargo_doc.get("package").is_some()` [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: this `if` statement can be collapsed [INFO] [stdout] --> src/commands/transform/workspace.rs:46:5 [INFO] [stdout] | [INFO] [stdout] 46 | / if component_name == "ferrisup_common" || component_name == "shared" || component_name.ends_with("-common") || component_name.... [INFO] [stdout] 47 | | if !is_test_mode() { [INFO] [stdout] 48 | | // Keep prompting until we get an available name [INFO] [stdout] 49 | | let mut is_available = false; [INFO] [stdout] ... | [INFO] [stdout] 86 | | } [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] 46 ~ if (component_name == "ferrisup_common" || component_name == "shared" || component_name.ends_with("-common") || component_name.ends_with("_common")) { [INFO] [stdout] 47 ~ && !is_test_mode() { [INFO] [stdout] 48 | // Keep prompting until we get an available name [INFO] [stdout] ... [INFO] [stdout] 84 | } [INFO] [stdout] 85 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: parameter is only used in recursion [INFO] [stdout] --> src/commands/transform/mod.rs:20:44 [INFO] [stdout] | [INFO] [stdout] 20 | pub fn execute(project_path: Option<&str>, template_name: Option<&str>) -> Result<()> { [INFO] [stdout] | ^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_template_name` [INFO] [stdout] | [INFO] [stdout] note: parameter used here [INFO] [stdout] --> src/commands/transform/mod.rs:39:34 [INFO] [stdout] | [INFO] [stdout] 39 | return execute(None, template_name); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 55 | return execute(None, template_name); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#only_used_in_recursion [INFO] [stdout] = note: `#[warn(clippy::only_used_in_recursion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/commands/transform/component.rs:327:21 [INFO] [stdout] | [INFO] [stdout] 327 | / if deps_table.get("axum").is_none() { [INFO] [stdout] 328 | | deps_table.insert("axum", toml_edit::value("0.7.4")); [INFO] [stdout] 329 | | let mut tokio_table = toml_edit::Table::new(); [INFO] [stdout] 330 | | tokio_table.insert("version", toml_edit::value("1.36.0")); [INFO] [stdout] ... | [INFO] [stdout] 334 | | deps_table.insert("tokio", toml_edit::Item::Table(tokio_table)); [INFO] [stdout] 335 | | } [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] 326 ~ "axum" [INFO] [stdout] 327 ~ if deps_table.get("axum").is_none() => { [INFO] [stdout] 328 | deps_table.insert("axum", toml_edit::value("0.7.4")); [INFO] [stdout] ... [INFO] [stdout] 334 | deps_table.insert("tokio", toml_edit::Item::Table(tokio_table)); [INFO] [stdout] 335 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/commands/transform/component.rs:338:21 [INFO] [stdout] | [INFO] [stdout] 338 | / if deps_table.get("actix-web").is_none() { [INFO] [stdout] 339 | | deps_table.insert("actix-web", toml_edit::value("4.5.1")); [INFO] [stdout] 340 | | } [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] 337 ~ "actix" [INFO] [stdout] 338 ~ if deps_table.get("actix-web").is_none() => { [INFO] [stdout] 339 | deps_table.insert("actix-web", toml_edit::value("4.5.1")); [INFO] [stdout] 340 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/commands/transform/component.rs:343:21 [INFO] [stdout] | [INFO] [stdout] 343 | / if deps_table.get("poem").is_none() { [INFO] [stdout] 344 | | deps_table.insert("poem", toml_edit::value("2.0.0")); [INFO] [stdout] 345 | | } [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] 342 ~ "poem" [INFO] [stdout] 343 ~ if deps_table.get("poem").is_none() => { [INFO] [stdout] 344 | deps_table.insert("poem", toml_edit::value("2.0.0")); [INFO] [stdout] 345 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/commands/transform/component.rs:348:21 [INFO] [stdout] | [INFO] [stdout] 348 | / if deps_table.get("leptos").is_none() { [INFO] [stdout] 349 | | deps_table.insert("leptos", toml_edit::value("0.6.5")); [INFO] [stdout] 350 | | } [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] 347 ~ "leptos" [INFO] [stdout] 348 ~ if deps_table.get("leptos").is_none() => { [INFO] [stdout] 349 | deps_table.insert("leptos", toml_edit::value("0.6.5")); [INFO] [stdout] 350 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/commands/transform/component.rs:353:21 [INFO] [stdout] | [INFO] [stdout] 353 | / if deps_table.get("dioxus").is_none() { [INFO] [stdout] 354 | | deps_table.insert("dioxus", toml_edit::value("0.4.3")); [INFO] [stdout] 355 | | deps_table.insert("dioxus-web", toml_edit::value("0.4.3")); [INFO] [stdout] 356 | | } [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] 352 ~ "dioxus" [INFO] [stdout] 353 ~ if deps_table.get("dioxus").is_none() => { [INFO] [stdout] 354 | deps_table.insert("dioxus", toml_edit::value("0.4.3")); [INFO] [stdout] 355 | deps_table.insert("dioxus-web", toml_edit::value("0.4.3")); [INFO] [stdout] 356 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/commands/transform/component.rs:359:21 [INFO] [stdout] | [INFO] [stdout] 359 | / if deps_table.get("tauri").is_none() { [INFO] [stdout] 360 | | let mut tauri_table = toml_edit::Table::new(); [INFO] [stdout] 361 | | tauri_table.insert("version", toml_edit::value("1.6.0")); [INFO] [stdout] 362 | | let mut features_array = toml_edit::Array::new(); [INFO] [stdout] ... | [INFO] [stdout] 365 | | deps_table.insert("tauri", toml_edit::Item::Table(tauri_table)); [INFO] [stdout] 366 | | } [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] 358 ~ "tauri" [INFO] [stdout] 359 ~ if deps_table.get("tauri").is_none() => { [INFO] [stdout] 360 | let mut tauri_table = toml_edit::Table::new(); [INFO] [stdout] ... [INFO] [stdout] 365 | deps_table.insert("tauri", toml_edit::Item::Table(tauri_table)); [INFO] [stdout] 366 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/commands/transform/component.rs:369:21 [INFO] [stdout] | [INFO] [stdout] 369 | / if deps_table.get("polars").is_none() { [INFO] [stdout] 370 | | let mut polars_table = toml_edit::Table::new(); [INFO] [stdout] 371 | | polars_table.insert("version", toml_edit::value("0.38.1")); [INFO] [stdout] 372 | | let mut features_array = toml_edit::Array::new(); [INFO] [stdout] ... | [INFO] [stdout] 377 | | deps_table.insert("polars", toml_edit::Item::Table(polars_table)); [INFO] [stdout] 378 | | } [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] 368 ~ "polars" [INFO] [stdout] 369 ~ if deps_table.get("polars").is_none() => { [INFO] [stdout] 370 | let mut polars_table = toml_edit::Table::new(); [INFO] [stdout] ... [INFO] [stdout] 377 | deps_table.insert("polars", toml_edit::Item::Table(polars_table)); [INFO] [stdout] 378 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/commands/transform/component.rs:381:21 [INFO] [stdout] | [INFO] [stdout] 381 | / if deps_table.get("linfa").is_none() { [INFO] [stdout] 382 | | deps_table.insert("linfa", toml_edit::value("0.7.0")); [INFO] [stdout] 383 | | deps_table.insert("ndarray", toml_edit::value("0.15.6")); [INFO] [stdout] 384 | | } [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] 380 ~ "linfa" [INFO] [stdout] 381 ~ if deps_table.get("linfa").is_none() => { [INFO] [stdout] 382 | deps_table.insert("linfa", toml_edit::value("0.7.0")); [INFO] [stdout] 383 | deps_table.insert("ndarray", toml_edit::value("0.15.6")); [INFO] [stdout] 384 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/commands/transform/utils.rs:29:89 [INFO] [stdout] | [INFO] [stdout] 29 | let updated_content_str = crate_regex.replace_all(&updated_content, format!("{}", new_name).as_str()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `new_name.to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/commands/transform/utils.rs:434:29 [INFO] [stdout] | [INFO] [stdout] 434 | let src_regex = format!(r"(src/[\w\-\.\/]+)"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `r"(src/[\w\-\.\/]+)".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/commands/transform/ui.rs:41:45 [INFO] [stdout] | [INFO] [stdout] 41 | pub fn select_option(prompt: &str, options: &Vec, default: usize) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 41 - pub fn select_option(prompt: &str, options: &Vec, default: usize) -> Result { [INFO] [stdout] 41 + pub fn select_option(prompt: &str, options: &[String], default: usize) -> Result { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/commands/transform/workspace_utils.rs:18:6 [INFO] [stdout] | [INFO] [stdout] 18 | ) -> Result<(Vec, Vec, Vec, Vec)> { [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: useless use of `format!` [INFO] [stdout] --> src/commands/component.rs:352:9 [INFO] [stdout] | [INFO] [stdout] 352 | format!("for dependencies and imports in other components").cyan()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"for dependencies and imports in other components".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/commands/component.rs:566:29 [INFO] [stdout] | [INFO] [stdout] 566 | if trimmed.contains(&component_to_check) || trimmed.contains(&snake_case) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: change this to: `component_to_check` [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: stripping a prefix manually [INFO] [stdout] --> src/commands/component.rs:626:53 [INFO] [stdout] | [INFO] [stdout] 626 | ... if let Some(name_end) = line["pub fn ".len()..].find('(') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/commands/component.rs:625:25 [INFO] [stdout] | [INFO] [stdout] 625 | if line.starts_with("pub fn ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] = note: `#[warn(clippy::manual_strip)]` on by default [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 625 ~ if let Some() = line.strip_prefix("pub fn ") { [INFO] [stdout] 626 ~ if let Some(name_end) = .find('(') { [INFO] [stdout] 627 ~ let fn_name = &[..name_end].trim(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/commands/component.rs:641:53 [INFO] [stdout] | [INFO] [stdout] 641 | ... if let Some(name_end) = line["pub fn ".len()..].find('(') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/commands/component.rs:640:25 [INFO] [stdout] | [INFO] [stdout] 640 | if line.starts_with("pub fn ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 640 ~ if let Some() = line.strip_prefix("pub fn ") { [INFO] [stdout] 641 ~ if let Some(name_end) = .find('(') { [INFO] [stdout] 642 ~ let fn_name = &[..name_end].trim(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: parameter is only used in recursion [INFO] [stdout] --> src/commands/transform/mod.rs:20:44 [INFO] [stdout] | [INFO] [stdout] 20 | pub fn execute(project_path: Option<&str>, template_name: Option<&str>) -> Result<()> { [INFO] [stdout] | ^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_template_name` [INFO] [stdout] | [INFO] [stdout] note: parameter used here [INFO] [stdout] --> src/commands/transform/mod.rs:39:34 [INFO] [stdout] | [INFO] [stdout] 39 | return execute(None, template_name); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 55 | return execute(None, template_name); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#only_used_in_recursion [INFO] [stdout] = note: `#[warn(clippy::only_used_in_recursion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/commands/component.rs:710:37 [INFO] [stdout] | [INFO] [stdout] 710 | } else if path.is_file() && path.extension().map_or(false, |ext| ext == "rs") { [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] 710 - } else if path.is_file() && path.extension().map_or(false, |ext| ext == "rs") { [INFO] [stdout] 710 + } else if path.is_file() && path.extension().is_some_and(|ext| ext == "rs") { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/commands/component.rs:732:37 [INFO] [stdout] | [INFO] [stdout] 732 | } else if path.is_file() && path.extension().map_or(false, |ext| ext == "rs") { [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] 732 - } else if path.is_file() && path.extension().map_or(false, |ext| ext == "rs") { [INFO] [stdout] 732 + } else if path.is_file() && path.extension().is_some_and(|ext| ext == "rs") { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/commands/component.rs:352:9 [INFO] [stdout] | [INFO] [stdout] 352 | format!("for dependencies and imports in other components").cyan()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"for dependencies and imports in other components".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/commands/component.rs:566:29 [INFO] [stdout] | [INFO] [stdout] 566 | if trimmed.contains(&component_to_check) || trimmed.contains(&snake_case) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: change this to: `component_to_check` [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: stripping a prefix manually [INFO] [stdout] --> src/commands/component.rs:626:53 [INFO] [stdout] | [INFO] [stdout] 626 | ... if let Some(name_end) = line["pub fn ".len()..].find('(') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/commands/component.rs:625:25 [INFO] [stdout] | [INFO] [stdout] 625 | if line.starts_with("pub fn ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] = note: `#[warn(clippy::manual_strip)]` on by default [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 625 ~ if let Some() = line.strip_prefix("pub fn ") { [INFO] [stdout] 626 ~ if let Some(name_end) = .find('(') { [INFO] [stdout] 627 ~ let fn_name = &[..name_end].trim(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/commands/component.rs:641:53 [INFO] [stdout] | [INFO] [stdout] 641 | ... if let Some(name_end) = line["pub fn ".len()..].find('(') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/commands/component.rs:640:25 [INFO] [stdout] | [INFO] [stdout] 640 | if line.starts_with("pub fn ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 640 ~ if let Some() = line.strip_prefix("pub fn ") { [INFO] [stdout] 641 ~ if let Some(name_end) = .find('(') { [INFO] [stdout] 642 ~ let fn_name = &[..name_end].trim(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/commands/component.rs:710:37 [INFO] [stdout] | [INFO] [stdout] 710 | } else if path.is_file() && path.extension().map_or(false, |ext| ext == "rs") { [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] 710 - } else if path.is_file() && path.extension().map_or(false, |ext| ext == "rs") { [INFO] [stdout] 710 + } else if path.is_file() && path.extension().is_some_and(|ext| ext == "rs") { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/commands/component.rs:732:37 [INFO] [stdout] | [INFO] [stdout] 732 | } else if path.is_file() && path.extension().map_or(false, |ext| ext == "rs") { [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] 732 - } else if path.is_file() && path.extension().map_or(false, |ext| ext == "rs") { [INFO] [stdout] 732 + } else if path.is_file() && path.extension().is_some_and(|ext| ext == "rs") { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/commands/import_fixer.rs:84:40 [INFO] [stdout] | [INFO] [stdout] 84 | let new_package_name = format!("{}", component_name); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `component_name.to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_err()` [INFO] [stdout] --> src/commands/import_fixer.rs:92:28 [INFO] [stdout] | [INFO] [stdout] 92 | if let Err(_) = fs::write(path, updated_content2.as_bytes()) { [INFO] [stdout] | -------^^^^^^----------------------------------------------- help: try: `if fs::write(path, updated_content2.as_bytes()).is_err()` [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: useless use of `vec!` [INFO] [stdout] --> src/commands/transform/workspace_utils.rs:20:33 [INFO] [stdout] | [INFO] [stdout] 20 | let always_skip_filenames = vec![ [INFO] [stdout] | _________________________________^ [INFO] [stdout] 21 | | "Cargo.toml".to_string(), // Workspace Cargo.toml will be created anew [INFO] [stdout] 22 | | "Cargo.lock".to_string(), // Workspace Cargo.lock [INFO] [stdout] 23 | | ".git".to_string(), // Git directory [INFO] [stdout] 24 | | ".ferrisup".to_string(), // FerrisUp metadata directory [INFO] [stdout] 25 | | component_name.to_string(), // The new component directory being created [INFO] [stdout] 26 | | ]; [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] help: you can use an array directly [INFO] [stdout] | [INFO] [stdout] 20 ~ let always_skip_filenames = ["Cargo.toml".to_string(), // Workspace Cargo.toml will be created anew [INFO] [stdout] 21 + "Cargo.lock".to_string(), // Workspace Cargo.lock [INFO] [stdout] 22 + ".git".to_string(), // Git directory [INFO] [stdout] 23 + ".ferrisup".to_string(), // FerrisUp metadata directory [INFO] [stdout] 24 ~ component_name.to_string()]; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/commands/transform/workspace_utils.rs:30:36 [INFO] [stdout] | [INFO] [stdout] 30 | let critical_component_files = vec![ [INFO] [stdout] | ____________________________________^ [INFO] [stdout] 31 | | "src".to_string(), // Source code must move with the component [INFO] [stdout] 32 | | "build.rs".to_string(), // Build script is specific to the component [INFO] [stdout] 33 | | "benches".to_string(), // Benchmarks are specific to the component [INFO] [stdout] 34 | | "examples".to_string(), // Examples are specific to the component [INFO] [stdout] 35 | | "bin".to_string() // Binary files are specific to the component [INFO] [stdout] 36 | | ]; [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] help: you can use an array directly [INFO] [stdout] | [INFO] [stdout] 30 ~ let critical_component_files = ["src".to_string(), // Source code must move with the component [INFO] [stdout] 31 + "build.rs".to_string(), // Build script is specific to the component [INFO] [stdout] 32 + "benches".to_string(), // Benchmarks are specific to the component [INFO] [stdout] 33 + "examples".to_string(), // Examples are specific to the component [INFO] [stdout] 34 ~ "bin".to_string()]; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/commands/transform/workspace_utils.rs:73:33 [INFO] [stdout] | [INFO] [stdout] 73 | let always_skip_filenames = vec![ [INFO] [stdout] | _________________________________^ [INFO] [stdout] 74 | | "Cargo.toml".to_string(), // Workspace Cargo.toml will be created anew [INFO] [stdout] 75 | | "Cargo.lock".to_string(), // Workspace Cargo.lock [INFO] [stdout] 76 | | ".git".to_string(), // Git directory [INFO] [stdout] 77 | | ".ferrisup".to_string(), // FerrisUp metadata directory [INFO] [stdout] 78 | | component_name.to_string(), // The new component directory being created [INFO] [stdout] 79 | | ]; [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] help: you can use an array directly [INFO] [stdout] | [INFO] [stdout] 73 ~ let always_skip_filenames = ["Cargo.toml".to_string(), // Workspace Cargo.toml will be created anew [INFO] [stdout] 74 + "Cargo.lock".to_string(), // Workspace Cargo.lock [INFO] [stdout] 75 + ".git".to_string(), // Git directory [INFO] [stdout] 76 + ".ferrisup".to_string(), // FerrisUp metadata directory [INFO] [stdout] 77 ~ component_name.to_string()]; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/commands/import_fixer.rs:84:40 [INFO] [stdout] | [INFO] [stdout] 84 | let new_package_name = format!("{}", component_name); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `component_name.to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_err()` [INFO] [stdout] --> src/commands/import_fixer.rs:92:28 [INFO] [stdout] | [INFO] [stdout] 92 | if let Err(_) = fs::write(path, updated_content2.as_bytes()) { [INFO] [stdout] | -------^^^^^^----------------------------------------------- help: try: `if fs::write(path, updated_content2.as_bytes()).is_err()` [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: useless use of `vec!` [INFO] [stdout] --> src/commands/transform/workspace_utils.rs:20:33 [INFO] [stdout] | [INFO] [stdout] 20 | let always_skip_filenames = vec![ [INFO] [stdout] | _________________________________^ [INFO] [stdout] 21 | | "Cargo.toml".to_string(), // Workspace Cargo.toml will be created anew [INFO] [stdout] 22 | | "Cargo.lock".to_string(), // Workspace Cargo.lock [INFO] [stdout] 23 | | ".git".to_string(), // Git directory [INFO] [stdout] 24 | | ".ferrisup".to_string(), // FerrisUp metadata directory [INFO] [stdout] 25 | | component_name.to_string(), // The new component directory being created [INFO] [stdout] 26 | | ]; [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] help: you can use an array directly [INFO] [stdout] | [INFO] [stdout] 20 ~ let always_skip_filenames = ["Cargo.toml".to_string(), // Workspace Cargo.toml will be created anew [INFO] [stdout] 21 + "Cargo.lock".to_string(), // Workspace Cargo.lock [INFO] [stdout] 22 + ".git".to_string(), // Git directory [INFO] [stdout] 23 + ".ferrisup".to_string(), // FerrisUp metadata directory [INFO] [stdout] 24 ~ component_name.to_string()]; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/commands/transform/workspace_utils.rs:30:36 [INFO] [stdout] | [INFO] [stdout] 30 | let critical_component_files = vec![ [INFO] [stdout] | ____________________________________^ [INFO] [stdout] 31 | | "src".to_string(), // Source code must move with the component [INFO] [stdout] 32 | | "build.rs".to_string(), // Build script is specific to the component [INFO] [stdout] 33 | | "benches".to_string(), // Benchmarks are specific to the component [INFO] [stdout] 34 | | "examples".to_string(), // Examples are specific to the component [INFO] [stdout] 35 | | "bin".to_string() // Binary files are specific to the component [INFO] [stdout] 36 | | ]; [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] help: you can use an array directly [INFO] [stdout] | [INFO] [stdout] 30 ~ let critical_component_files = ["src".to_string(), // Source code must move with the component [INFO] [stdout] 31 + "build.rs".to_string(), // Build script is specific to the component [INFO] [stdout] 32 + "benches".to_string(), // Benchmarks are specific to the component [INFO] [stdout] 33 + "examples".to_string(), // Examples are specific to the component [INFO] [stdout] 34 ~ "bin".to_string()]; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/commands/transform/workspace_utils.rs:73:33 [INFO] [stdout] | [INFO] [stdout] 73 | let always_skip_filenames = vec![ [INFO] [stdout] | _________________________________^ [INFO] [stdout] 74 | | "Cargo.toml".to_string(), // Workspace Cargo.toml will be created anew [INFO] [stdout] 75 | | "Cargo.lock".to_string(), // Workspace Cargo.lock [INFO] [stdout] 76 | | ".git".to_string(), // Git directory [INFO] [stdout] 77 | | ".ferrisup".to_string(), // FerrisUp metadata directory [INFO] [stdout] 78 | | component_name.to_string(), // The new component directory being created [INFO] [stdout] 79 | | ]; [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] help: you can use an array directly [INFO] [stdout] | [INFO] [stdout] 73 ~ let always_skip_filenames = ["Cargo.toml".to_string(), // Workspace Cargo.toml will be created anew [INFO] [stdout] 74 + "Cargo.lock".to_string(), // Workspace Cargo.lock [INFO] [stdout] 75 + ".git".to_string(), // Git directory [INFO] [stdout] 76 + ".ferrisup".to_string(), // FerrisUp metadata directory [INFO] [stdout] 77 ~ component_name.to_string()]; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> tests/commands_test.rs:12:15 [INFO] [stdout] | [INFO] [stdout] 12 | .args(&["preview", "--template", "minimal"]) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["preview", "--template", "minimal"]` [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] --> tests/commands_test.rs:71:15 [INFO] [stdout] | [INFO] [stdout] 71 | .args(&["new", "test_project", "--component-type", "minimal", "--no-interactive"]) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["new", "test_project", "--component-type", "minimal", "--no-interactive"]` [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] --> tests/commands_test.rs:136:15 [INFO] [stdout] | [INFO] [stdout] 136 | .args(&["workspace", "--action", "init", "--path", "."]) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["workspace", "--action", "init", "--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] --> tests/commands_test.rs:167:15 [INFO] [stdout] | [INFO] [stdout] 167 | .args(&["new", "member1", "--component-type", "minimal", "--no-interactive"]) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["new", "member1", "--component-type", "minimal", "--no-interactive"]` [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] --> tests/commands_test.rs:175:15 [INFO] [stdout] | [INFO] [stdout] 175 | .args(&["new", "member2", "--component-type", "library", "--no-interactive"]) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["new", "member2", "--component-type", "library", "--no-interactive"]` [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] --> tests/commands_test.rs:184:15 [INFO] [stdout] | [INFO] [stdout] 184 | .args(&["workspace", "--action", "add", "--path", "."]) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["workspace", "--action", "add", "--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] --> tests/commands_test.rs:199:15 [INFO] [stdout] | [INFO] [stdout] 199 | .args(&["workspace", "--action", "list", "--path", "."]) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["workspace", "--action", "list", "--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 import is redundant [INFO] [stdout] --> tests/main_test.rs:7:1 [INFO] [stdout] | [INFO] [stdout] 7 | use ferrisup; [INFO] [stdout] | ^^^^^^^^^^^^^ help: remove it entirely [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_component_path_imports [INFO] [stdout] = note: `#[warn(clippy::single_component_path_imports)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> tests/main_test.rs:85:19 [INFO] [stdout] | [INFO] [stdout] 85 | .args(&[ [INFO] [stdout] | ___________________^ [INFO] [stdout] 86 | | "new", [INFO] [stdout] 87 | | &project_name, [INFO] [stdout] 88 | | "--template", [INFO] [stdout] 89 | | &template_name, [INFO] [stdout] 90 | | "--no-interactive" // Add flag to avoid terminal prompts [INFO] [stdout] 91 | | ]) [INFO] [stdout] | |_____________^ [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] help: change this to [INFO] [stdout] | [INFO] [stdout] 85 ~ .args([ [INFO] [stdout] 86 + "new", [INFO] [stdout] 87 + &project_name, [INFO] [stdout] 88 + "--template", [INFO] [stdout] 89 + &template_name, [INFO] [stdout] 90 + "--no-interactive" // Add flag to avoid terminal prompts [INFO] [stdout] 91 ~ ]) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> tests/main_test.rs:89:17 [INFO] [stdout] | [INFO] [stdout] 89 | &template_name, [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `template_name` [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] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 56.41s [INFO] running `Command { std: "docker" "inspect" "cdbcb9df559b6b481f1d0a214058ba734489591a3f33d28b344fa4f80be87e5c", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "cdbcb9df559b6b481f1d0a214058ba734489591a3f33d28b344fa4f80be87e5c", kill_on_drop: false }` [INFO] [stdout] cdbcb9df559b6b481f1d0a214058ba734489591a3f33d28b344fa4f80be87e5c