[INFO] cloning repository https://github.com/tomekatomek123456789/redox [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/tomekatomek123456789/redox" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Ftomekatomek123456789%2Fredox", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Ftomekatomek123456789%2Fredox'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] a5c83a40a078ed8eadfc78d4a464ee8f46f06164 [INFO] linting tomekatomek123456789/redox against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Ftomekatomek123456789%2Fredox" "/workspace/builds/worker-7-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-7-tc1/source'... [INFO] [stderr] done. [INFO] removed /workspace/builds/worker-7-tc1/source/.cargo/config.toml [INFO] removed /workspace/builds/worker-7-tc1/source/rust-toolchain.toml [INFO] started tweaking git repo https://github.com/tomekatomek123456789/redox [INFO] finished tweaking git repo https://github.com/tomekatomek123456789/redox [INFO] tweaked toml for git repo https://github.com/tomekatomek123456789/redox written to /workspace/builds/worker-7-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/tomekatomek123456789/redox 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 git repo https://github.com/tomekatomek123456789/redox 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] Updating git repository `https://gitlab.redox-os.org/redox-os/pkgar.git` [INFO] [stderr] Updating git repository `https://gitlab.redox-os.org/redox-os/pkgutils.git` [INFO] [stderr] Updating git repository `https://gitlab.redox-os.org/redox-os/installer.git` [INFO] [stderr] Updating git repository `https://gitlab.redox-os.org/redox-os/redoxer.git` [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded numtoa v0.2.4 [INFO] [stderr] Downloaded vte v0.14.1 [INFO] [stderr] Downloaded instability v0.3.10 [INFO] [stderr] Downloaded strip-ansi-escapes v0.2.1 [INFO] [stderr] Downloaded pbr v1.1.1 [INFO] [stderr] Downloaded ansi-to-tui v7.0.0 [INFO] [stderr] Downloaded seckey v0.11.2 [INFO] [stderr] Downloaded termion v4.0.6 [INFO] [stderr] Downloaded dryoc v0.6.2 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-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] 5d42851bc6d72f89a3a6190c16ddee885a3e796cda6de5edcac3937ddccd51c9 [INFO] running `Command { std: "docker" "start" "-a" "5d42851bc6d72f89a3a6190c16ddee885a3e796cda6de5edcac3937ddccd51c9", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "5d42851bc6d72f89a3a6190c16ddee885a3e796cda6de5edcac3937ddccd51c9", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "5d42851bc6d72f89a3a6190c16ddee885a3e796cda6de5edcac3937ddccd51c9", kill_on_drop: false }` [INFO] [stdout] 5d42851bc6d72f89a3a6190c16ddee885a3e796cda6de5edcac3937ddccd51c9 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-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] 796070e12dc4a3eb1e213d84ba013f94adcef68e488e1a33c1e97a36579a7fcb [INFO] running `Command { std: "docker" "start" "-a" "796070e12dc4a3eb1e213d84ba013f94adcef68e488e1a33c1e97a36579a7fcb", kill_on_drop: false }` [INFO] [stderr] Compiling libc v0.2.178 [INFO] [stderr] Compiling syn v2.0.111 [INFO] [stderr] Compiling cc v1.2.49 [INFO] [stderr] Compiling semver v1.0.27 [INFO] [stderr] Checking digest v0.10.7 [INFO] [stderr] Checking aho-corasick v1.1.4 [INFO] [stderr] Checking numtoa v0.2.4 [INFO] [stderr] Compiling getrandom v0.1.16 [INFO] [stderr] Checking rayon v1.11.0 [INFO] [stderr] Checking crypto-mac v0.8.0 [INFO] [stderr] Compiling rustc_version v0.4.1 [INFO] [stderr] Checking sha2 v0.10.9 [INFO] [stderr] Checking digest v0.9.0 [INFO] [stderr] Compiling instability v0.3.10 [INFO] [stderr] Compiling curve25519-dalek v4.1.3 [INFO] [stderr] Checking textwrap v0.11.0 [INFO] [stderr] Checking bstr v1.12.1 [INFO] [stderr] Checking simd-adler32 v0.3.8 [INFO] [stderr] Checking compact_str v0.8.1 [INFO] [stderr] Checking miniz_oxide v0.8.9 [INFO] [stderr] Checking twox-hash v1.6.3 [INFO] [stderr] Checking regex-automata v0.4.13 [INFO] [stderr] Compiling object v0.36.7 [INFO] [stderr] Checking flate2 v1.1.5 [INFO] [stderr] Checking ruzstd v0.7.3 [INFO] [stderr] Checking vte v0.14.1 [INFO] [stderr] Checking simdutf8 v0.1.5 [INFO] [stderr] Checking getrandom v0.2.16 [INFO] [stderr] Checking termion v4.0.6 [INFO] [stderr] Checking rand_core v0.6.4 [INFO] [stderr] Checking dirs-sys v0.5.0 [INFO] [stderr] Checking memsec v0.6.3 [INFO] [stderr] Compiling blake3 v0.3.8 [INFO] [stderr] Checking dirs v6.0.0 [INFO] [stderr] Checking atty v0.2.14 [INFO] [stderr] Compiling blake3 v1.5.3 [INFO] [stderr] Checking clap v2.34.0 [INFO] [stderr] Checking redoxer v0.2.61 (https://gitlab.redox-os.org/redox-os/redoxer.git#4cbd0fce) [INFO] [stderr] Checking seckey v0.11.2 [INFO] [stderr] Checking pbr v1.1.1 [INFO] [stderr] Checking strip-ansi-escapes v0.2.1 [INFO] [stderr] Checking globset v0.4.18 [INFO] [stderr] Checking regex v1.12.2 [INFO] [stderr] Checking ignore v0.4.25 [INFO] [stderr] Compiling darling_core v0.20.11 [INFO] [stderr] Compiling serde_derive v1.0.197 [INFO] [stderr] Compiling zeroize_derive v1.4.2 [INFO] [stderr] Compiling curve25519-dalek-derive v0.1.1 [INFO] [stderr] Compiling bytemuck_derive v1.10.2 [INFO] [stderr] Compiling thiserror-impl v1.0.69 [INFO] [stderr] Compiling thiserror-impl v2.0.17 [INFO] [stderr] Checking zeroize v1.8.2 [INFO] [stderr] Checking cipher v0.4.4 [INFO] [stderr] Checking chacha20 v0.9.1 [INFO] [stderr] Checking salsa20 v0.10.2 [INFO] [stderr] Compiling strum_macros v0.26.4 [INFO] [stderr] Checking bytemuck v1.24.0 [INFO] [stderr] Checking thiserror v1.0.69 [INFO] [stderr] Checking filedescriptor v0.8.3 [INFO] [stderr] Checking thiserror v2.0.17 [INFO] [stderr] Checking dryoc v0.6.2 [INFO] [stderr] Compiling darling_macro v0.20.11 [INFO] [stderr] Checking pkgar-core v0.1.19 (https://gitlab.redox-os.org/redox-os/pkgar.git#e265d32c) [INFO] [stderr] Compiling darling v0.20.11 [INFO] [stderr] Checking strum v0.26.3 [INFO] [stderr] Checking ratatui v0.29.0 [INFO] [stderr] Checking serde v1.0.197 [INFO] [stderr] Checking ansi-to-tui v7.0.0 [INFO] [stderr] Checking serde_spanned v0.6.9 [INFO] [stderr] Checking toml_datetime v0.6.11 [INFO] [stderr] Checking hex v0.4.3 [INFO] [stderr] Checking toml_edit v0.22.27 [INFO] [stderr] Checking toml v0.8.23 [INFO] [stderr] Checking pkgar-keys v0.1.19 (https://gitlab.redox-os.org/redox-os/pkgar.git#e265d32c) [INFO] [stderr] Checking redox-pkg v0.2.9 (https://gitlab.redox-os.org/redox-os/pkgutils.git#cbf88111) [INFO] [stderr] Checking redox_installer v0.2.37 (https://gitlab.redox-os.org/redox-os/installer.git#990d9d34) [INFO] [stderr] Checking pkgar v0.1.19 (https://gitlab.redox-os.org/redox-os/pkgar.git#e265d32c) [INFO] [stderr] Checking redox_cookbook v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/cook/fetch.rs:660:9 [INFO] [stdout] | [INFO] [stdout] 660 | source_identifier: source_identifier, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `source_identifier` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/cook/pty.rs:165:13 [INFO] [stdout] | [INFO] [stdout] 165 | master: master, [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace it with: `master` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/cook/pty.rs:166:13 [INFO] [stdout] | [INFO] [stdout] 166 | slave: slave, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `slave` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/cook/fetch.rs:660:9 [INFO] [stdout] | [INFO] [stdout] 660 | source_identifier: source_identifier, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `source_identifier` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/cook/pty.rs:165:13 [INFO] [stdout] | [INFO] [stdout] 165 | master: master, [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace it with: `master` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/cook/pty.rs:166:13 [INFO] [stdout] | [INFO] [stdout] 166 | slave: slave, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `slave` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/config.rs:87:22 [INFO] [stdout] | [INFO] [stdout] 87 | .map(|f| usize::from(f)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `usize::from` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/config.rs:109:8 [INFO] [stdout] | [INFO] [stdout] 109 | if config.mirrors.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `config.mirrors.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/config.rs:124:29 [INFO] [stdout] | [INFO] [stdout] 124 | if let Ok(e) = env::var(&key) { [INFO] [stdout] | ^^^^ help: change this to: `key` [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: unneeded `return` statement [INFO] [stdout] --> src/config.rs:132:5 [INFO] [stdout] | [INFO] [stdout] 132 | return CONFIG.get().expect("Configuration is not initialized"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 132 - return CONFIG.get().expect("Configuration is not initialized"); [INFO] [stdout] 132 + CONFIG.get().expect("Configuration is not initialized") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/cook/cook_build.rs:99:17 [INFO] [stdout] | [INFO] [stdout] 99 | / if let Ok(relative_path) = path.strip_prefix(target_dir) { [INFO] [stdout] 100 | | if verbose { [INFO] [stdout] 101 | | log_to_pty!(logger, "DEBUG: {} needs {}", relative_path.display(), name); [INFO] [stdout] 102 | | } [INFO] [stdout] 103 | | } [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] 99 ~ if let Ok(relative_path) = path.strip_prefix(target_dir) [INFO] [stdout] 100 ~ && verbose { [INFO] [stdout] 101 | log_to_pty!(logger, "DEBUG: {} needs {}", relative_path.display(), name); [INFO] [stdout] 102 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/cook/cook_build.rs:170:1 [INFO] [stdout] | [INFO] [stdout] 170 | / pub fn build( [INFO] [stdout] 171 | | recipe_dir: &Path, [INFO] [stdout] 172 | | source_dir: &Path, [INFO] [stdout] 173 | | target_dir: &Path, [INFO] [stdout] ... | [INFO] [stdout] 178 | | logger: &PtyOut, [INFO] [stdout] 179 | | ) -> Result<(Vec, BTreeSet), String> { [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 `if` statement can be collapsed [INFO] [stdout] --> src/cook/cook_build.rs:241:5 [INFO] [stdout] | [INFO] [stdout] 241 | / if let Ok(recipe_modified) = modified(&recipe_dir.join("recipe.toml")) { [INFO] [stdout] 242 | | if recipe_modified > source_modified { [INFO] [stdout] 243 | | source_modified = recipe_modified [INFO] [stdout] 244 | | } [INFO] [stdout] 245 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 241 ~ if let Ok(recipe_modified) = modified(&recipe_dir.join("recipe.toml")) [INFO] [stdout] 242 ~ && recipe_modified > source_modified { [INFO] [stdout] 243 | source_modified = recipe_modified [INFO] [stdout] 244 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/cook/cook_build.rs:300:69 [INFO] [stdout] | [INFO] [stdout] 300 | if recipe.build.kind != BuildKind::Remote && !name.is_host() && dep_host_pkgars.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!dep_host_pkgars.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/cook/cook_build.rs:432:30 [INFO] [stdout] | [INFO] [stdout] 432 | create_dir_clean(&stage_dir)?; [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `stage_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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/cook/cook_build.rs:434:47 [INFO] [stdout] | [INFO] [stdout] 434 | let glob = globset::Glob::new(&path).map_err(|e| format!("{}", e))?; [INFO] [stdout] | ^^^^^ help: change this to: `path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/cook/cook_build.rs:452:32 [INFO] [stdout] | [INFO] [stdout] 452 | rename(&stage_dir_tmp, &stage_dir)?; [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `stage_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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/cook/cook_build.rs:470:20 [INFO] [stdout] | [INFO] [stdout] 470 | remove_all(&stage_dir)?; [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `stage_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: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/cook/cook_build.rs:489:5 [INFO] [stdout] | [INFO] [stdout] 489 | if let Some(cross_target) = std::env::var("COOKBOOK_CROSS_TARGET").ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] = note: `#[warn(clippy::match_result_ok)]` on by default [INFO] [stdout] help: consider matching on `Ok(cross_target)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 489 - if let Some(cross_target) = std::env::var("COOKBOOK_CROSS_TARGET").ok() { [INFO] [stdout] 489 + if let Ok(cross_target) = std::env::var("COOKBOOK_CROSS_TARGET") { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/cook/cook_build.rs:489:5 [INFO] [stdout] | [INFO] [stdout] 489 | / if let Some(cross_target) = std::env::var("COOKBOOK_CROSS_TARGET").ok() { [INFO] [stdout] 490 | | if cross_target != "" { [INFO] [stdout] 491 | | // TODO: automatically pass COOKBOOK_CROSS_GNU_TARGET? [INFO] [stdout] 492 | | target_dir = target_dir.join(cross_target) [INFO] [stdout] 493 | | } [INFO] [stdout] 494 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 489 ~ if let Some(cross_target) = std::env::var("COOKBOOK_CROSS_TARGET").ok() [INFO] [stdout] 490 ~ && cross_target != "" { [INFO] [stdout] 491 | // TODO: automatically pass COOKBOOK_CROSS_GNU_TARGET? [INFO] [stdout] 492 | target_dir = target_dir.join(cross_target) [INFO] [stdout] 493 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/cook/cook_build.rs:490:12 [INFO] [stdout] | [INFO] [stdout] 490 | if cross_target != "" { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!cross_target.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] = note: `#[warn(clippy::comparison_to_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/cook/cook_build.rs:506:5 [INFO] [stdout] | [INFO] [stdout] 506 | if let Some(cross_target) = std::env::var("COOKBOOK_CROSS_TARGET").ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] help: consider matching on `Ok(cross_target)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 506 - if let Some(cross_target) = std::env::var("COOKBOOK_CROSS_TARGET").ok() { [INFO] [stdout] 506 + if let Ok(cross_target) = std::env::var("COOKBOOK_CROSS_TARGET") { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/cook/cook_build.rs:506:5 [INFO] [stdout] | [INFO] [stdout] 506 | / if let Some(cross_target) = std::env::var("COOKBOOK_CROSS_TARGET").ok() { [INFO] [stdout] 507 | | if cross_target != "" { [INFO] [stdout] 508 | | // TODO: automatically pass COOKBOOK_CROSS_GNU_TARGET? [INFO] [stdout] 509 | | target_dir = target_dir.join(cross_target) [INFO] [stdout] 510 | | } [INFO] [stdout] 511 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 506 ~ if let Some(cross_target) = std::env::var("COOKBOOK_CROSS_TARGET").ok() [INFO] [stdout] 507 ~ && cross_target != "" { [INFO] [stdout] 508 | // TODO: automatically pass COOKBOOK_CROSS_GNU_TARGET? [INFO] [stdout] 509 | target_dir = target_dir.join(cross_target) [INFO] [stdout] 510 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/cook/cook_build.rs:507:12 [INFO] [stdout] | [INFO] [stdout] 507 | if cross_target != "" { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!cross_target.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&PathBuf` instead of `&Path` involves a new object where a slice will do [INFO] [stdout] --> src/cook/cook_build.rs:517:15 [INFO] [stdout] | [INFO] [stdout] 517 | deps_dir: &PathBuf, [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] 517 - deps_dir: &PathBuf, [INFO] [stdout] 517 + deps_dir: &Path, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/cook/cook_build.rs:560:52 [INFO] [stdout] | [INFO] [stdout] 560 | symlink(Path::new("usr").join(folder), &deps_dir_tmp.join(folder))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `deps_dir_tmp.join(folder)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/cook/cook_build.rs:568:39 [INFO] [stdout] | [INFO] [stdout] 568 | pkgar::extract(pkey_path, &archive_path, deps_dir_tmp.to_str().unwrap()).map_err( [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `archive_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 `if` statement can be collapsed [INFO] [stdout] --> src/cook/cook_build.rs:599:5 [INFO] [stdout] | [INFO] [stdout] 599 | / if auto_deps_path.is_file() && !cook_config.clean_target { [INFO] [stdout] 600 | | if modified(&auto_deps_path)? < modified_all(stage_dirs, modified)? { [INFO] [stdout] 601 | | remove_all(&auto_deps_path)? [INFO] [stdout] 602 | | } [INFO] [stdout] 603 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 599 ~ if auto_deps_path.is_file() && !cook_config.clean_target [INFO] [stdout] 600 ~ && modified(&auto_deps_path)? < modified_all(stage_dirs, modified)? { [INFO] [stdout] 601 | remove_all(&auto_deps_path)? [INFO] [stdout] 602 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/cook/cook_build.rs:647:70 [INFO] [stdout] | [INFO] [stdout] 647 | let (_, source_pkgar, _) = package_source_paths(package, &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_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/cook/cook_build.rs:658:36 [INFO] [stdout] | [INFO] [stdout] 658 | rename(&stage_dir_tmp, &stage_dir)?; [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `stage_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: this `if` statement can be collapsed [INFO] [stdout] --> src/cook/cook_build.rs:663:5 [INFO] [stdout] | [INFO] [stdout] 663 | / if auto_deps_path.is_file() && !cook_config.clean_target { [INFO] [stdout] 664 | | if modified(&auto_deps_path)? < modified_all(&stage_dirs, modified)? { [INFO] [stdout] 665 | | remove_all(&auto_deps_path)? [INFO] [stdout] 666 | | } [INFO] [stdout] 667 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 663 ~ if auto_deps_path.is_file() && !cook_config.clean_target [INFO] [stdout] 664 ~ && modified(&auto_deps_path)? < modified_all(&stage_dirs, modified)? { [INFO] [stdout] 665 | remove_all(&auto_deps_path)? [INFO] [stdout] 666 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/cook/fetch.rs:23:33 [INFO] [stdout] | [INFO] [stdout] 23 | blake3::blake3_progress(&path) [INFO] [stdout] | ^^^^^ help: change this to: `path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/cook/fetch.rs:25:31 [INFO] [stdout] | [INFO] [stdout] 25 | blake3::blake3_silent(&path) [INFO] [stdout] | ^^^^^ help: change this to: `path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/cook/fetch.rs:86:65 [INFO] [stdout] | [INFO] [stdout] 86 | let source_tar_blake3 = get_blake3(&source_tar, true && logger.is_none())?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `logger.is_none()` [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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/cook/fetch.rs:59:58 [INFO] [stdout] | [INFO] [stdout] 59 | let recipe = fetch_resolve_canon(recipe_dir, &same_as, recipe.name.is_host())?; [INFO] [stdout] | ^^^^^^^^ help: change this to: `same_as` [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/cook/fetch.rs:62:45 [INFO] [stdout] | [INFO] [stdout] 62 | fetch_make_symlink(&source_dir, &same_as)?; [INFO] [stdout] | ^^^^^^^^ help: change this to: `same_as` [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/cook/fetch.rs:135:58 [INFO] [stdout] | [INFO] [stdout] 135 | let recipe = fetch_resolve_canon(recipe_dir, &same_as, recipe.name.is_host())?; [INFO] [stdout] | ^^^^^^^^ help: change this to: `same_as` [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/cook/fetch.rs:138:45 [INFO] [stdout] | [INFO] [stdout] 138 | fetch_make_symlink(&source_dir, &same_as)?; [INFO] [stdout] | ^^^^^^^^ help: change this to: `same_as` [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/cook/fetch.rs:182:43 [INFO] [stdout] | [INFO] [stdout] 182 | .arg(translate_mirror(&git)); [INFO] [stdout] | ^^^^ help: change this to: `git` [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/cook/fetch.rs:223:75 [INFO] [stdout] | [INFO] [stdout] 223 | && let Ok(exp_rev) = get_git_tag_rev(&source_dir, &rev) [INFO] [stdout] | ^^^^ help: change this to: `rev` [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` has identical blocks [INFO] [stdout] --> src/cook/fetch.rs:237:55 [INFO] [stdout] | [INFO] [stdout] 237 | } else if remote_name != "origin" { [INFO] [stdout] | _______________________________________________________^ [INFO] [stdout] 238 | | false [INFO] [stdout] 239 | | } else if &remote_url != chop_dot_git(git) { [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/cook/fetch.rs:239:64 [INFO] [stdout] | [INFO] [stdout] 239 | } else if &remote_url != chop_dot_git(git) { [INFO] [stdout] | ________________________________________________________________^ [INFO] [stdout] 240 | | false [INFO] [stdout] 241 | | } 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: needlessly taken reference of left operand [INFO] [stdout] --> src/cook/fetch.rs:239:31 [INFO] [stdout] | [INFO] [stdout] 239 | } else if &remote_url != chop_dot_git(git) { [INFO] [stdout] | -----------^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: use the left value directly: `remote_url` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] = note: `#[warn(clippy::op_ref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/cook/fetch.rs:269:24 [INFO] [stdout] | [INFO] [stdout] 269 | if patches.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!patches.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/cook/fetch.rs:331:35 [INFO] [stdout] | [INFO] [stdout] 331 | download_wget(&tar, &source_tar, logger)?; [INFO] [stdout] | ^^^^ help: change this to: `tar` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/cook/fetch.rs:363:13 [INFO] [stdout] | [INFO] [stdout] 363 | / if source_dir.is_dir() { [INFO] [stdout] 364 | | if tar_updated || fetch_is_patches_newer(recipe_dir, patches, &source_dir)? { [INFO] [stdout] 365 | | log_to_pty!( [INFO] [stdout] 366 | | logger, [INFO] [stdout] ... | [INFO] [stdout] 371 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 363 ~ if source_dir.is_dir() [INFO] [stdout] 364 ~ && (tar_updated || fetch_is_patches_newer(recipe_dir, patches, &source_dir)?) { [INFO] [stdout] 365 | log_to_pty!( [INFO] [stdout] ... [INFO] [stdout] 369 | remove_all(&source_dir)? [INFO] [stdout] 370 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/cook/fetch.rs:449:20 [INFO] [stdout] | [INFO] [stdout] 449 | return Err(format!("Infinite loop detected")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Infinite loop detected".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: writing `&PathBuf` instead of `&Path` involves a new object where a slice will do [INFO] [stdout] --> src/cook/fetch.rs:483:17 [INFO] [stdout] | [INFO] [stdout] 483 | source_dir: &PathBuf, [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] help: change this to [INFO] [stdout] | [INFO] [stdout] 483 ~ source_dir: &Path, [INFO] [stdout] 484 | package_path: Option<&String>, [INFO] [stdout] 485 | logger: &PtyOut, [INFO] [stdout] 486 | ) -> Result<(), String> { [INFO] [stdout] 487 ~ let mut source_dir = source_dir.to_path_buf(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/cook/fetch.rs:508:5 [INFO] [stdout] | [INFO] [stdout] 508 | / return format!( [INFO] [stdout] 509 | | "{}/{}/{}.{}", [INFO] [stdout] 510 | | REMOTE_PKG_SOURCE, [INFO] [stdout] 511 | | redoxer::target(), [INFO] [stdout] 512 | | name, [INFO] [stdout] 513 | | ext [INFO] [stdout] 514 | | ); [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 508 ~ format!( [INFO] [stdout] 509 + "{}/{}/{}.{}", [INFO] [stdout] 510 + REMOTE_PKG_SOURCE, [INFO] [stdout] 511 + redoxer::target(), [INFO] [stdout] 512 + name, [INFO] [stdout] 513 + ext [INFO] [stdout] 514 ~ ) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/cook/fetch.rs:518:5 [INFO] [stdout] | [INFO] [stdout] 518 | return format!("{}/id_ed25519.pub.toml", REMOTE_PKG_SOURCE); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 518 - return format!("{}/id_ed25519.pub.toml", REMOTE_PKG_SOURCE); [INFO] [stdout] 518 + format!("{}/id_ed25519.pub.toml", REMOTE_PKG_SOURCE) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct update has no effect, all the fields in the struct have already been specified [INFO] [stdout] --> src/cook/fetch.rs:577:23 [INFO] [stdout] | [INFO] [stdout] 577 | ..Default::default() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_update [INFO] [stdout] = note: `#[warn(clippy::needless_update)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/cook/fetch.rs:607:5 [INFO] [stdout] | [INFO] [stdout] 607 | return Ok(false); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 607 - return Ok(false); [INFO] [stdout] 607 + Ok(false) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/cook/fetch.rs:592:32 [INFO] [stdout] | [INFO] [stdout] 592 | let source_time = modified(&source_dir)?; [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `source_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: passing a unit value to a function [INFO] [stdout] --> src/cook/fetch.rs:640:5 [INFO] [stdout] | [INFO] [stdout] 640 | / Ok(if let Some(script) = script { [INFO] [stdout] 641 | | let mut command = Command::new("bash"); [INFO] [stdout] 642 | | command.arg("-ex"); [INFO] [stdout] 643 | | command.current_dir(source_dir_tmp); [INFO] [stdout] ... | [INFO] [stdout] 648 | | )?; [INFO] [stdout] 649 | | }) [INFO] [stdout] | |______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unit_arg [INFO] [stdout] = note: `#[warn(clippy::unit_arg)]` on by default [INFO] [stdout] help: move the expression in front of the call and replace it with the unit literal `()` [INFO] [stdout] | [INFO] [stdout] 640 ~ let _: () = if let Some(script) = script { [INFO] [stdout] 641 + let mut command = Command::new("bash"); [INFO] [stdout] 642 + command.arg("-ex"); [INFO] [stdout] 643 + command.current_dir(source_dir_tmp); [INFO] [stdout] 644 + run_command_stdin( [INFO] [stdout] 645 + command, [INFO] [stdout] 646 + format!("{SHARED_PRESCRIPT}\n{script}").as_bytes(), [INFO] [stdout] 647 + logger, [INFO] [stdout] 648 + )?; [INFO] [stdout] 649 + }; [INFO] [stdout] 650 + Ok(()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/cook/fetch.rs:663:41 [INFO] [stdout] | [INFO] [stdout] 663 | fetch_apply_source_info_from_remote(&recipe, &info) [INFO] [stdout] | ^^^^^^^ help: change this to: `recipe` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `&Box`. Consider using just `&T` [INFO] [stdout] --> src/cook/fs.rs:69:9 [INFO] [stdout] | [INFO] [stdout] 69 | mv: &'a Box Option<&'a Path>>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&'a impl Fn(PathBuf) -> Option<&'a Path>` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrowed_box [INFO] [stdout] = note: `#[warn(clippy::borrowed_box)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `&Box`. Consider using just `&T` [INFO] [stdout] --> src/cook/fs.rs:77:9 [INFO] [stdout] | [INFO] [stdout] 77 | mv: &'a Box Option<&'a Path>>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&'a impl Fn(PathBuf) -> Option<&'a Path>` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrowed_box [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/cook/fs.rs:98:28 [INFO] [stdout] | [INFO] [stdout] 98 | fs::create_dir_all(&path.parent().unwrap())?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `path.parent().unwrap()` [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: writing `&PathBuf` instead of `&Path` involves a new object where a slice will do [INFO] [stdout] --> src/cook/fs.rs:295:35 [INFO] [stdout] | [INFO] [stdout] 295 | pub fn offline_check_exists(path: &PathBuf) -> Result<(), String> { [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] help: change this to [INFO] [stdout] | [INFO] [stdout] 295 - pub fn offline_check_exists(path: &PathBuf) -> Result<(), String> { [INFO] [stdout] 295 + pub fn offline_check_exists(path: &Path) -> Result<(), String> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement with `?` operator [INFO] [stdout] --> src/cook/fs.rs:297:9 [INFO] [stdout] | [INFO] [stdout] 297 | return Err(format!( [INFO] [stdout] | ^^^^^^^ help: remove it [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return_with_question_mark [INFO] [stdout] = note: `#[warn(clippy::needless_return_with_question_mark)]` 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/cook/fs.rs:312:27 [INFO] [stdout] | [INFO] [stdout] 312 | rename(&dest_tmp, &dest)?; [INFO] [stdout] | ^^^^^ help: change this to: `dest` [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: stripping a prefix manually [INFO] [stdout] --> src/cook/fs.rs:323:21 [INFO] [stdout] | [INFO] [stdout] 323 | let entry = head_str["ref: ".len()..].trim_end(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/cook/fs.rs:322:5 [INFO] [stdout] | [INFO] [stdout] 322 | if head_str.starts_with("ref: ") { [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] 322 ~ if let Some() = head_str.strip_prefix("ref: ") { [INFO] [stdout] 323 ~ let entry = .trim_end(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&PathBuf` instead of `&Path` involves a new object where a slice will do [INFO] [stdout] --> src/cook/fs.rs:344:31 [INFO] [stdout] | [INFO] [stdout] 344 | pub fn get_git_ref_entry(dir: &PathBuf, entry: &str) -> 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] help: change this to [INFO] [stdout] | [INFO] [stdout] 344 - pub fn get_git_ref_entry(dir: &PathBuf, entry: &str) -> Result { [INFO] [stdout] 344 + pub fn get_git_ref_entry(dir: &Path, entry: &str) -> Result { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&PathBuf` instead of `&Path` involves a new object where a slice will do [INFO] [stdout] --> src/cook/fs.rs:364:10 [INFO] [stdout] | [INFO] [stdout] 364 | dir: &PathBuf, [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] help: change this to [INFO] [stdout] | [INFO] [stdout] 364 - dir: &PathBuf, [INFO] [stdout] 364 + dir: &Path, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&PathBuf` instead of `&Path` involves a new object where a slice will do [INFO] [stdout] --> src/cook/fs.rs:398:37 [INFO] [stdout] | [INFO] [stdout] 398 | pub fn get_git_remote_tracking(dir: &PathBuf) -> Result<(String, String, String, String), String> { [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] help: change this to [INFO] [stdout] | [INFO] [stdout] 398 - pub fn get_git_remote_tracking(dir: &PathBuf) -> Result<(String, String, String, String), String> { [INFO] [stdout] 398 + pub fn get_git_remote_tracking(dir: &Path) -> Result<(String, String, String, String), String> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/cook/fs.rs:436:36 [INFO] [stdout] | [INFO] [stdout] 436 | remote_name = Some(line["remote = ".len()..].trim().to_string()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/cook/fs.rs:435:13 [INFO] [stdout] | [INFO] [stdout] 435 | if line.starts_with("remote = ") { [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] 435 ~ if let Some() = line.strip_prefix("remote = ") { [INFO] [stdout] 436 ~ remote_name = Some(.trim().to_string()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/cook/fs.rs:439:58 [INFO] [stdout] | [INFO] [stdout] 439 | remote_branch = Some(get_git_branch_name(line["merge = ".len()..].trim())?); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/cook/fs.rs:438:13 [INFO] [stdout] | [INFO] [stdout] 438 | if line.starts_with("merge = ") { [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] 438 ~ if let Some() = line.strip_prefix("merge = ") { [INFO] [stdout] 439 ~ remote_branch = Some(get_git_branch_name(.trim())?); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/cook/fs.rs:467:31 [INFO] [stdout] | [INFO] [stdout] 467 | let mut url = line["url = ".len()..].trim(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/cook/fs.rs:466:13 [INFO] [stdout] | [INFO] [stdout] 466 | if line.starts_with("url = ") { [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] 466 ~ if let Some() = line.strip_prefix("url = ") { [INFO] [stdout] 467 ~ let mut url = .trim(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a suffix manually [INFO] [stdout] --> src/cook/fs.rs:491:16 [INFO] [stdout] | [INFO] [stdout] 491 | return &url[..url.len() - ".git".len()]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the suffix was tested here [INFO] [stdout] --> src/cook/fs.rs:490:5 [INFO] [stdout] | [INFO] [stdout] 490 | if url.ends_with(".git") { [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_suffix` method [INFO] [stdout] | [INFO] [stdout] 490 ~ if let Some() = url.strip_suffix(".git") { [INFO] [stdout] 491 ~ return ; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/cook/fs.rs:498:8 [INFO] [stdout] | [INFO] [stdout] 498 | Ok(local_branch_path [INFO] [stdout] | ________^ [INFO] [stdout] 499 | | .split('/') [INFO] [stdout] 500 | | .last() [INFO] [stdout] | |_______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] = note: `#[warn(clippy::double_ended_iterator_last)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 500 - .last() [INFO] [stdout] 500 + .next_back() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/cook/ident.rs:20:13 [INFO] [stdout] | [INFO] [stdout] 20 | / &Command::new("date") [INFO] [stdout] 21 | | .arg("-u") [INFO] [stdout] 22 | | .arg("+%Y-%m-%dT%H:%M:%SZ") [INFO] [stdout] 23 | | .stdout(Stdio::piped()) [INFO] [stdout] ... | [INFO] [stdout] 26 | | .stdout [INFO] [stdout] 27 | | .trim_ascii(), [INFO] [stdout] | |_____________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 20 ~ Command::new("date") [INFO] [stdout] 21 + .arg("-u") [INFO] [stdout] 22 + .arg("+%Y-%m-%dT%H:%M:%SZ") [INFO] [stdout] 23 + .stdout(Stdio::piped()) [INFO] [stdout] 24 + .output() [INFO] [stdout] 25 + .expect("Failed to get current ISO-formatted time") [INFO] [stdout] 26 + .stdout [INFO] [stdout] 27 ~ .trim_ascii(), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/cook/package.rs:30:13 [INFO] [stdout] | [INFO] [stdout] 30 | &auto_deps, [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `auto_deps` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/cook/package.rs:173:5 [INFO] [stdout] | [INFO] [stdout] 173 | return Ok(()); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 173 - return Ok(()); [INFO] [stdout] 173 + Ok(()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct update has no effect, all the fields in the struct have already been specified [INFO] [stdout] --> src/cook/package.rs:169:11 [INFO] [stdout] | [INFO] [stdout] 169 | ..Default::default() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_update [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/cook/package.rs:205:5 [INFO] [stdout] | [INFO] [stdout] 205 | if let Some(cross_target) = std::env::var("COOKBOOK_CROSS_TARGET").ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] help: consider matching on `Ok(cross_target)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 205 - if let Some(cross_target) = std::env::var("COOKBOOK_CROSS_TARGET").ok() { [INFO] [stdout] 205 + if let Ok(cross_target) = std::env::var("COOKBOOK_CROSS_TARGET") { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/cook/package.rs:205:5 [INFO] [stdout] | [INFO] [stdout] 205 | / if let Some(cross_target) = std::env::var("COOKBOOK_CROSS_TARGET").ok() { [INFO] [stdout] 206 | | if cross_target != "" { [INFO] [stdout] 207 | | // TODO: automatically pass COOKBOOK_CROSS_GNU_TARGET? [INFO] [stdout] 208 | | target_dir = target_dir.join(cross_target) [INFO] [stdout] 209 | | } [INFO] [stdout] 210 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 205 ~ if let Some(cross_target) = std::env::var("COOKBOOK_CROSS_TARGET").ok() [INFO] [stdout] 206 ~ && cross_target != "" { [INFO] [stdout] 207 | // TODO: automatically pass COOKBOOK_CROSS_GNU_TARGET? [INFO] [stdout] 208 | target_dir = target_dir.join(cross_target) [INFO] [stdout] 209 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/cook/package.rs:206:12 [INFO] [stdout] | [INFO] [stdout] 206 | if cross_target != "" { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!cross_target.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `&mut std::process::Command` [INFO] [stdout] --> src/cook/pty.rs:71:48 [INFO] [stdout] | [INFO] [stdout] 71 | Some(stdout) => stdout.0.spawn_command(command.into()), [INFO] [stdout] | ^^^^^^^^^^^^^^ help: consider removing `.into()`: `command` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enclosing `Ok` and `?` operator are unneeded [INFO] [stdout] --> src/cook/pty.rs:333:9 [INFO] [stdout] | [INFO] [stdout] 333 | Ok(self.fd.spawn_command(builder)?) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark [INFO] [stdout] = note: `#[warn(clippy::needless_question_mark)]` on by default [INFO] [stdout] help: remove the enclosing `Ok` and `?` operator [INFO] [stdout] | [INFO] [stdout] 333 - Ok(self.fd.spawn_command(builder)?) [INFO] [stdout] 333 + self.fd.spawn_command(builder) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/cook/tree.rs:40:1 [INFO] [stdout] | [INFO] [stdout] 40 | / pub fn walk_tree_entry( [INFO] [stdout] 41 | | package_name: &PackageName, [INFO] [stdout] 42 | | recipe_map: &HashMap<&PackageName, &CookRecipe>, [INFO] [stdout] 43 | | prefix: &str, [INFO] [stdout] ... | [INFO] [stdout] 48 | | op: fn(&PackageName, &str, bool, &WalkTreeEntry) -> anyhow::Result<()>, [INFO] [stdout] 49 | | ) -> anyhow::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/recipe.rs:79:48 [INFO] [stdout] | [INFO] [stdout] 79 | if let Some(arm) = re.captures(&tar) { [INFO] [stdout] | ^^^^ help: change this to: `tar` [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 `impl` can be derived [INFO] [stdout] --> src/recipe.rs:130:1 [INFO] [stdout] | [INFO] [stdout] 130 | / impl Default for BuildKind { [INFO] [stdout] 131 | | fn default() -> Self { [INFO] [stdout] 132 | | BuildKind::None [INFO] [stdout] 133 | | } [INFO] [stdout] 134 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 92 + #[derive(Default)] [INFO] [stdout] 93 | pub enum BuildKind { [INFO] [stdout] 94 | /// Will not build (for meta packages) [INFO] [stdout] 95 | #[serde(rename = "none")] [INFO] [stdout] 96 ~ #[default] [INFO] [stdout] 97 ~ None, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/recipe.rs:179:9 [INFO] [stdout] | [INFO] [stdout] 179 | build.kind = kind; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `recipe::BuildRecipe { kind: kind, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/recipe.rs:178:9 [INFO] [stdout] | [INFO] [stdout] 178 | let mut build = Self::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: the borrowed expression implements the required traits [INFO] [stdout] --> src/recipe.rs:211:39 [INFO] [stdout] | [INFO] [stdout] 211 | let toml = fs::read_to_string(&file) [INFO] [stdout] | ^^^^^ help: change this to: `file` [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: redundant closure [INFO] [stdout] --> src/recipe.rs:220:47 [INFO] [stdout] | [INFO] [stdout] 220 | self.optional_packages.iter().map(|p| Some(p)).collect(); [INFO] [stdout] | ^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Some` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/recipe.rs:293:5 [INFO] [stdout] | [INFO] [stdout] 293 | / fn new_recursive( [INFO] [stdout] 294 | | names: &[PackageName], [INFO] [stdout] 295 | | recurse_build_deps: bool, [INFO] [stdout] 296 | | recurse_dev_build_deps: bool, [INFO] [stdout] ... | [INFO] [stdout] 301 | | recursion: usize, [INFO] [stdout] 302 | | ) -> Result, PackageError> { [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: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/recipe.rs:494:62 [INFO] [stdout] | [INFO] [stdout] 494 | pub fn recipes_mark_as_deps(names: &[PackageName], packages: &mut Vec) { [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] help: change this to [INFO] [stdout] | [INFO] [stdout] 494 - pub fn recipes_mark_as_deps(names: &[PackageName], packages: &mut Vec) { [INFO] [stdout] 494 + pub fn recipes_mark_as_deps(names: &[PackageName], packages: &mut [CookRecipe]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/config.rs:87:22 [INFO] [stdout] | [INFO] [stdout] 87 | .map(|f| usize::from(f)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `usize::from` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/config.rs:109:8 [INFO] [stdout] | [INFO] [stdout] 109 | if config.mirrors.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `config.mirrors.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/config.rs:124:29 [INFO] [stdout] | [INFO] [stdout] 124 | if let Ok(e) = env::var(&key) { [INFO] [stdout] | ^^^^ help: change this to: `key` [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: unneeded `return` statement [INFO] [stdout] --> src/config.rs:132:5 [INFO] [stdout] | [INFO] [stdout] 132 | return CONFIG.get().expect("Configuration is not initialized"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 132 - return CONFIG.get().expect("Configuration is not initialized"); [INFO] [stdout] 132 + CONFIG.get().expect("Configuration is not initialized") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/cook/cook_build.rs:99:17 [INFO] [stdout] | [INFO] [stdout] 99 | / if let Ok(relative_path) = path.strip_prefix(target_dir) { [INFO] [stdout] 100 | | if verbose { [INFO] [stdout] 101 | | log_to_pty!(logger, "DEBUG: {} needs {}", relative_path.display(), name); [INFO] [stdout] 102 | | } [INFO] [stdout] 103 | | } [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] 99 ~ if let Ok(relative_path) = path.strip_prefix(target_dir) [INFO] [stdout] 100 ~ && verbose { [INFO] [stdout] 101 | log_to_pty!(logger, "DEBUG: {} needs {}", relative_path.display(), name); [INFO] [stdout] 102 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/cook/cook_build.rs:170:1 [INFO] [stdout] | [INFO] [stdout] 170 | / pub fn build( [INFO] [stdout] 171 | | recipe_dir: &Path, [INFO] [stdout] 172 | | source_dir: &Path, [INFO] [stdout] 173 | | target_dir: &Path, [INFO] [stdout] ... | [INFO] [stdout] 178 | | logger: &PtyOut, [INFO] [stdout] 179 | | ) -> Result<(Vec, BTreeSet), String> { [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 `if` statement can be collapsed [INFO] [stdout] --> src/cook/cook_build.rs:241:5 [INFO] [stdout] | [INFO] [stdout] 241 | / if let Ok(recipe_modified) = modified(&recipe_dir.join("recipe.toml")) { [INFO] [stdout] 242 | | if recipe_modified > source_modified { [INFO] [stdout] 243 | | source_modified = recipe_modified [INFO] [stdout] 244 | | } [INFO] [stdout] 245 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 241 ~ if let Ok(recipe_modified) = modified(&recipe_dir.join("recipe.toml")) [INFO] [stdout] 242 ~ && recipe_modified > source_modified { [INFO] [stdout] 243 | source_modified = recipe_modified [INFO] [stdout] 244 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/cook/cook_build.rs:300:69 [INFO] [stdout] | [INFO] [stdout] 300 | if recipe.build.kind != BuildKind::Remote && !name.is_host() && dep_host_pkgars.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!dep_host_pkgars.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/cook/cook_build.rs:432:30 [INFO] [stdout] | [INFO] [stdout] 432 | create_dir_clean(&stage_dir)?; [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `stage_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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/cook/cook_build.rs:434:47 [INFO] [stdout] | [INFO] [stdout] 434 | let glob = globset::Glob::new(&path).map_err(|e| format!("{}", e))?; [INFO] [stdout] | ^^^^^ help: change this to: `path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/cook/cook_build.rs:452:32 [INFO] [stdout] | [INFO] [stdout] 452 | rename(&stage_dir_tmp, &stage_dir)?; [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `stage_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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/cook/cook_build.rs:470:20 [INFO] [stdout] | [INFO] [stdout] 470 | remove_all(&stage_dir)?; [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `stage_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: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/cook/cook_build.rs:489:5 [INFO] [stdout] | [INFO] [stdout] 489 | if let Some(cross_target) = std::env::var("COOKBOOK_CROSS_TARGET").ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] = note: `#[warn(clippy::match_result_ok)]` on by default [INFO] [stdout] help: consider matching on `Ok(cross_target)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 489 - if let Some(cross_target) = std::env::var("COOKBOOK_CROSS_TARGET").ok() { [INFO] [stdout] 489 + if let Ok(cross_target) = std::env::var("COOKBOOK_CROSS_TARGET") { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/cook/cook_build.rs:489:5 [INFO] [stdout] | [INFO] [stdout] 489 | / if let Some(cross_target) = std::env::var("COOKBOOK_CROSS_TARGET").ok() { [INFO] [stdout] 490 | | if cross_target != "" { [INFO] [stdout] 491 | | // TODO: automatically pass COOKBOOK_CROSS_GNU_TARGET? [INFO] [stdout] 492 | | target_dir = target_dir.join(cross_target) [INFO] [stdout] 493 | | } [INFO] [stdout] 494 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 489 ~ if let Some(cross_target) = std::env::var("COOKBOOK_CROSS_TARGET").ok() [INFO] [stdout] 490 ~ && cross_target != "" { [INFO] [stdout] 491 | // TODO: automatically pass COOKBOOK_CROSS_GNU_TARGET? [INFO] [stdout] 492 | target_dir = target_dir.join(cross_target) [INFO] [stdout] 493 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/cook/cook_build.rs:490:12 [INFO] [stdout] | [INFO] [stdout] 490 | if cross_target != "" { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!cross_target.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] = note: `#[warn(clippy::comparison_to_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/cook/cook_build.rs:506:5 [INFO] [stdout] | [INFO] [stdout] 506 | if let Some(cross_target) = std::env::var("COOKBOOK_CROSS_TARGET").ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] help: consider matching on `Ok(cross_target)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 506 - if let Some(cross_target) = std::env::var("COOKBOOK_CROSS_TARGET").ok() { [INFO] [stdout] 506 + if let Ok(cross_target) = std::env::var("COOKBOOK_CROSS_TARGET") { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/cook/cook_build.rs:506:5 [INFO] [stdout] | [INFO] [stdout] 506 | / if let Some(cross_target) = std::env::var("COOKBOOK_CROSS_TARGET").ok() { [INFO] [stdout] 507 | | if cross_target != "" { [INFO] [stdout] 508 | | // TODO: automatically pass COOKBOOK_CROSS_GNU_TARGET? [INFO] [stdout] 509 | | target_dir = target_dir.join(cross_target) [INFO] [stdout] 510 | | } [INFO] [stdout] 511 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 506 ~ if let Some(cross_target) = std::env::var("COOKBOOK_CROSS_TARGET").ok() [INFO] [stdout] 507 ~ && cross_target != "" { [INFO] [stdout] 508 | // TODO: automatically pass COOKBOOK_CROSS_GNU_TARGET? [INFO] [stdout] 509 | target_dir = target_dir.join(cross_target) [INFO] [stdout] 510 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/cook/cook_build.rs:507:12 [INFO] [stdout] | [INFO] [stdout] 507 | if cross_target != "" { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!cross_target.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&PathBuf` instead of `&Path` involves a new object where a slice will do [INFO] [stdout] --> src/cook/cook_build.rs:517:15 [INFO] [stdout] | [INFO] [stdout] 517 | deps_dir: &PathBuf, [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] 517 - deps_dir: &PathBuf, [INFO] [stdout] 517 + deps_dir: &Path, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/cook/cook_build.rs:560:52 [INFO] [stdout] | [INFO] [stdout] 560 | symlink(Path::new("usr").join(folder), &deps_dir_tmp.join(folder))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `deps_dir_tmp.join(folder)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/cook/cook_build.rs:568:39 [INFO] [stdout] | [INFO] [stdout] 568 | pkgar::extract(pkey_path, &archive_path, deps_dir_tmp.to_str().unwrap()).map_err( [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `archive_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 `if` statement can be collapsed [INFO] [stdout] --> src/cook/cook_build.rs:599:5 [INFO] [stdout] | [INFO] [stdout] 599 | / if auto_deps_path.is_file() && !cook_config.clean_target { [INFO] [stdout] 600 | | if modified(&auto_deps_path)? < modified_all(stage_dirs, modified)? { [INFO] [stdout] 601 | | remove_all(&auto_deps_path)? [INFO] [stdout] 602 | | } [INFO] [stdout] 603 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 599 ~ if auto_deps_path.is_file() && !cook_config.clean_target [INFO] [stdout] 600 ~ && modified(&auto_deps_path)? < modified_all(stage_dirs, modified)? { [INFO] [stdout] 601 | remove_all(&auto_deps_path)? [INFO] [stdout] 602 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/cook/cook_build.rs:647:70 [INFO] [stdout] | [INFO] [stdout] 647 | let (_, source_pkgar, _) = package_source_paths(package, &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_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/cook/cook_build.rs:658:36 [INFO] [stdout] | [INFO] [stdout] 658 | rename(&stage_dir_tmp, &stage_dir)?; [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `stage_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: this `if` statement can be collapsed [INFO] [stdout] --> src/cook/cook_build.rs:663:5 [INFO] [stdout] | [INFO] [stdout] 663 | / if auto_deps_path.is_file() && !cook_config.clean_target { [INFO] [stdout] 664 | | if modified(&auto_deps_path)? < modified_all(&stage_dirs, modified)? { [INFO] [stdout] 665 | | remove_all(&auto_deps_path)? [INFO] [stdout] 666 | | } [INFO] [stdout] 667 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 663 ~ if auto_deps_path.is_file() && !cook_config.clean_target [INFO] [stdout] 664 ~ && modified(&auto_deps_path)? < modified_all(&stage_dirs, modified)? { [INFO] [stdout] 665 | remove_all(&auto_deps_path)? [INFO] [stdout] 666 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/cook/fetch.rs:23:33 [INFO] [stdout] | [INFO] [stdout] 23 | blake3::blake3_progress(&path) [INFO] [stdout] | ^^^^^ help: change this to: `path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/cook/fetch.rs:25:31 [INFO] [stdout] | [INFO] [stdout] 25 | blake3::blake3_silent(&path) [INFO] [stdout] | ^^^^^ help: change this to: `path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/cook/fetch.rs:86:65 [INFO] [stdout] | [INFO] [stdout] 86 | let source_tar_blake3 = get_blake3(&source_tar, true && logger.is_none())?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `logger.is_none()` [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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/cook/fetch.rs:59:58 [INFO] [stdout] | [INFO] [stdout] 59 | let recipe = fetch_resolve_canon(recipe_dir, &same_as, recipe.name.is_host())?; [INFO] [stdout] | ^^^^^^^^ help: change this to: `same_as` [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/cook/fetch.rs:62:45 [INFO] [stdout] | [INFO] [stdout] 62 | fetch_make_symlink(&source_dir, &same_as)?; [INFO] [stdout] | ^^^^^^^^ help: change this to: `same_as` [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/cook/fetch.rs:135:58 [INFO] [stdout] | [INFO] [stdout] 135 | let recipe = fetch_resolve_canon(recipe_dir, &same_as, recipe.name.is_host())?; [INFO] [stdout] | ^^^^^^^^ help: change this to: `same_as` [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/cook/fetch.rs:138:45 [INFO] [stdout] | [INFO] [stdout] 138 | fetch_make_symlink(&source_dir, &same_as)?; [INFO] [stdout] | ^^^^^^^^ help: change this to: `same_as` [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/cook/fetch.rs:182:43 [INFO] [stdout] | [INFO] [stdout] 182 | .arg(translate_mirror(&git)); [INFO] [stdout] | ^^^^ help: change this to: `git` [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/cook/fetch.rs:223:75 [INFO] [stdout] | [INFO] [stdout] 223 | && let Ok(exp_rev) = get_git_tag_rev(&source_dir, &rev) [INFO] [stdout] | ^^^^ help: change this to: `rev` [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` has identical blocks [INFO] [stdout] --> src/cook/fetch.rs:237:55 [INFO] [stdout] | [INFO] [stdout] 237 | } else if remote_name != "origin" { [INFO] [stdout] | _______________________________________________________^ [INFO] [stdout] 238 | | false [INFO] [stdout] 239 | | } else if &remote_url != chop_dot_git(git) { [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/cook/fetch.rs:239:64 [INFO] [stdout] | [INFO] [stdout] 239 | } else if &remote_url != chop_dot_git(git) { [INFO] [stdout] | ________________________________________________________________^ [INFO] [stdout] 240 | | false [INFO] [stdout] 241 | | } 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: needlessly taken reference of left operand [INFO] [stdout] --> src/cook/fetch.rs:239:31 [INFO] [stdout] | [INFO] [stdout] 239 | } else if &remote_url != chop_dot_git(git) { [INFO] [stdout] | -----------^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: use the left value directly: `remote_url` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] = note: `#[warn(clippy::op_ref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/cook/fetch.rs:269:24 [INFO] [stdout] | [INFO] [stdout] 269 | if patches.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!patches.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/cook/fetch.rs:331:35 [INFO] [stdout] | [INFO] [stdout] 331 | download_wget(&tar, &source_tar, logger)?; [INFO] [stdout] | ^^^^ help: change this to: `tar` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/cook/fetch.rs:363:13 [INFO] [stdout] | [INFO] [stdout] 363 | / if source_dir.is_dir() { [INFO] [stdout] 364 | | if tar_updated || fetch_is_patches_newer(recipe_dir, patches, &source_dir)? { [INFO] [stdout] 365 | | log_to_pty!( [INFO] [stdout] 366 | | logger, [INFO] [stdout] ... | [INFO] [stdout] 371 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 363 ~ if source_dir.is_dir() [INFO] [stdout] 364 ~ && (tar_updated || fetch_is_patches_newer(recipe_dir, patches, &source_dir)?) { [INFO] [stdout] 365 | log_to_pty!( [INFO] [stdout] ... [INFO] [stdout] 369 | remove_all(&source_dir)? [INFO] [stdout] 370 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/cook/fetch.rs:449:20 [INFO] [stdout] | [INFO] [stdout] 449 | return Err(format!("Infinite loop detected")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Infinite loop detected".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: writing `&PathBuf` instead of `&Path` involves a new object where a slice will do [INFO] [stdout] --> src/cook/fetch.rs:483:17 [INFO] [stdout] | [INFO] [stdout] 483 | source_dir: &PathBuf, [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] help: change this to [INFO] [stdout] | [INFO] [stdout] 483 ~ source_dir: &Path, [INFO] [stdout] 484 | package_path: Option<&String>, [INFO] [stdout] 485 | logger: &PtyOut, [INFO] [stdout] 486 | ) -> Result<(), String> { [INFO] [stdout] 487 ~ let mut source_dir = source_dir.to_path_buf(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/cook/fetch.rs:508:5 [INFO] [stdout] | [INFO] [stdout] 508 | / return format!( [INFO] [stdout] 509 | | "{}/{}/{}.{}", [INFO] [stdout] 510 | | REMOTE_PKG_SOURCE, [INFO] [stdout] 511 | | redoxer::target(), [INFO] [stdout] 512 | | name, [INFO] [stdout] 513 | | ext [INFO] [stdout] 514 | | ); [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 508 ~ format!( [INFO] [stdout] 509 + "{}/{}/{}.{}", [INFO] [stdout] 510 + REMOTE_PKG_SOURCE, [INFO] [stdout] 511 + redoxer::target(), [INFO] [stdout] 512 + name, [INFO] [stdout] 513 + ext [INFO] [stdout] 514 ~ ) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/cook/fetch.rs:518:5 [INFO] [stdout] | [INFO] [stdout] 518 | return format!("{}/id_ed25519.pub.toml", REMOTE_PKG_SOURCE); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 518 - return format!("{}/id_ed25519.pub.toml", REMOTE_PKG_SOURCE); [INFO] [stdout] 518 + format!("{}/id_ed25519.pub.toml", REMOTE_PKG_SOURCE) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct update has no effect, all the fields in the struct have already been specified [INFO] [stdout] --> src/cook/fetch.rs:577:23 [INFO] [stdout] | [INFO] [stdout] 577 | ..Default::default() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_update [INFO] [stdout] = note: `#[warn(clippy::needless_update)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/cook/fetch.rs:607:5 [INFO] [stdout] | [INFO] [stdout] 607 | return Ok(false); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 607 - return Ok(false); [INFO] [stdout] 607 + Ok(false) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/cook/fetch.rs:592:32 [INFO] [stdout] | [INFO] [stdout] 592 | let source_time = modified(&source_dir)?; [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `source_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: passing a unit value to a function [INFO] [stdout] --> src/cook/fetch.rs:640:5 [INFO] [stdout] | [INFO] [stdout] 640 | / Ok(if let Some(script) = script { [INFO] [stdout] 641 | | let mut command = Command::new("bash"); [INFO] [stdout] 642 | | command.arg("-ex"); [INFO] [stdout] 643 | | command.current_dir(source_dir_tmp); [INFO] [stdout] ... | [INFO] [stdout] 648 | | )?; [INFO] [stdout] 649 | | }) [INFO] [stdout] | |______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unit_arg [INFO] [stdout] = note: `#[warn(clippy::unit_arg)]` on by default [INFO] [stdout] help: move the expression in front of the call and replace it with the unit literal `()` [INFO] [stdout] | [INFO] [stdout] 640 ~ let _: () = if let Some(script) = script { [INFO] [stdout] 641 + let mut command = Command::new("bash"); [INFO] [stdout] 642 + command.arg("-ex"); [INFO] [stdout] 643 + command.current_dir(source_dir_tmp); [INFO] [stdout] 644 + run_command_stdin( [INFO] [stdout] 645 + command, [INFO] [stdout] 646 + format!("{SHARED_PRESCRIPT}\n{script}").as_bytes(), [INFO] [stdout] 647 + logger, [INFO] [stdout] 648 + )?; [INFO] [stdout] 649 + }; [INFO] [stdout] 650 + Ok(()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/cook/fetch.rs:663:41 [INFO] [stdout] | [INFO] [stdout] 663 | fetch_apply_source_info_from_remote(&recipe, &info) [INFO] [stdout] | ^^^^^^^ help: change this to: `recipe` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `&Box`. Consider using just `&T` [INFO] [stdout] --> src/cook/fs.rs:69:9 [INFO] [stdout] | [INFO] [stdout] 69 | mv: &'a Box Option<&'a Path>>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&'a impl Fn(PathBuf) -> Option<&'a Path>` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrowed_box [INFO] [stdout] = note: `#[warn(clippy::borrowed_box)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `&Box`. Consider using just `&T` [INFO] [stdout] --> src/cook/fs.rs:77:9 [INFO] [stdout] | [INFO] [stdout] 77 | mv: &'a Box Option<&'a Path>>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&'a impl Fn(PathBuf) -> Option<&'a Path>` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrowed_box [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/cook/fs.rs:98:28 [INFO] [stdout] | [INFO] [stdout] 98 | fs::create_dir_all(&path.parent().unwrap())?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `path.parent().unwrap()` [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: writing `&PathBuf` instead of `&Path` involves a new object where a slice will do [INFO] [stdout] --> src/cook/fs.rs:295:35 [INFO] [stdout] | [INFO] [stdout] 295 | pub fn offline_check_exists(path: &PathBuf) -> Result<(), String> { [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] help: change this to [INFO] [stdout] | [INFO] [stdout] 295 - pub fn offline_check_exists(path: &PathBuf) -> Result<(), String> { [INFO] [stdout] 295 + pub fn offline_check_exists(path: &Path) -> Result<(), String> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement with `?` operator [INFO] [stdout] --> src/cook/fs.rs:297:9 [INFO] [stdout] | [INFO] [stdout] 297 | return Err(format!( [INFO] [stdout] | ^^^^^^^ help: remove it [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return_with_question_mark [INFO] [stdout] = note: `#[warn(clippy::needless_return_with_question_mark)]` 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/cook/fs.rs:312:27 [INFO] [stdout] | [INFO] [stdout] 312 | rename(&dest_tmp, &dest)?; [INFO] [stdout] | ^^^^^ help: change this to: `dest` [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: stripping a prefix manually [INFO] [stdout] --> src/cook/fs.rs:323:21 [INFO] [stdout] | [INFO] [stdout] 323 | let entry = head_str["ref: ".len()..].trim_end(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/cook/fs.rs:322:5 [INFO] [stdout] | [INFO] [stdout] 322 | if head_str.starts_with("ref: ") { [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] 322 ~ if let Some() = head_str.strip_prefix("ref: ") { [INFO] [stdout] 323 ~ let entry = .trim_end(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&PathBuf` instead of `&Path` involves a new object where a slice will do [INFO] [stdout] --> src/cook/fs.rs:344:31 [INFO] [stdout] | [INFO] [stdout] 344 | pub fn get_git_ref_entry(dir: &PathBuf, entry: &str) -> 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] help: change this to [INFO] [stdout] | [INFO] [stdout] 344 - pub fn get_git_ref_entry(dir: &PathBuf, entry: &str) -> Result { [INFO] [stdout] 344 + pub fn get_git_ref_entry(dir: &Path, entry: &str) -> Result { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&PathBuf` instead of `&Path` involves a new object where a slice will do [INFO] [stdout] --> src/cook/fs.rs:364:10 [INFO] [stdout] | [INFO] [stdout] 364 | dir: &PathBuf, [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] help: change this to [INFO] [stdout] | [INFO] [stdout] 364 - dir: &PathBuf, [INFO] [stdout] 364 + dir: &Path, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&PathBuf` instead of `&Path` involves a new object where a slice will do [INFO] [stdout] --> src/cook/fs.rs:398:37 [INFO] [stdout] | [INFO] [stdout] 398 | pub fn get_git_remote_tracking(dir: &PathBuf) -> Result<(String, String, String, String), String> { [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] help: change this to [INFO] [stdout] | [INFO] [stdout] 398 - pub fn get_git_remote_tracking(dir: &PathBuf) -> Result<(String, String, String, String), String> { [INFO] [stdout] 398 + pub fn get_git_remote_tracking(dir: &Path) -> Result<(String, String, String, String), String> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/cook/fs.rs:436:36 [INFO] [stdout] | [INFO] [stdout] 436 | remote_name = Some(line["remote = ".len()..].trim().to_string()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/cook/fs.rs:435:13 [INFO] [stdout] | [INFO] [stdout] 435 | if line.starts_with("remote = ") { [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] 435 ~ if let Some() = line.strip_prefix("remote = ") { [INFO] [stdout] 436 ~ remote_name = Some(.trim().to_string()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/cook/fs.rs:439:58 [INFO] [stdout] | [INFO] [stdout] 439 | remote_branch = Some(get_git_branch_name(line["merge = ".len()..].trim())?); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/cook/fs.rs:438:13 [INFO] [stdout] | [INFO] [stdout] 438 | if line.starts_with("merge = ") { [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] 438 ~ if let Some() = line.strip_prefix("merge = ") { [INFO] [stdout] 439 ~ remote_branch = Some(get_git_branch_name(.trim())?); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/cook/fs.rs:467:31 [INFO] [stdout] | [INFO] [stdout] 467 | let mut url = line["url = ".len()..].trim(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/cook/fs.rs:466:13 [INFO] [stdout] | [INFO] [stdout] 466 | if line.starts_with("url = ") { [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] 466 ~ if let Some() = line.strip_prefix("url = ") { [INFO] [stdout] 467 ~ let mut url = .trim(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/cookbook_redoxer.rs:8:9 [INFO] [stdout] | [INFO] [stdout] 8 | / if args[1] == "write-exec" { [INFO] [stdout] 9 | | if let Ok(stage_dir) = std::env::var("COOKBOOK_STAGE") { [INFO] [stdout] 10 | | args.insert(2, format!("{}/root", stage_dir)); [INFO] [stdout] 11 | | args.insert(2, "--folder".to_string()); [INFO] [stdout] ... | [INFO] [stdout] 15 | | } [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] 8 ~ if args[1] == "write-exec" [INFO] [stdout] 9 ~ && let Ok(stage_dir) = std::env::var("COOKBOOK_STAGE") { [INFO] [stdout] 10 | args.insert(2, format!("{}/root", stage_dir)); [INFO] [stdout] ... [INFO] [stdout] 13 | args.insert(2, "--root".to_string()); [INFO] [stdout] 14 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a suffix manually [INFO] [stdout] --> src/cook/fs.rs:491:16 [INFO] [stdout] | [INFO] [stdout] 491 | return &url[..url.len() - ".git".len()]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the suffix was tested here [INFO] [stdout] --> src/cook/fs.rs:490:5 [INFO] [stdout] | [INFO] [stdout] 490 | if url.ends_with(".git") { [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_suffix` method [INFO] [stdout] | [INFO] [stdout] 490 ~ if let Some() = url.strip_suffix(".git") { [INFO] [stdout] 491 ~ return ; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/cook/fs.rs:498:8 [INFO] [stdout] | [INFO] [stdout] 498 | Ok(local_branch_path [INFO] [stdout] | ________^ [INFO] [stdout] 499 | | .split('/') [INFO] [stdout] 500 | | .last() [INFO] [stdout] | |_______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] = note: `#[warn(clippy::double_ended_iterator_last)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 500 - .last() [INFO] [stdout] 500 + .next_back() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/cook/ident.rs:20:13 [INFO] [stdout] | [INFO] [stdout] 20 | / &Command::new("date") [INFO] [stdout] 21 | | .arg("-u") [INFO] [stdout] 22 | | .arg("+%Y-%m-%dT%H:%M:%SZ") [INFO] [stdout] 23 | | .stdout(Stdio::piped()) [INFO] [stdout] ... | [INFO] [stdout] 26 | | .stdout [INFO] [stdout] 27 | | .trim_ascii(), [INFO] [stdout] | |_____________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 20 ~ Command::new("date") [INFO] [stdout] 21 + .arg("-u") [INFO] [stdout] 22 + .arg("+%Y-%m-%dT%H:%M:%SZ") [INFO] [stdout] 23 + .stdout(Stdio::piped()) [INFO] [stdout] 24 + .output() [INFO] [stdout] 25 + .expect("Failed to get current ISO-formatted time") [INFO] [stdout] 26 + .stdout [INFO] [stdout] 27 ~ .trim_ascii(), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/cook/package.rs:30:13 [INFO] [stdout] | [INFO] [stdout] 30 | &auto_deps, [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `auto_deps` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/cook/package.rs:173:5 [INFO] [stdout] | [INFO] [stdout] 173 | return Ok(()); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 173 - return Ok(()); [INFO] [stdout] 173 + Ok(()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct update has no effect, all the fields in the struct have already been specified [INFO] [stdout] --> src/cook/package.rs:169:11 [INFO] [stdout] | [INFO] [stdout] 169 | ..Default::default() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_update [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/cook/package.rs:205:5 [INFO] [stdout] | [INFO] [stdout] 205 | if let Some(cross_target) = std::env::var("COOKBOOK_CROSS_TARGET").ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] help: consider matching on `Ok(cross_target)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 205 - if let Some(cross_target) = std::env::var("COOKBOOK_CROSS_TARGET").ok() { [INFO] [stdout] 205 + if let Ok(cross_target) = std::env::var("COOKBOOK_CROSS_TARGET") { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/cook/package.rs:205:5 [INFO] [stdout] | [INFO] [stdout] 205 | / if let Some(cross_target) = std::env::var("COOKBOOK_CROSS_TARGET").ok() { [INFO] [stdout] 206 | | if cross_target != "" { [INFO] [stdout] 207 | | // TODO: automatically pass COOKBOOK_CROSS_GNU_TARGET? [INFO] [stdout] 208 | | target_dir = target_dir.join(cross_target) [INFO] [stdout] 209 | | } [INFO] [stdout] 210 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 205 ~ if let Some(cross_target) = std::env::var("COOKBOOK_CROSS_TARGET").ok() [INFO] [stdout] 206 ~ && cross_target != "" { [INFO] [stdout] 207 | // TODO: automatically pass COOKBOOK_CROSS_GNU_TARGET? [INFO] [stdout] 208 | target_dir = target_dir.join(cross_target) [INFO] [stdout] 209 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/cook/package.rs:206:12 [INFO] [stdout] | [INFO] [stdout] 206 | if cross_target != "" { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!cross_target.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `&mut std::process::Command` [INFO] [stdout] --> src/cook/pty.rs:71:48 [INFO] [stdout] | [INFO] [stdout] 71 | Some(stdout) => stdout.0.spawn_command(command.into()), [INFO] [stdout] | ^^^^^^^^^^^^^^ help: consider removing `.into()`: `command` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enclosing `Ok` and `?` operator are unneeded [INFO] [stdout] --> src/cook/pty.rs:333:9 [INFO] [stdout] | [INFO] [stdout] 333 | Ok(self.fd.spawn_command(builder)?) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark [INFO] [stdout] = note: `#[warn(clippy::needless_question_mark)]` on by default [INFO] [stdout] help: remove the enclosing `Ok` and `?` operator [INFO] [stdout] | [INFO] [stdout] 333 - Ok(self.fd.spawn_command(builder)?) [INFO] [stdout] 333 + self.fd.spawn_command(builder) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/cook/tree.rs:40:1 [INFO] [stdout] | [INFO] [stdout] 40 | / pub fn walk_tree_entry( [INFO] [stdout] 41 | | package_name: &PackageName, [INFO] [stdout] 42 | | recipe_map: &HashMap<&PackageName, &CookRecipe>, [INFO] [stdout] 43 | | prefix: &str, [INFO] [stdout] ... | [INFO] [stdout] 48 | | op: fn(&PackageName, &str, bool, &WalkTreeEntry) -> anyhow::Result<()>, [INFO] [stdout] 49 | | ) -> anyhow::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 `if` statement can be collapsed [INFO] [stdout] --> src/bin/cookbook_redoxer.rs:8:9 [INFO] [stdout] | [INFO] [stdout] 8 | / if args[1] == "write-exec" { [INFO] [stdout] 9 | | if let Ok(stage_dir) = std::env::var("COOKBOOK_STAGE") { [INFO] [stdout] 10 | | args.insert(2, format!("{}/root", stage_dir)); [INFO] [stdout] 11 | | args.insert(2, "--folder".to_string()); [INFO] [stdout] ... | [INFO] [stdout] 15 | | } [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] 8 ~ if args[1] == "write-exec" [INFO] [stdout] 9 ~ && let Ok(stage_dir) = std::env::var("COOKBOOK_STAGE") { [INFO] [stdout] 10 | args.insert(2, format!("{}/root", stage_dir)); [INFO] [stdout] ... [INFO] [stdout] 13 | args.insert(2, "--root".to_string()); [INFO] [stdout] 14 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/recipe.rs:79:48 [INFO] [stdout] | [INFO] [stdout] 79 | if let Some(arm) = re.captures(&tar) { [INFO] [stdout] | ^^^^ help: change this to: `tar` [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 `impl` can be derived [INFO] [stdout] --> src/recipe.rs:130:1 [INFO] [stdout] | [INFO] [stdout] 130 | / impl Default for BuildKind { [INFO] [stdout] 131 | | fn default() -> Self { [INFO] [stdout] 132 | | BuildKind::None [INFO] [stdout] 133 | | } [INFO] [stdout] 134 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 92 + #[derive(Default)] [INFO] [stdout] 93 | pub enum BuildKind { [INFO] [stdout] 94 | /// Will not build (for meta packages) [INFO] [stdout] 95 | #[serde(rename = "none")] [INFO] [stdout] 96 ~ #[default] [INFO] [stdout] 97 ~ None, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/repo_builder.rs:69:8 [INFO] [stdout] | [INFO] [stdout] 69 | if target_packages.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `target_packages.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/repo_builder.rs:85:8 [INFO] [stdout] | [INFO] [stdout] 85 | if recipe_list.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `recipe_list.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to want to iterate on a map's values [INFO] [stdout] --> src/bin/repo_builder.rs:156:43 [INFO] [stdout] | [INFO] [stdout] 156 | for (_recipe, source_path) in &appstream_sources { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#for_kv_map [INFO] [stdout] = note: `#[warn(clippy::for_kv_map)]` on by default [INFO] [stdout] help: use the corresponding method [INFO] [stdout] | [INFO] [stdout] 156 - for (_recipe, source_path) in &appstream_sources { [INFO] [stdout] 156 + for source_path in appstream_sources.values() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to want to iterate on a map's values [INFO] [stdout] --> src/bin/repo_builder.rs:171:47 [INFO] [stdout] | [INFO] [stdout] 171 | for (_recipe, source_path) in &appstream_sources { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#for_kv_map [INFO] [stdout] help: use the corresponding method [INFO] [stdout] | [INFO] [stdout] 171 - for (_recipe, source_path) in &appstream_sources { [INFO] [stdout] 171 + for source_path in appstream_sources.values() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/bin/repo_builder.rs:182:30 [INFO] [stdout] | [INFO] [stdout] 182 | .filter_map(|(k, v)| v.err().and_then(|e| Some((k, e)))) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `v.err().map(|e| (k, e))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] = note: `#[warn(clippy::bind_instead_of_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/repo_builder.rs:233:12 [INFO] [stdout] | [INFO] [stdout] 233 | if parsed.outdated_packages.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!parsed.outdated_packages.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/bin/repo_builder.rs:246:31 [INFO] [stdout] | [INFO] [stdout] 246 | for entry in fs::read_dir(&repo_path)? { [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `repo_path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used to substitute value for `Option::None` [INFO] [stdout] --> src/bin/repo_builder.rs:264:32 [INFO] [stdout] | [INFO] [stdout] 264 | .unwrap_or_else(|| parsed.get("version").unwrap_or_else(|| &empty_ver)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] = note: `#[warn(clippy::unnecessary_lazy_evaluations)]` on by default [INFO] [stdout] help: use `unwrap_or` instead [INFO] [stdout] | [INFO] [stdout] 264 - .unwrap_or_else(|| parsed.get("version").unwrap_or_else(|| &empty_ver)) [INFO] [stdout] 264 + .unwrap_or_else(|| parsed.get("version").unwrap_or(&empty_ver)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/recipe.rs:179:9 [INFO] [stdout] | [INFO] [stdout] 179 | build.kind = kind; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `recipe::BuildRecipe { kind: kind, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/recipe.rs:178:9 [INFO] [stdout] | [INFO] [stdout] 178 | let mut build = Self::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: the borrowed expression implements the required traits [INFO] [stdout] --> src/recipe.rs:211:39 [INFO] [stdout] | [INFO] [stdout] 211 | let toml = fs::read_to_string(&file) [INFO] [stdout] | ^^^^^ help: change this to: `file` [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: redundant closure [INFO] [stdout] --> src/recipe.rs:220:47 [INFO] [stdout] | [INFO] [stdout] 220 | self.optional_packages.iter().map(|p| Some(p)).collect(); [INFO] [stdout] | ^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Some` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/recipe.rs:293:5 [INFO] [stdout] | [INFO] [stdout] 293 | / fn new_recursive( [INFO] [stdout] 294 | | names: &[PackageName], [INFO] [stdout] 295 | | recurse_build_deps: bool, [INFO] [stdout] 296 | | recurse_dev_build_deps: bool, [INFO] [stdout] ... | [INFO] [stdout] 301 | | recursion: usize, [INFO] [stdout] 302 | | ) -> Result, PackageError> { [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: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/recipe.rs:494:62 [INFO] [stdout] | [INFO] [stdout] 494 | pub fn recipes_mark_as_deps(names: &[PackageName], packages: &mut Vec) { [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] help: change this to [INFO] [stdout] | [INFO] [stdout] 494 - pub fn recipes_mark_as_deps(names: &[PackageName], packages: &mut Vec) { [INFO] [stdout] 494 + pub fn recipes_mark_as_deps(names: &[PackageName], packages: &mut [CookRecipe]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/cook/cook_build.rs:712:13 [INFO] [stdout] | [INFO] [stdout] 712 | &vec![root.clone()], [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: you can use a slice directly: `&[root.clone()]` [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] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/repo_builder.rs:69:8 [INFO] [stdout] | [INFO] [stdout] 69 | if target_packages.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `target_packages.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/repo_builder.rs:85:8 [INFO] [stdout] | [INFO] [stdout] 85 | if recipe_list.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `recipe_list.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to want to iterate on a map's values [INFO] [stdout] --> src/bin/repo_builder.rs:156:43 [INFO] [stdout] | [INFO] [stdout] 156 | for (_recipe, source_path) in &appstream_sources { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#for_kv_map [INFO] [stdout] = note: `#[warn(clippy::for_kv_map)]` on by default [INFO] [stdout] help: use the corresponding method [INFO] [stdout] | [INFO] [stdout] 156 - for (_recipe, source_path) in &appstream_sources { [INFO] [stdout] 156 + for source_path in appstream_sources.values() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to want to iterate on a map's values [INFO] [stdout] --> src/bin/repo_builder.rs:171:47 [INFO] [stdout] | [INFO] [stdout] 171 | for (_recipe, source_path) in &appstream_sources { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#for_kv_map [INFO] [stdout] help: use the corresponding method [INFO] [stdout] | [INFO] [stdout] 171 - for (_recipe, source_path) in &appstream_sources { [INFO] [stdout] 171 + for source_path in appstream_sources.values() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/bin/repo_builder.rs:182:30 [INFO] [stdout] | [INFO] [stdout] 182 | .filter_map(|(k, v)| v.err().and_then(|e| Some((k, e)))) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `v.err().map(|e| (k, e))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] = note: `#[warn(clippy::bind_instead_of_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/repo_builder.rs:233:12 [INFO] [stdout] | [INFO] [stdout] 233 | if parsed.outdated_packages.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!parsed.outdated_packages.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/bin/repo_builder.rs:246:31 [INFO] [stdout] | [INFO] [stdout] 246 | for entry in fs::read_dir(&repo_path)? { [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `repo_path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used to substitute value for `Option::None` [INFO] [stdout] --> src/bin/repo_builder.rs:264:32 [INFO] [stdout] | [INFO] [stdout] 264 | .unwrap_or_else(|| parsed.get("version").unwrap_or_else(|| &empty_ver)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] = note: `#[warn(clippy::unnecessary_lazy_evaluations)]` on by default [INFO] [stdout] help: use `unwrap_or` instead [INFO] [stdout] | [INFO] [stdout] 264 - .unwrap_or_else(|| parsed.get("version").unwrap_or_else(|| &empty_ver)) [INFO] [stdout] 264 + .unwrap_or_else(|| parsed.get("version").unwrap_or(&empty_ver)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: direct implementation of `ToString` [INFO] [stdout] --> src/bin/repo.rs:135:1 [INFO] [stdout] | [INFO] [stdout] 135 | / impl ToString for CliCommand { [INFO] [stdout] 136 | | fn to_string(&self) -> String { [INFO] [stdout] 137 | | match self { [INFO] [stdout] 138 | | CliCommand::Fetch => "fetch".to_string(), [INFO] [stdout] ... | [INFO] [stdout] 148 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: prefer implementing `Display` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl [INFO] [stdout] = note: `#[warn(clippy::to_string_trait_impl)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: passing a unit value to a function [INFO] [stdout] --> src/bin/repo.rs:297:5 [INFO] [stdout] | [INFO] [stdout] 297 | / Ok(match *command { [INFO] [stdout] 298 | | CliCommand::Fetch | CliCommand::Cook => { [INFO] [stdout] 299 | | let repo_inner_fn = move |logger: &PtyOut| -> Result<(), anyhow::Error> { [INFO] [stdout] 300 | | let is_cook = *command == CliCommand::Cook; [INFO] [stdout] ... | [INFO] [stdout] 360 | | CliCommand::Find => println!("{}", recipe.dir.display()), [INFO] [stdout] 361 | | }) [INFO] [stdout] | |______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unit_arg [INFO] [stdout] = note: `#[warn(clippy::unit_arg)]` on by default [INFO] [stdout] help: move the expression in front of the call and replace it with the unit literal `()` [INFO] [stdout] | [INFO] [stdout] 297 ~ let _: () = match *command { [INFO] [stdout] 298 + CliCommand::Fetch | CliCommand::Cook => { [INFO] [stdout] 299 + let repo_inner_fn = move |logger: &PtyOut| -> Result<(), anyhow::Error> { [INFO] [stdout] 300 + let is_cook = *command == CliCommand::Cook; [INFO] [stdout] 301 + let source_dir = handle_fetch(recipe, config, is_cook, logger)?; [INFO] [stdout] 302 + if is_cook { [INFO] [stdout] 303 + handle_cook(recipe, config, source_dir, logger)?; [INFO] [stdout] 304 + } [INFO] [stdout] 305 + Ok(()) [INFO] [stdout] 306 + }; [INFO] [stdout] 307 + let Some(log_path) = &config.logs_dir else { [INFO] [stdout] 308 + return repo_inner_fn(&None); [INFO] [stdout] 309 + }; [INFO] [stdout] 310 + [INFO] [stdout] 311 + let (status_tx, status_rx) = mpsc::channel::(); [INFO] [stdout] 312 + let (mut stdout_writer, mut stderr_writer) = setup_logger(&status_tx, &recipe.name); [INFO] [stdout] 313 + let mut app = TuiApp::new(vec![recipe.clone()]); [INFO] [stdout] 314 + app.dump_logs_anyway = config.cook.verbose || !config.cook.nonstop; [INFO] [stdout] 315 + let dump_fail_logs = !app.dump_logs_anyway; [INFO] [stdout] 316 + let th = thread::spawn(move || { [INFO] [stdout] 317 + while let Ok(update) = status_rx.recv() { [INFO] [stdout] 318 + match &update { [INFO] [stdout] 319 + StatusUpdate::CookThreadFinished => break, [INFO] [stdout] 320 + StatusUpdate::FailCook(r, _) => { [INFO] [stdout] 321 + let (logs, line) = app.get_recipe_log(&r.name); [INFO] [stdout] 322 + if let Some(logs) = logs { [INFO] [stdout] 323 + println!("{}", join_logs(logs, line)); [INFO] [stdout] 324 + } [INFO] [stdout] 325 + } [INFO] [stdout] 326 + _ => app.update_status(update), [INFO] [stdout] 327 + } [INFO] [stdout] 328 + } [INFO] [stdout] 329 + }); [INFO] [stdout] 330 + let mut logger = Some((&mut stdout_writer, &mut stderr_writer)); [INFO] [stdout] 331 + let result = repo_inner_fn(&logger); [INFO] [stdout] 332 + if let Err(err_ctx) = &result { [INFO] [stdout] 333 + log_to_pty!(&logger, "\n{:?}", err_ctx) [INFO] [stdout] 334 + } [INFO] [stdout] 335 + // successful fetch is not that useful to log [INFO] [stdout] 336 + if *command == CliCommand::Cook || result.is_err() { [INFO] [stdout] 337 + flush_pty(&mut logger); [INFO] [stdout] 338 + let log_path = [INFO] [stdout] 339 + log_path.join(format!("{}/{}.log", recipe.target, recipe.name.name())); [INFO] [stdout] 340 + status_tx [INFO] [stdout] 341 + .send(StatusUpdate::FlushLog(recipe.name.clone(), log_path)) [INFO] [stdout] 342 + .unwrap_or_default(); [INFO] [stdout] 343 + if dump_fail_logs && result.is_err() { [INFO] [stdout] 344 + status_tx [INFO] [stdout] 345 + .send(StatusUpdate::FailCook(recipe.clone(), "".into())) [INFO] [stdout] 346 + .unwrap_or_default(); [INFO] [stdout] 347 + } [INFO] [stdout] 348 + } [INFO] [stdout] 349 + status_tx [INFO] [stdout] 350 + .send(StatusUpdate::CookThreadFinished) [INFO] [stdout] 351 + .unwrap_or_default(); [INFO] [stdout] 352 + let _ = th.join(); [INFO] [stdout] 353 + result?; [INFO] [stdout] 354 + } [INFO] [stdout] 355 + CliCommand::Unfetch => handle_clean(recipe, config, true, true)?, [INFO] [stdout] 356 + CliCommand::Clean => handle_clean(recipe, config, false, true)?, [INFO] [stdout] 357 + CliCommand::Push => unreachable!(), [INFO] [stdout] 358 + CliCommand::PushTree => unreachable!(), [INFO] [stdout] 359 + CliCommand::CookTree => unreachable!(), [INFO] [stdout] 360 + CliCommand::Find => println!("{}", recipe.dir.display()), [INFO] [stdout] 361 + }; [INFO] [stdout] 362 + Ok(()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/repo.rs:364:35 [INFO] [stdout] | [INFO] [stdout] 364 | fn publish_packages(recipe_names: &Vec, repo_path: &PathBuf) -> anyhow::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] 364 - fn publish_packages(recipe_names: &Vec, repo_path: &PathBuf) -> anyhow::Result<()> { [INFO] [stdout] 364 + fn publish_packages(recipe_names: &[CookRecipe], repo_path: &PathBuf) -> anyhow::Result<()> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/bin/repo.rs:406:54 [INFO] [stdout] | [INFO] [stdout] 406 | config.category = Some(PathBuf::from(arg[("--category-").len()..].to_owned())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/bin/repo.rs:404:20 [INFO] [stdout] | [INFO] [stdout] 404 | } else if arg.starts_with("--category-") { [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] 404 ~ } else if let Some() = arg.strip_prefix("--category-") { [INFO] [stdout] 405 | // to workaround make command limit we provide this option [INFO] [stdout] 406 ~ config.category = Some(PathBuf::from(.to_owned())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this match could be replaced by its scrutinee and body [INFO] [stdout] --> src/bin/repo.rs:419:13 [INFO] [stdout] | [INFO] [stdout] 419 | / match arg.as_str() { [INFO] [stdout] 420 | | _ => { [INFO] [stdout] 421 | | eprintln!("Error: Unknown flag: {}", arg); [INFO] [stdout] 422 | | process::exit(1); [INFO] [stdout] 423 | | } [INFO] [stdout] 424 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding [INFO] [stdout] = note: `#[warn(clippy::match_single_binding)]` on by default [INFO] [stdout] help: consider using the scrutinee and body instead [INFO] [stdout] | [INFO] [stdout] 419 ~ arg.as_str(); [INFO] [stdout] 420 + { [INFO] [stdout] 421 + eprintln!("Error: Unknown flag: {}", arg); [INFO] [stdout] 422 + process::exit(1); [INFO] [stdout] 423 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/repo.rs:442:5 [INFO] [stdout] | [INFO] [stdout] 442 | / if override_filesystem_repo_binary { [INFO] [stdout] 443 | | if let Some(conf) = config.filesystem.as_mut() { [INFO] [stdout] 444 | | conf.general.repo_binary = Some(true); [INFO] [stdout] 445 | | } [INFO] [stdout] 446 | | } [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] 442 ~ if override_filesystem_repo_binary [INFO] [stdout] 443 ~ && let Some(conf) = config.filesystem.as_mut() { [INFO] [stdout] 444 | conf.general.repo_binary = Some(true); [INFO] [stdout] 445 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/repo.rs:599:48 [INFO] [stdout] | [INFO] [stdout] 599 | recipe.apply_filesystem_config(&special_rule)?; [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `special_rule` [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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/repo.rs:645:31 [INFO] [stdout] | [INFO] [stdout] 645 | true => fetch_offline(&recipe, logger), [INFO] [stdout] | ^^^^^^^ help: change this to: `recipe` [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/bin/repo.rs:646:24 [INFO] [stdout] | [INFO] [stdout] 646 | false => fetch(&recipe, !recipe.is_deps, logger), [INFO] [stdout] | ^^^^^^^ help: change this to: `recipe` [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/bin/repo.rs:673:13 [INFO] [stdout] | [INFO] [stdout] 673 | package(&recipe, &stage_dirs, &auto_deps, logger) [INFO] [stdout] | ^^^^^^^ help: change this to: `recipe` [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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/repo.rs:721:25 [INFO] [stdout] | [INFO] [stdout] 721 | fn handle_push(recipes: &Vec, config: &CliConfig) -> anyhow::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] help: change this to [INFO] [stdout] | [INFO] [stdout] 721 - fn handle_push(recipes: &Vec, config: &CliConfig) -> anyhow::Result<()> { [INFO] [stdout] 721 + fn handle_push(recipes: &[CookRecipe], config: &CliConfig) -> anyhow::Result<()> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> src/bin/repo.rs:804:9 [INFO] [stdout] | [INFO] [stdout] 804 | println!(""); [INFO] [stdout] | ^^^^^^^^^--^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [INFO] [stdout] = note: `#[warn(clippy::println_empty_string)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/repo.rs:821:14 [INFO] [stdout] | [INFO] [stdout] 821 | recipes: &Vec, [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] help: change this to [INFO] [stdout] | [INFO] [stdout] 821 - recipes: &Vec, [INFO] [stdout] 821 + recipes: &[CookRecipe], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> src/bin/repo.rs:843:5 [INFO] [stdout] | [INFO] [stdout] 843 | println!(""); [INFO] [stdout] | ^^^^^^^^^--^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: direct implementation of `ToString` [INFO] [stdout] --> src/bin/repo.rs:906:1 [INFO] [stdout] | [INFO] [stdout] 906 | / impl ToString for JobType { [INFO] [stdout] 907 | | fn to_string(&self) -> String { [INFO] [stdout] 908 | | match self { [INFO] [stdout] 909 | | JobType::Fetch => "Fetch", [INFO] [stdout] ... | [INFO] [stdout] 914 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: prefer implementing `Display` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are needlessly cloning iterator elements [INFO] [stdout] --> src/bin/repo.rs:950:49 [INFO] [stdout] | [INFO] [stdout] 950 | fetch_queue: recipes.iter().cloned().map(|r| r.clone()).collect(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: remove the `map` call [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] = note: `#[warn(clippy::map_clone)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded cloning of iterator items [INFO] [stdout] --> src/bin/repo.rs:950:26 [INFO] [stdout] | [INFO] [stdout] 950 | fetch_queue: recipes.iter().cloned().map(|r| r.clone()).collect(), [INFO] [stdout] | ^^^^^^^^^^^^^^---------------------------- [INFO] [stdout] | | [INFO] [stdout] | help: try: `.map(|r| r.clone())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_iter_cloned [INFO] [stdout] = note: `#[warn(clippy::redundant_iter_cloned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/bin/repo.rs:1005:24 [INFO] [stdout] | [INFO] [stdout] 1005 | let log_line = if let Some(b) = self.log_byte_buffer.get(recipe_name) { [INFO] [stdout] | ________________________^ [INFO] [stdout] 1006 | | Some(String::from_utf8_lossy(b)) [INFO] [stdout] 1007 | | } else { [INFO] [stdout] 1008 | | None [INFO] [stdout] 1009 | | }; [INFO] [stdout] | |_________^ help: try: `self.log_byte_buffer.get(recipe_name).map(|b| String::from_utf8_lossy(b))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] = note: `#[warn(clippy::manual_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/repo.rs:1021:9 [INFO] [stdout] | [INFO] [stdout] 1021 | return Ok(()); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 1021 - return Ok(()); [INFO] [stdout] 1021 + Ok(()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/repo.rs:1057:79 [INFO] [stdout] | [INFO] [stdout] 1057 | let line_str = line_str_pos.rsplit('\r').next().unwrap_or(&line_str_pos); [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `line_str_pos` [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: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> src/bin/repo.rs:1219:9 [INFO] [stdout] | [INFO] [stdout] 1219 | / for evt in mstdin.events() { [INFO] [stdout] 1220 | | if let Ok(evt) = evt { [INFO] [stdout] 1221 | | if input_tx.send(evt).is_err() { [INFO] [stdout] 1222 | | return; [INFO] [stdout] ... | [INFO] [stdout] 1225 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/bin/repo.rs:1220:13 [INFO] [stdout] | [INFO] [stdout] 1220 | / if let Ok(evt) = evt { [INFO] [stdout] 1221 | | if input_tx.send(evt).is_err() { [INFO] [stdout] 1222 | | return; [INFO] [stdout] 1223 | | } [INFO] [stdout] 1224 | | } [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] 1219 ~ for evt in mstdin.events().flatten() { [INFO] [stdout] 1220 + if input_tx.send(evt).is_err() { [INFO] [stdout] 1221 + return; [INFO] [stdout] 1222 + } [INFO] [stdout] 1223 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/repo.rs:1220:13 [INFO] [stdout] | [INFO] [stdout] 1220 | / if let Ok(evt) = evt { [INFO] [stdout] 1221 | | if input_tx.send(evt).is_err() { [INFO] [stdout] 1222 | | return; [INFO] [stdout] 1223 | | } [INFO] [stdout] 1224 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 1220 ~ if let Ok(evt) = evt [INFO] [stdout] 1221 ~ && input_tx.send(evt).is_err() { [INFO] [stdout] 1222 | return; [INFO] [stdout] 1223 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/bin/repo.rs:1415:38 [INFO] [stdout] | [INFO] [stdout] 1415 | let new_offset = index_u16.saturating_sub(center_offset) as usize; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `index_u16.saturating_sub(center_offset)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/bin/repo.rs:1422:65 [INFO] [stdout] | [INFO] [stdout] 1422 | let max_offset = total_items.saturating_sub(panel_height as usize); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `panel_height` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/bin/repo.rs:1456:39 [INFO] [stdout] | [INFO] [stdout] 1456 | let total_log_lines = log_text.len() as usize; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `log_text.len()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/repo.rs:1600:19 [INFO] [stdout] | [INFO] [stdout] 1600 | fn join_logs(log: &Vec, line: Option>) -> String { [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] help: change this to [INFO] [stdout] | [INFO] [stdout] 1600 - fn join_logs(log: &Vec, line: Option>) -> String { [INFO] [stdout] 1600 + fn join_logs(log: &[String], line: Option>) -> String { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/bin/repo.rs:1603:9 [INFO] [stdout] | [INFO] [stdout] 1603 | logs.push_str("\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `logs.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: using a reference to `Cow` is not recommended [INFO] [stdout] --> src/bin/repo.rs:1609:26 [INFO] [stdout] | [INFO] [stdout] 1609 | fn handle_cr<'a>(buffer: &'a Cow<'_, str>) -> &'a str { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: change this to: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/repo.rs:1611:38 [INFO] [stdout] | [INFO] [stdout] 1611 | st.rsplit('\r').next().unwrap_or(&st) [INFO] [stdout] | ^^^ help: change this to: `st` [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 `map_or` can be simplified [INFO] [stdout] --> src/bin/repo.rs:1663:24 [INFO] [stdout] | [INFO] [stdout] 1663 | if app.fetch_panel_rect.map_or(false, |r| r.contains(pos)) { [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] 1663 - if app.fetch_panel_rect.map_or(false, |r| r.contains(pos)) { [INFO] [stdout] 1663 + if app.fetch_panel_rect.is_some_and(|r| r.contains(pos)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/bin/repo.rs:1665:31 [INFO] [stdout] | [INFO] [stdout] 1665 | } else if app.cook_panel_rect.map_or(false, |r| r.contains(pos)) { [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] 1665 - } else if app.cook_panel_rect.map_or(false, |r| r.contains(pos)) { [INFO] [stdout] 1665 + } else if app.cook_panel_rect.is_some_and(|r| r.contains(pos)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/bin/repo.rs:1668:31 [INFO] [stdout] | [INFO] [stdout] 1668 | } else if app.log_panel_rect.map_or(false, |r| r.contains(pos)) { [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] 1668 - } else if app.log_panel_rect.map_or(false, |r| r.contains(pos)) { [INFO] [stdout] 1668 + } else if app.log_panel_rect.is_some_and(|r| r.contains(pos)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/bin/repo.rs:1679:24 [INFO] [stdout] | [INFO] [stdout] 1679 | if app.fetch_panel_rect.map_or(false, |r| r.contains(pos)) { [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] 1679 - if app.fetch_panel_rect.map_or(false, |r| r.contains(pos)) { [INFO] [stdout] 1679 + if app.fetch_panel_rect.is_some_and(|r| r.contains(pos)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/bin/repo.rs:1681:31 [INFO] [stdout] | [INFO] [stdout] 1681 | } else if app.cook_panel_rect.map_or(false, |r| r.contains(pos)) { [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] 1681 - } else if app.cook_panel_rect.map_or(false, |r| r.contains(pos)) { [INFO] [stdout] 1681 + } else if app.cook_panel_rect.is_some_and(|r| r.contains(pos)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/bin/repo.rs:1684:31 [INFO] [stdout] | [INFO] [stdout] 1684 | } else if app.log_panel_rect.map_or(false, |r| r.contains(pos)) { [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] 1684 - } else if app.log_panel_rect.map_or(false, |r| r.contains(pos)) { [INFO] [stdout] 1684 + } else if app.log_panel_rect.is_some_and(|r| r.contains(pos)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: spawned process is never `wait()`ed on [INFO] [stdout] --> src/bin/repo.rs:1698:5 [INFO] [stdout] | [INFO] [stdout] 1698 | / Command::new("bash") [INFO] [stdout] 1699 | | .arg("-c") [INFO] [stdout] 1700 | | .arg(KILL_ALL_PID.replace("$PID", &pid.to_string())) [INFO] [stdout] 1701 | | .stdout(process::Stdio::null()) [INFO] [stdout] 1702 | | .stderr(process::Stdio::null()) [INFO] [stdout] 1703 | | .spawn() [INFO] [stdout] 1704 | | .expect("unable to spawn kill"); [INFO] [stdout] | | ^- help: try: `.wait()` [INFO] [stdout] | |_______________________________________| [INFO] [stdout] | [INFO] [stdout] | [INFO] [stdout] = note: not doing so might leave behind zombie processes [INFO] [stdout] = note: see https://doc.rust-lang.org/stable/std/process/struct.Child.html#warning [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#zombie_processes [INFO] [stdout] = note: `#[warn(clippy::zombie_processes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/bin/repo.rs:1712:9 [INFO] [stdout] | [INFO] [stdout] 1712 | / match event { [INFO] [stdout] 1713 | | Event::Key(key) => match key { [INFO] [stdout] 1714 | | Key::Char('q') | Key::Ctrl('c') | Key::Esc => { [INFO] [stdout] ... | [INFO] [stdout] 1726 | | _ => {} // Ignore mouse events [INFO] [stdout] 1727 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = note: you might want to preserve the comments from inside the `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 1712 ~ if let Event::Key(key) = event { match key { [INFO] [stdout] 1713 + Key::Char('q') | Key::Ctrl('c') | Key::Esc => { [INFO] [stdout] 1714 + // Treat as "Exit" [INFO] [stdout] 1715 + return Some((app, PromptOption::Exit)); [INFO] [stdout] 1716 + } [INFO] [stdout] 1717 + Key::Left | Key::BackTab => prompt.prev(), [INFO] [stdout] 1718 + Key::Right | Key::Char('\t') => prompt.next(), [INFO] [stdout] 1719 + Key::Char('\n') => { [INFO] [stdout] 1720 + let prompt = app.prompt.take().unwrap(); [INFO] [stdout] 1721 + return Some((app, prompt.selected)); [INFO] [stdout] 1722 + } [INFO] [stdout] 1723 + _ => {} [INFO] [stdout] 1724 + } } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: direct implementation of `ToString` [INFO] [stdout] --> src/bin/repo.rs:135:1 [INFO] [stdout] | [INFO] [stdout] 135 | / impl ToString for CliCommand { [INFO] [stdout] 136 | | fn to_string(&self) -> String { [INFO] [stdout] 137 | | match self { [INFO] [stdout] 138 | | CliCommand::Fetch => "fetch".to_string(), [INFO] [stdout] ... | [INFO] [stdout] 148 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: prefer implementing `Display` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl [INFO] [stdout] = note: `#[warn(clippy::to_string_trait_impl)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: passing a unit value to a function [INFO] [stdout] --> src/bin/repo.rs:297:5 [INFO] [stdout] | [INFO] [stdout] 297 | / Ok(match *command { [INFO] [stdout] 298 | | CliCommand::Fetch | CliCommand::Cook => { [INFO] [stdout] 299 | | let repo_inner_fn = move |logger: &PtyOut| -> Result<(), anyhow::Error> { [INFO] [stdout] 300 | | let is_cook = *command == CliCommand::Cook; [INFO] [stdout] ... | [INFO] [stdout] 360 | | CliCommand::Find => println!("{}", recipe.dir.display()), [INFO] [stdout] 361 | | }) [INFO] [stdout] | |______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unit_arg [INFO] [stdout] = note: `#[warn(clippy::unit_arg)]` on by default [INFO] [stdout] help: move the expression in front of the call and replace it with the unit literal `()` [INFO] [stdout] | [INFO] [stdout] 297 ~ let _: () = match *command { [INFO] [stdout] 298 + CliCommand::Fetch | CliCommand::Cook => { [INFO] [stdout] 299 + let repo_inner_fn = move |logger: &PtyOut| -> Result<(), anyhow::Error> { [INFO] [stdout] 300 + let is_cook = *command == CliCommand::Cook; [INFO] [stdout] 301 + let source_dir = handle_fetch(recipe, config, is_cook, logger)?; [INFO] [stdout] 302 + if is_cook { [INFO] [stdout] 303 + handle_cook(recipe, config, source_dir, logger)?; [INFO] [stdout] 304 + } [INFO] [stdout] 305 + Ok(()) [INFO] [stdout] 306 + }; [INFO] [stdout] 307 + let Some(log_path) = &config.logs_dir else { [INFO] [stdout] 308 + return repo_inner_fn(&None); [INFO] [stdout] 309 + }; [INFO] [stdout] 310 + [INFO] [stdout] 311 + let (status_tx, status_rx) = mpsc::channel::(); [INFO] [stdout] 312 + let (mut stdout_writer, mut stderr_writer) = setup_logger(&status_tx, &recipe.name); [INFO] [stdout] 313 + let mut app = TuiApp::new(vec![recipe.clone()]); [INFO] [stdout] 314 + app.dump_logs_anyway = config.cook.verbose || !config.cook.nonstop; [INFO] [stdout] 315 + let dump_fail_logs = !app.dump_logs_anyway; [INFO] [stdout] 316 + let th = thread::spawn(move || { [INFO] [stdout] 317 + while let Ok(update) = status_rx.recv() { [INFO] [stdout] 318 + match &update { [INFO] [stdout] 319 + StatusUpdate::CookThreadFinished => break, [INFO] [stdout] 320 + StatusUpdate::FailCook(r, _) => { [INFO] [stdout] 321 + let (logs, line) = app.get_recipe_log(&r.name); [INFO] [stdout] 322 + if let Some(logs) = logs { [INFO] [stdout] 323 + println!("{}", join_logs(logs, line)); [INFO] [stdout] 324 + } [INFO] [stdout] 325 + } [INFO] [stdout] 326 + _ => app.update_status(update), [INFO] [stdout] 327 + } [INFO] [stdout] 328 + } [INFO] [stdout] 329 + }); [INFO] [stdout] 330 + let mut logger = Some((&mut stdout_writer, &mut stderr_writer)); [INFO] [stdout] 331 + let result = repo_inner_fn(&logger); [INFO] [stdout] 332 + if let Err(err_ctx) = &result { [INFO] [stdout] 333 + log_to_pty!(&logger, "\n{:?}", err_ctx) [INFO] [stdout] 334 + } [INFO] [stdout] 335 + // successful fetch is not that useful to log [INFO] [stdout] 336 + if *command == CliCommand::Cook || result.is_err() { [INFO] [stdout] 337 + flush_pty(&mut logger); [INFO] [stdout] 338 + let log_path = [INFO] [stdout] 339 + log_path.join(format!("{}/{}.log", recipe.target, recipe.name.name())); [INFO] [stdout] 340 + status_tx [INFO] [stdout] 341 + .send(StatusUpdate::FlushLog(recipe.name.clone(), log_path)) [INFO] [stdout] 342 + .unwrap_or_default(); [INFO] [stdout] 343 + if dump_fail_logs && result.is_err() { [INFO] [stdout] 344 + status_tx [INFO] [stdout] 345 + .send(StatusUpdate::FailCook(recipe.clone(), "".into())) [INFO] [stdout] 346 + .unwrap_or_default(); [INFO] [stdout] 347 + } [INFO] [stdout] 348 + } [INFO] [stdout] 349 + status_tx [INFO] [stdout] 350 + .send(StatusUpdate::CookThreadFinished) [INFO] [stdout] 351 + .unwrap_or_default(); [INFO] [stdout] 352 + let _ = th.join(); [INFO] [stdout] 353 + result?; [INFO] [stdout] 354 + } [INFO] [stdout] 355 + CliCommand::Unfetch => handle_clean(recipe, config, true, true)?, [INFO] [stdout] 356 + CliCommand::Clean => handle_clean(recipe, config, false, true)?, [INFO] [stdout] 357 + CliCommand::Push => unreachable!(), [INFO] [stdout] 358 + CliCommand::PushTree => unreachable!(), [INFO] [stdout] 359 + CliCommand::CookTree => unreachable!(), [INFO] [stdout] 360 + CliCommand::Find => println!("{}", recipe.dir.display()), [INFO] [stdout] 361 + }; [INFO] [stdout] 362 + Ok(()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/repo.rs:364:35 [INFO] [stdout] | [INFO] [stdout] 364 | fn publish_packages(recipe_names: &Vec, repo_path: &PathBuf) -> anyhow::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] 364 - fn publish_packages(recipe_names: &Vec, repo_path: &PathBuf) -> anyhow::Result<()> { [INFO] [stdout] 364 + fn publish_packages(recipe_names: &[CookRecipe], repo_path: &PathBuf) -> anyhow::Result<()> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/bin/repo.rs:406:54 [INFO] [stdout] | [INFO] [stdout] 406 | config.category = Some(PathBuf::from(arg[("--category-").len()..].to_owned())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/bin/repo.rs:404:20 [INFO] [stdout] | [INFO] [stdout] 404 | } else if arg.starts_with("--category-") { [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] 404 ~ } else if let Some() = arg.strip_prefix("--category-") { [INFO] [stdout] 405 | // to workaround make command limit we provide this option [INFO] [stdout] 406 ~ config.category = Some(PathBuf::from(.to_owned())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this match could be replaced by its scrutinee and body [INFO] [stdout] --> src/bin/repo.rs:419:13 [INFO] [stdout] | [INFO] [stdout] 419 | / match arg.as_str() { [INFO] [stdout] 420 | | _ => { [INFO] [stdout] 421 | | eprintln!("Error: Unknown flag: {}", arg); [INFO] [stdout] 422 | | process::exit(1); [INFO] [stdout] 423 | | } [INFO] [stdout] 424 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding [INFO] [stdout] = note: `#[warn(clippy::match_single_binding)]` on by default [INFO] [stdout] help: consider using the scrutinee and body instead [INFO] [stdout] | [INFO] [stdout] 419 ~ arg.as_str(); [INFO] [stdout] 420 + { [INFO] [stdout] 421 + eprintln!("Error: Unknown flag: {}", arg); [INFO] [stdout] 422 + process::exit(1); [INFO] [stdout] 423 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/repo.rs:442:5 [INFO] [stdout] | [INFO] [stdout] 442 | / if override_filesystem_repo_binary { [INFO] [stdout] 443 | | if let Some(conf) = config.filesystem.as_mut() { [INFO] [stdout] 444 | | conf.general.repo_binary = Some(true); [INFO] [stdout] 445 | | } [INFO] [stdout] 446 | | } [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] 442 ~ if override_filesystem_repo_binary [INFO] [stdout] 443 ~ && let Some(conf) = config.filesystem.as_mut() { [INFO] [stdout] 444 | conf.general.repo_binary = Some(true); [INFO] [stdout] 445 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/repo.rs:599:48 [INFO] [stdout] | [INFO] [stdout] 599 | recipe.apply_filesystem_config(&special_rule)?; [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `special_rule` [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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/repo.rs:645:31 [INFO] [stdout] | [INFO] [stdout] 645 | true => fetch_offline(&recipe, logger), [INFO] [stdout] | ^^^^^^^ help: change this to: `recipe` [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/bin/repo.rs:646:24 [INFO] [stdout] | [INFO] [stdout] 646 | false => fetch(&recipe, !recipe.is_deps, logger), [INFO] [stdout] | ^^^^^^^ help: change this to: `recipe` [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/bin/repo.rs:673:13 [INFO] [stdout] | [INFO] [stdout] 673 | package(&recipe, &stage_dirs, &auto_deps, logger) [INFO] [stdout] | ^^^^^^^ help: change this to: `recipe` [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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/repo.rs:721:25 [INFO] [stdout] | [INFO] [stdout] 721 | fn handle_push(recipes: &Vec, config: &CliConfig) -> anyhow::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] help: change this to [INFO] [stdout] | [INFO] [stdout] 721 - fn handle_push(recipes: &Vec, config: &CliConfig) -> anyhow::Result<()> { [INFO] [stdout] 721 + fn handle_push(recipes: &[CookRecipe], config: &CliConfig) -> anyhow::Result<()> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> src/bin/repo.rs:804:9 [INFO] [stdout] | [INFO] [stdout] 804 | println!(""); [INFO] [stdout] | ^^^^^^^^^--^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [INFO] [stdout] = note: `#[warn(clippy::println_empty_string)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/repo.rs:821:14 [INFO] [stdout] | [INFO] [stdout] 821 | recipes: &Vec, [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] help: change this to [INFO] [stdout] | [INFO] [stdout] 821 - recipes: &Vec, [INFO] [stdout] 821 + recipes: &[CookRecipe], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> src/bin/repo.rs:843:5 [INFO] [stdout] | [INFO] [stdout] 843 | println!(""); [INFO] [stdout] | ^^^^^^^^^--^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: direct implementation of `ToString` [INFO] [stdout] --> src/bin/repo.rs:906:1 [INFO] [stdout] | [INFO] [stdout] 906 | / impl ToString for JobType { [INFO] [stdout] 907 | | fn to_string(&self) -> String { [INFO] [stdout] 908 | | match self { [INFO] [stdout] 909 | | JobType::Fetch => "Fetch", [INFO] [stdout] ... | [INFO] [stdout] 914 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: prefer implementing `Display` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are needlessly cloning iterator elements [INFO] [stdout] --> src/bin/repo.rs:950:49 [INFO] [stdout] | [INFO] [stdout] 950 | fetch_queue: recipes.iter().cloned().map(|r| r.clone()).collect(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: remove the `map` call [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] = note: `#[warn(clippy::map_clone)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded cloning of iterator items [INFO] [stdout] --> src/bin/repo.rs:950:26 [INFO] [stdout] | [INFO] [stdout] 950 | fetch_queue: recipes.iter().cloned().map(|r| r.clone()).collect(), [INFO] [stdout] | ^^^^^^^^^^^^^^---------------------------- [INFO] [stdout] | | [INFO] [stdout] | help: try: `.map(|r| r.clone())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_iter_cloned [INFO] [stdout] = note: `#[warn(clippy::redundant_iter_cloned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/bin/repo.rs:1005:24 [INFO] [stdout] | [INFO] [stdout] 1005 | let log_line = if let Some(b) = self.log_byte_buffer.get(recipe_name) { [INFO] [stdout] | ________________________^ [INFO] [stdout] 1006 | | Some(String::from_utf8_lossy(b)) [INFO] [stdout] 1007 | | } else { [INFO] [stdout] 1008 | | None [INFO] [stdout] 1009 | | }; [INFO] [stdout] | |_________^ help: try: `self.log_byte_buffer.get(recipe_name).map(|b| String::from_utf8_lossy(b))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] = note: `#[warn(clippy::manual_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/repo.rs:1021:9 [INFO] [stdout] | [INFO] [stdout] 1021 | return Ok(()); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 1021 - return Ok(()); [INFO] [stdout] 1021 + Ok(()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/repo.rs:1057:79 [INFO] [stdout] | [INFO] [stdout] 1057 | let line_str = line_str_pos.rsplit('\r').next().unwrap_or(&line_str_pos); [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `line_str_pos` [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: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> src/bin/repo.rs:1219:9 [INFO] [stdout] | [INFO] [stdout] 1219 | / for evt in mstdin.events() { [INFO] [stdout] 1220 | | if let Ok(evt) = evt { [INFO] [stdout] 1221 | | if input_tx.send(evt).is_err() { [INFO] [stdout] 1222 | | return; [INFO] [stdout] ... | [INFO] [stdout] 1225 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/bin/repo.rs:1220:13 [INFO] [stdout] | [INFO] [stdout] 1220 | / if let Ok(evt) = evt { [INFO] [stdout] 1221 | | if input_tx.send(evt).is_err() { [INFO] [stdout] 1222 | | return; [INFO] [stdout] 1223 | | } [INFO] [stdout] 1224 | | } [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] 1219 ~ for evt in mstdin.events().flatten() { [INFO] [stdout] 1220 + if input_tx.send(evt).is_err() { [INFO] [stdout] 1221 + return; [INFO] [stdout] 1222 + } [INFO] [stdout] 1223 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/repo.rs:1220:13 [INFO] [stdout] | [INFO] [stdout] 1220 | / if let Ok(evt) = evt { [INFO] [stdout] 1221 | | if input_tx.send(evt).is_err() { [INFO] [stdout] 1222 | | return; [INFO] [stdout] 1223 | | } [INFO] [stdout] 1224 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 1220 ~ if let Ok(evt) = evt [INFO] [stdout] 1221 ~ && input_tx.send(evt).is_err() { [INFO] [stdout] 1222 | return; [INFO] [stdout] 1223 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/bin/repo.rs:1415:38 [INFO] [stdout] | [INFO] [stdout] 1415 | let new_offset = index_u16.saturating_sub(center_offset) as usize; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `index_u16.saturating_sub(center_offset)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/bin/repo.rs:1422:65 [INFO] [stdout] | [INFO] [stdout] 1422 | let max_offset = total_items.saturating_sub(panel_height as usize); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `panel_height` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/bin/repo.rs:1456:39 [INFO] [stdout] | [INFO] [stdout] 1456 | let total_log_lines = log_text.len() as usize; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `log_text.len()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/repo.rs:1600:19 [INFO] [stdout] | [INFO] [stdout] 1600 | fn join_logs(log: &Vec, line: Option>) -> String { [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] help: change this to [INFO] [stdout] | [INFO] [stdout] 1600 - fn join_logs(log: &Vec, line: Option>) -> String { [INFO] [stdout] 1600 + fn join_logs(log: &[String], line: Option>) -> String { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/bin/repo.rs:1603:9 [INFO] [stdout] | [INFO] [stdout] 1603 | logs.push_str("\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `logs.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: using a reference to `Cow` is not recommended [INFO] [stdout] --> src/bin/repo.rs:1609:26 [INFO] [stdout] | [INFO] [stdout] 1609 | fn handle_cr<'a>(buffer: &'a Cow<'_, str>) -> &'a str { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: change this to: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/repo.rs:1611:38 [INFO] [stdout] | [INFO] [stdout] 1611 | st.rsplit('\r').next().unwrap_or(&st) [INFO] [stdout] | ^^^ help: change this to: `st` [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 `map_or` can be simplified [INFO] [stdout] --> src/bin/repo.rs:1663:24 [INFO] [stdout] | [INFO] [stdout] 1663 | if app.fetch_panel_rect.map_or(false, |r| r.contains(pos)) { [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] 1663 - if app.fetch_panel_rect.map_or(false, |r| r.contains(pos)) { [INFO] [stdout] 1663 + if app.fetch_panel_rect.is_some_and(|r| r.contains(pos)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/bin/repo.rs:1665:31 [INFO] [stdout] | [INFO] [stdout] 1665 | } else if app.cook_panel_rect.map_or(false, |r| r.contains(pos)) { [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] 1665 - } else if app.cook_panel_rect.map_or(false, |r| r.contains(pos)) { [INFO] [stdout] 1665 + } else if app.cook_panel_rect.is_some_and(|r| r.contains(pos)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/bin/repo.rs:1668:31 [INFO] [stdout] | [INFO] [stdout] 1668 | } else if app.log_panel_rect.map_or(false, |r| r.contains(pos)) { [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] 1668 - } else if app.log_panel_rect.map_or(false, |r| r.contains(pos)) { [INFO] [stdout] 1668 + } else if app.log_panel_rect.is_some_and(|r| r.contains(pos)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/bin/repo.rs:1679:24 [INFO] [stdout] | [INFO] [stdout] 1679 | if app.fetch_panel_rect.map_or(false, |r| r.contains(pos)) { [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] 1679 - if app.fetch_panel_rect.map_or(false, |r| r.contains(pos)) { [INFO] [stdout] 1679 + if app.fetch_panel_rect.is_some_and(|r| r.contains(pos)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/bin/repo.rs:1681:31 [INFO] [stdout] | [INFO] [stdout] 1681 | } else if app.cook_panel_rect.map_or(false, |r| r.contains(pos)) { [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] 1681 - } else if app.cook_panel_rect.map_or(false, |r| r.contains(pos)) { [INFO] [stdout] 1681 + } else if app.cook_panel_rect.is_some_and(|r| r.contains(pos)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/bin/repo.rs:1684:31 [INFO] [stdout] | [INFO] [stdout] 1684 | } else if app.log_panel_rect.map_or(false, |r| r.contains(pos)) { [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] 1684 - } else if app.log_panel_rect.map_or(false, |r| r.contains(pos)) { [INFO] [stdout] 1684 + } else if app.log_panel_rect.is_some_and(|r| r.contains(pos)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: spawned process is never `wait()`ed on [INFO] [stdout] --> src/bin/repo.rs:1698:5 [INFO] [stdout] | [INFO] [stdout] 1698 | / Command::new("bash") [INFO] [stdout] 1699 | | .arg("-c") [INFO] [stdout] 1700 | | .arg(KILL_ALL_PID.replace("$PID", &pid.to_string())) [INFO] [stdout] 1701 | | .stdout(process::Stdio::null()) [INFO] [stdout] 1702 | | .stderr(process::Stdio::null()) [INFO] [stdout] 1703 | | .spawn() [INFO] [stdout] 1704 | | .expect("unable to spawn kill"); [INFO] [stdout] | | ^- help: try: `.wait()` [INFO] [stdout] | |_______________________________________| [INFO] [stdout] | [INFO] [stdout] | [INFO] [stdout] = note: not doing so might leave behind zombie processes [INFO] [stdout] = note: see https://doc.rust-lang.org/stable/std/process/struct.Child.html#warning [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#zombie_processes [INFO] [stdout] = note: `#[warn(clippy::zombie_processes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/bin/repo.rs:1712:9 [INFO] [stdout] | [INFO] [stdout] 1712 | / match event { [INFO] [stdout] 1713 | | Event::Key(key) => match key { [INFO] [stdout] 1714 | | Key::Char('q') | Key::Ctrl('c') | Key::Esc => { [INFO] [stdout] ... | [INFO] [stdout] 1726 | | _ => {} // Ignore mouse events [INFO] [stdout] 1727 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = note: you might want to preserve the comments from inside the `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 1712 ~ if let Event::Key(key) = event { match key { [INFO] [stdout] 1713 + Key::Char('q') | Key::Ctrl('c') | Key::Esc => { [INFO] [stdout] 1714 + // Treat as "Exit" [INFO] [stdout] 1715 + return Some((app, PromptOption::Exit)); [INFO] [stdout] 1716 + } [INFO] [stdout] 1717 + Key::Left | Key::BackTab => prompt.prev(), [INFO] [stdout] 1718 + Key::Right | Key::Char('\t') => prompt.next(), [INFO] [stdout] 1719 + Key::Char('\n') => { [INFO] [stdout] 1720 + let prompt = app.prompt.take().unwrap(); [INFO] [stdout] 1721 + return Some((app, prompt.selected)); [INFO] [stdout] 1722 + } [INFO] [stdout] 1723 + _ => {} [INFO] [stdout] 1724 + } } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 54.26s [INFO] running `Command { std: "docker" "inspect" "796070e12dc4a3eb1e213d84ba013f94adcef68e488e1a33c1e97a36579a7fcb", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "796070e12dc4a3eb1e213d84ba013f94adcef68e488e1a33c1e97a36579a7fcb", kill_on_drop: false }` [INFO] [stdout] 796070e12dc4a3eb1e213d84ba013f94adcef68e488e1a33c1e97a36579a7fcb