[INFO] cloning repository https://github.com/AnharHussainMiah/grind [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/AnharHussainMiah/grind" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FAnharHussainMiah%2Fgrind", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FAnharHussainMiah%2Fgrind'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 0409c81a3a934d679d0eb8732a4cf4318ce46418 [INFO] linting AnharHussainMiah/grind against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FAnharHussainMiah%2Fgrind" "/workspace/builds/worker-6-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-6-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/AnharHussainMiah/grind [INFO] finished tweaking git repo https://github.com/AnharHussainMiah/grind [INFO] tweaked toml for git repo https://github.com/AnharHussainMiah/grind written to /workspace/builds/worker-6-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/AnharHussainMiah/grind 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/AnharHussainMiah/grind 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] Downloading crates ... [INFO] [stderr] Downloaded compression-codecs v0.4.31 [INFO] [stderr] Downloaded compression-core v0.4.29 [INFO] [stderr] Downloaded ppmd-rust v1.2.1 [INFO] [stderr] Downloaded serde-xml-rs v0.5.1 [INFO] [stderr] Downloaded libz-rs-sys v0.5.2 [INFO] [stderr] Downloaded zlib-rs v0.5.2 [INFO] [stderr] Downloaded async-compression v0.4.32 [INFO] [stderr] Downloaded quick-xml v0.38.3 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-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] 745ce8b6c62745b185d1bfaa3039246ad39563fc38610fb4ed300cc90ea5f68f [INFO] running `Command { std: "docker" "start" "-a" "745ce8b6c62745b185d1bfaa3039246ad39563fc38610fb4ed300cc90ea5f68f", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "745ce8b6c62745b185d1bfaa3039246ad39563fc38610fb4ed300cc90ea5f68f", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "745ce8b6c62745b185d1bfaa3039246ad39563fc38610fb4ed300cc90ea5f68f", kill_on_drop: false }` [INFO] [stdout] 745ce8b6c62745b185d1bfaa3039246ad39563fc38610fb4ed300cc90ea5f68f [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-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] 9055f656bf1af270c2c96249df34015d44b8fa9f070c6f06aaeadc48fcc0f7df [INFO] running `Command { std: "docker" "start" "-a" "9055f656bf1af270c2c96249df34015d44b8fa9f070c6f06aaeadc48fcc0f7df", kill_on_drop: false }` [INFO] [stderr] Compiling quote v1.0.41 [INFO] [stderr] Compiling serde_core v1.0.228 [INFO] [stderr] Checking mio v1.0.4 [INFO] [stderr] Checking getrandom v0.2.16 [INFO] [stderr] Checking simd-adler32 v0.3.7 [INFO] [stderr] Checking zlib-rs v0.5.2 [INFO] [stderr] Compiling ring v0.17.14 [INFO] [stderr] Compiling zstd-sys v2.0.16+zstd.1.5.7 [INFO] [stderr] Checking digest v0.10.7 [INFO] [stderr] Checking tracing v0.1.41 [INFO] [stderr] Compiling rustix v1.1.2 [INFO] [stderr] Compiling zstd-safe v7.2.4 [INFO] [stderr] Checking inout v0.1.4 [INFO] [stderr] Checking socket2 v0.5.10 [INFO] [stderr] Checking bitflags v2.9.4 [INFO] [stderr] Checking compression-core v0.4.29 [INFO] [stderr] Checking anstream v0.6.20 [INFO] [stderr] Checking crc v3.3.0 [INFO] [stderr] Checking cipher v0.4.4 [INFO] [stderr] Checking libbz2-rs-sys v0.2.2 [INFO] [stderr] Checking bumpalo v3.19.0 [INFO] [stderr] Checking miniz_oxide v0.8.9 [INFO] [stderr] Checking time v0.3.44 [INFO] [stderr] Checking zopfli v0.8.2 [INFO] [stderr] Checking sha2 v0.10.9 [INFO] [stderr] Checking hmac v0.12.1 [INFO] [stderr] Checking clap_builder v4.5.48 [INFO] [stderr] Checking aes v0.8.4 [INFO] [stderr] Checking sha1 v0.10.6 [INFO] [stderr] Compiling syn v2.0.106 [INFO] [stderr] Checking pbkdf2 v0.12.2 [INFO] [stderr] Checking lzma-rust2 v0.13.0 [INFO] [stderr] Checking getrandom v0.3.4 [INFO] [stderr] Checking filetime v0.2.26 [INFO] [stderr] Checking xml-rs v0.8.27 [INFO] [stderr] Checking deflate64 v0.1.10 [INFO] [stderr] Checking ppmd-rust v1.2.1 [INFO] [stderr] Checking chrono v0.4.42 [INFO] [stderr] Checking md5 v0.8.0 [INFO] [stderr] Checking bzip2 v0.6.1 [INFO] [stderr] Checking libz-rs-sys v0.5.2 [INFO] [stderr] Checking flate2 v1.1.5 [INFO] [stderr] Checking xattr v1.6.1 [INFO] [stderr] Checking tar v0.4.44 [INFO] [stderr] Checking compression-codecs v0.4.31 [INFO] [stderr] Compiling rustls v0.21.12 [INFO] [stderr] Checking serde_json v1.0.145 [INFO] [stderr] Checking serde_path_to_error v0.1.20 [INFO] [stderr] Checking rustls-webpki v0.101.7 [INFO] [stderr] Checking sct v0.7.1 [INFO] [stderr] Compiling synstructure v0.13.2 [INFO] [stderr] Compiling zerovec-derive v0.11.1 [INFO] [stderr] Compiling displaydoc v0.2.5 [INFO] [stderr] Compiling tokio-macros v2.5.0 [INFO] [stderr] Compiling serde_derive v1.0.228 [INFO] [stderr] Compiling futures-macro v0.3.31 [INFO] [stderr] Compiling zeroize_derive v1.4.2 [INFO] [stderr] Compiling thiserror-impl v1.0.69 [INFO] [stderr] Compiling clap_derive v4.5.47 [INFO] [stderr] Compiling zerofrom-derive v0.1.6 [INFO] [stderr] Compiling yoke-derive v0.8.0 [INFO] [stderr] Checking zstd v0.13.3 [INFO] [stderr] Checking futures-util v0.3.31 [INFO] [stderr] Checking zeroize v1.8.2 [INFO] [stderr] Checking zip v6.0.0 [INFO] [stderr] Checking tokio v1.47.1 [INFO] [stderr] Checking thiserror v1.0.69 [INFO] [stderr] Checking zerofrom v0.1.6 [INFO] [stderr] Checking yoke v0.8.0 [INFO] [stderr] Checking zerovec v0.11.4 [INFO] [stderr] Checking zerotrie v0.2.2 [INFO] [stderr] Checking clap v4.5.48 [INFO] [stderr] Checking tinystr v0.8.1 [INFO] [stderr] Checking potential_utf v0.1.3 [INFO] [stderr] Checking icu_collections v2.0.0 [INFO] [stderr] Checking icu_locale_core v2.0.0 [INFO] [stderr] Checking icu_provider v2.0.0 [INFO] [stderr] Checking serde v1.0.228 [INFO] [stderr] Checking icu_normalizer v2.0.0 [INFO] [stderr] Checking icu_properties v2.0.1 [INFO] [stderr] Checking serde_urlencoded v0.7.1 [INFO] [stderr] Checking quick-xml v0.38.3 [INFO] [stderr] Checking serde-xml-rs v0.5.1 [INFO] [stderr] Checking serde_yaml v0.9.34+deprecated [INFO] [stderr] Checking idna_adapter v1.2.1 [INFO] [stderr] Checking idna v1.1.0 [INFO] [stderr] Checking url v2.5.7 [INFO] [stderr] Checking tokio-util v0.7.16 [INFO] [stderr] Checking tokio-rustls v0.24.1 [INFO] [stderr] Checking async-compression v0.4.32 [INFO] [stderr] Checking h2 v0.3.27 [INFO] [stderr] Checking hyper v0.14.32 [INFO] [stderr] Checking hyper-rustls v0.24.2 [INFO] [stderr] Checking reqwest v0.11.27 [INFO] [stderr] Checking grind v0.8.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: this import is redundant [INFO] [stdout] --> src/integrity.rs:6:1 [INFO] [stdout] | [INFO] [stdout] 6 | use md5; [INFO] [stdout] | ^^^^^^^^ help: remove it entirely [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_component_path_imports [INFO] [stdout] = note: `#[warn(clippy::single_component_path_imports)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/main.rs:410:9 [INFO] [stdout] | [INFO] [stdout] 410 | flags: flags, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `flags` [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/main.rs:411:9 [INFO] [stdout] | [INFO] [stdout] 411 | envs: envs, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `envs` [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: this import is redundant [INFO] [stdout] --> src/integrity.rs:6:1 [INFO] [stdout] | [INFO] [stdout] 6 | use md5; [INFO] [stdout] | ^^^^^^^^ help: remove it entirely [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_component_path_imports [INFO] [stdout] = note: `#[warn(clippy::single_component_path_imports)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/main.rs:410:9 [INFO] [stdout] | [INFO] [stdout] 410 | flags: flags, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `flags` [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/main.rs:411:9 [INFO] [stdout] | [INFO] [stdout] 411 | envs: envs, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `envs` [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 pattern matching, consider using `is_ok()` [INFO] [stdout] --> src/install.rs:140:12 [INFO] [stdout] | [INFO] [stdout] 140 | if let Ok(_) = tokio::fs::create_dir_all("cache").await { [INFO] [stdout] | -------^^^^^------------------------------------------- help: try: `if tokio::fs::create_dir_all("cache").await.is_ok()` [INFO] [stdout] | [INFO] [stdout] = note: this will change drop order of the result, as well as all temporaries [INFO] [stdout] = note: add `#[allow(clippy::redundant_pattern_matching)]` if this is important [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/install.rs:272:5 [INFO] [stdout] | [INFO] [stdout] 272 | return util::compare_maven_versions(source, target) == Ordering::Less; [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] 272 - return util::compare_maven_versions(source, target) == Ordering::Less; [INFO] [stdout] 272 + util::compare_maven_versions(source, target) == Ordering::Less [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_ok()` [INFO] [stdout] --> src/install.rs:140:12 [INFO] [stdout] | [INFO] [stdout] 140 | if let Ok(_) = tokio::fs::create_dir_all("cache").await { [INFO] [stdout] | -------^^^^^------------------------------------------- help: try: `if tokio::fs::create_dir_all("cache").await.is_ok()` [INFO] [stdout] | [INFO] [stdout] = note: this will change drop order of the result, as well as all temporaries [INFO] [stdout] = note: add `#[allow(clippy::redundant_pattern_matching)]` if this is important [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/java.rs:92:32 [INFO] [stdout] | [INFO] [stdout] 92 | match self::get_jdk_detail(&version).await { [INFO] [stdout] | ^^^^^^^^ help: change this to: `version` [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/java.rs:101:47 [INFO] [stdout] | [INFO] [stdout] 101 | if let Err(e) = self::run_install(&version, &download_link).await { [INFO] [stdout] | ^^^^^^^^ help: change this to: `version` [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 boolean expression can be simplified [INFO] [stdout] --> src/java.rs:126:15 [INFO] [stdout] | [INFO] [stdout] 126 | return Ok(is_jdk && is_bashrc && is_symlink && is_bashrc); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [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] help: try [INFO] [stdout] | [INFO] [stdout] 126 - return Ok(is_jdk && is_bashrc && is_symlink && is_bashrc); [INFO] [stdout] 126 + return Ok(!(!is_jdk || !is_bashrc || !is_symlink)); [INFO] [stdout] | [INFO] [stdout] 126 - return Ok(is_jdk && is_bashrc && is_symlink && is_bashrc); [INFO] [stdout] 126 + return Ok(is_jdk && is_bashrc && is_symlink); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/java.rs:126:5 [INFO] [stdout] | [INFO] [stdout] 126 | return Ok(is_jdk && is_bashrc && is_symlink && is_bashrc); [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] 126 - return Ok(is_jdk && is_bashrc && is_symlink && is_bashrc); [INFO] [stdout] 126 + Ok(is_jdk && is_bashrc && is_symlink && is_bashrc) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/java.rs:130:25 [INFO] [stdout] | [INFO] [stdout] 130 | Ok(util::dir_exists(&"~/.grind/jdks")) [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: change this to: `"~/.grind/jdks"` [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/java.rs:135:28 [INFO] [stdout] | [INFO] [stdout] 135 | util::expand_tilde(&"~/.grind/jdks/current").ok_or("unable to expand tilde path!")?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `"~/.grind/jdks/current"` [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: useless use of `format!` [INFO] [stdout] --> src/java.rs:158:12 [INFO] [stdout] | [INFO] [stdout] 158 | Ok(format!("{}", &caps[1])) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `(&caps[1]).to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/java.rs:166:29 [INFO] [stdout] | [INFO] [stdout] 166 | util::expand_tilde(&format!("~/.grind/jdks")).ok_or("unable to expand tilde path!")?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"~/.grind/jdks".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/java.rs:167:5 [INFO] [stdout] | [INFO] [stdout] 167 | let _ = std::fs::create_dir_all(full_path).map_err(|e| e.to_string())?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] = note: `#[warn(clippy::let_unit_value)]` on by default [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 167 - let _ = std::fs::create_dir_all(full_path).map_err(|e| e.to_string())?; [INFO] [stdout] 167 + std::fs::create_dir_all(full_path).map_err(|e| e.to_string())?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/java.rs:187:13 [INFO] [stdout] | [INFO] [stdout] 187 | &Path::new(&local_path), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `Path::new(&local_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/java.rs:189:13 [INFO] [stdout] | [INFO] [stdout] 189 | &Path::new(&format!("{}v{}", grind_sdk_path.display(), version)), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `Path::new(&format!("{}v{}", grind_sdk_path.display(), version))` [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/java.rs:232:5 [INFO] [stdout] | [INFO] [stdout] 232 | 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] 232 - return Ok(()); [INFO] [stdout] 232 + Ok(()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/install.rs:272:5 [INFO] [stdout] | [INFO] [stdout] 272 | return util::compare_maven_versions(source, target) == Ordering::Less; [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] 272 - return util::compare_maven_versions(source, target) == Ordering::Less; [INFO] [stdout] 272 + util::compare_maven_versions(source, target) == Ordering::Less [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/java.rs:215:33 [INFO] [stdout] | [INFO] [stdout] 215 | let chunk = item.or(Err(format!("Error while downloading file")))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Error while downloading file".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/java.rs:217:21 [INFO] [stdout] | [INFO] [stdout] 217 | .or(Err(format!("Error while writing to file")))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Error while writing to file".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> src/java.rs:230:5 [INFO] [stdout] | [INFO] [stdout] 230 | 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: useless use of `format!` [INFO] [stdout] --> src/java.rs:259:10 [INFO] [stdout] | [INFO] [stdout] 259 | &format!("~/.grind/jdks/current"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"~/.grind/jdks/current".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/java.rs:276:9 [INFO] [stdout] | [INFO] [stdout] 276 | 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] 276 - return Ok(()); [INFO] [stdout] 276 + Ok(()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/java.rs:296:9 [INFO] [stdout] | [INFO] [stdout] 296 | 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] 296 - return Ok(()); [INFO] [stdout] 296 + Ok(()) [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/java.rs:300:46 [INFO] [stdout] | [INFO] [stdout] 300 | fn backup_bashrc(data: &String, bashrc_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] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 300 - fn backup_bashrc(data: &String, bashrc_path: &PathBuf) -> Result<(), String> { [INFO] [stdout] 300 + fn backup_bashrc(data: &String, bashrc_path: &Path) -> Result<(), String> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: file opened with `create`, but `truncate` behavior not defined [INFO] [stdout] --> src/java.rs:303:10 [INFO] [stdout] | [INFO] [stdout] 303 | .create(true) [INFO] [stdout] | ^^^^^^^^^^^^- help: add: `.truncate(true)` [INFO] [stdout] | [INFO] [stdout] = help: if you intend to overwrite an existing file entirely, call `.truncate(true)` [INFO] [stdout] = help: if you instead know that you may want to keep some parts of the old file, call `.truncate(false)` [INFO] [stdout] = help: alternatively, use `.append(true)` to append to the file instead of overwriting it [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_open_options [INFO] [stdout] = note: `#[warn(clippy::suspicious_open_options)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/java.rs:304:15 [INFO] [stdout] | [INFO] [stdout] 304 | .open(&format!("{}.bak", bashrc_path.display())) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("{}.bak", bashrc_path.display())` [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/java.rs:335:9 [INFO] [stdout] | [INFO] [stdout] 335 | return Ok(link.to_string().replace("\"", "")); [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] 335 - return Ok(link.to_string().replace("\"", "")); [INFO] [stdout] 335 + Ok(link.to_string().replace("\"", "")) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/java.rs:337:9 [INFO] [stdout] | [INFO] [stdout] 337 | / return Err(format!( [INFO] [stdout] 338 | | "❌ Could not extract metadata for v{} , are you sure this is a valid vesion?", [INFO] [stdout] 339 | | version [INFO] [stdout] 340 | | )); [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] 337 ~ Err(format!( [INFO] [stdout] 338 ~ "❌ Could not extract metadata for v{} , are you sure this is a valid vesion?", [INFO] [stdout] 339 + version [INFO] [stdout] 340 ~ )) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/java.rs:92:32 [INFO] [stdout] | [INFO] [stdout] 92 | match self::get_jdk_detail(&version).await { [INFO] [stdout] | ^^^^^^^^ help: change this to: `version` [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/java.rs:101:47 [INFO] [stdout] | [INFO] [stdout] 101 | if let Err(e) = self::run_install(&version, &download_link).await { [INFO] [stdout] | ^^^^^^^^ help: change this to: `version` [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 boolean expression can be simplified [INFO] [stdout] --> src/java.rs:126:15 [INFO] [stdout] | [INFO] [stdout] 126 | return Ok(is_jdk && is_bashrc && is_symlink && is_bashrc); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [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] help: try [INFO] [stdout] | [INFO] [stdout] 126 - return Ok(is_jdk && is_bashrc && is_symlink && is_bashrc); [INFO] [stdout] 126 + return Ok(!(!is_jdk || !is_bashrc || !is_symlink)); [INFO] [stdout] | [INFO] [stdout] 126 - return Ok(is_jdk && is_bashrc && is_symlink && is_bashrc); [INFO] [stdout] 126 + return Ok(is_jdk && is_bashrc && is_symlink); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/java.rs:126:5 [INFO] [stdout] | [INFO] [stdout] 126 | return Ok(is_jdk && is_bashrc && is_symlink && is_bashrc); [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] 126 - return Ok(is_jdk && is_bashrc && is_symlink && is_bashrc); [INFO] [stdout] 126 + Ok(is_jdk && is_bashrc && is_symlink && is_bashrc) [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/lock.rs:19:30 [INFO] [stdout] | [INFO] [stdout] 19 | pub fn lock_file(input_deps: &Vec, locked_deps: &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] 19 - pub fn lock_file(input_deps: &Vec, locked_deps: &Vec) { [INFO] [stdout] 19 + pub fn lock_file(input_deps: &[Dependency], locked_deps: &Vec) { [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/lock.rs:19:61 [INFO] [stdout] | [INFO] [stdout] 19 | pub fn lock_file(input_deps: &Vec, locked_deps: &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] 19 - pub fn lock_file(input_deps: &Vec, locked_deps: &Vec) { [INFO] [stdout] 19 + pub fn lock_file(input_deps: &Vec, locked_deps: &[Dependency]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/java.rs:130:25 [INFO] [stdout] | [INFO] [stdout] 130 | Ok(util::dir_exists(&"~/.grind/jdks")) [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: change this to: `"~/.grind/jdks"` [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/lock.rs:25:5 [INFO] [stdout] | [INFO] [stdout] 25 | / if let Ok(updated) = serde_yaml::to_string(&lock) { [INFO] [stdout] 26 | | if fs::write("grind.lock", updated).is_ok() { [INFO] [stdout] 27 | | println!("🔃 grind.lock synced.."); [INFO] [stdout] 28 | | } [INFO] [stdout] 29 | | } [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] 25 ~ if let Ok(updated) = serde_yaml::to_string(&lock) [INFO] [stdout] 26 ~ && fs::write("grind.lock", updated).is_ok() { [INFO] [stdout] 27 | println!("🔃 grind.lock synced.."); [INFO] [stdout] 28 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/java.rs:135:28 [INFO] [stdout] | [INFO] [stdout] 135 | util::expand_tilde(&"~/.grind/jdks/current").ok_or("unable to expand tilde path!")?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `"~/.grind/jdks/current"` [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: useless use of `format!` [INFO] [stdout] --> src/java.rs:158:12 [INFO] [stdout] | [INFO] [stdout] 158 | Ok(format!("{}", &caps[1])) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `(&caps[1]).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: this `if` statement can be collapsed [INFO] [stdout] --> src/manage.rs:23:9 [INFO] [stdout] | [INFO] [stdout] 23 | / if artifact.contains("@") { [INFO] [stdout] 24 | | if let Some((a, v)) = artifact.split_once("@") { [INFO] [stdout] 25 | | let a = a.to_string(); [INFO] [stdout] 26 | | let v = v.to_string(); [INFO] [stdout] ... | [INFO] [stdout] 30 | | } [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] 23 ~ if artifact.contains("@") [INFO] [stdout] 24 ~ && let Some((a, v)) = artifact.split_once("@") { [INFO] [stdout] 25 | let a = a.to_string(); [INFO] [stdout] ... [INFO] [stdout] 28 | version = v; [INFO] [stdout] 29 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/java.rs:166:29 [INFO] [stdout] | [INFO] [stdout] 166 | util::expand_tilde(&format!("~/.grind/jdks")).ok_or("unable to expand tilde path!")?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"~/.grind/jdks".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/java.rs:167:5 [INFO] [stdout] | [INFO] [stdout] 167 | let _ = std::fs::create_dir_all(full_path).map_err(|e| e.to_string())?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] = note: `#[warn(clippy::let_unit_value)]` on by default [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 167 - let _ = std::fs::create_dir_all(full_path).map_err(|e| e.to_string())?; [INFO] [stdout] 167 + std::fs::create_dir_all(full_path).map_err(|e| e.to_string())?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/java.rs:187:13 [INFO] [stdout] | [INFO] [stdout] 187 | &Path::new(&local_path), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `Path::new(&local_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/java.rs:189:13 [INFO] [stdout] | [INFO] [stdout] 189 | &Path::new(&format!("{}v{}", grind_sdk_path.display(), version)), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `Path::new(&format!("{}v{}", grind_sdk_path.display(), version))` [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/java.rs:232:5 [INFO] [stdout] | [INFO] [stdout] 232 | 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] 232 - return Ok(()); [INFO] [stdout] 232 + Ok(()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/java.rs:215:33 [INFO] [stdout] | [INFO] [stdout] 215 | let chunk = item.or(Err(format!("Error while downloading file")))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Error while downloading file".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/java.rs:217:21 [INFO] [stdout] | [INFO] [stdout] 217 | .or(Err(format!("Error while writing to file")))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Error while writing to file".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> src/java.rs:230:5 [INFO] [stdout] | [INFO] [stdout] 230 | 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: useless use of `format!` [INFO] [stdout] --> src/java.rs:259:10 [INFO] [stdout] | [INFO] [stdout] 259 | &format!("~/.grind/jdks/current"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"~/.grind/jdks/current".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/java.rs:276:9 [INFO] [stdout] | [INFO] [stdout] 276 | 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] 276 - return Ok(()); [INFO] [stdout] 276 + Ok(()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/java.rs:296:9 [INFO] [stdout] | [INFO] [stdout] 296 | 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] 296 - return Ok(()); [INFO] [stdout] 296 + Ok(()) [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/java.rs:300:46 [INFO] [stdout] | [INFO] [stdout] 300 | fn backup_bashrc(data: &String, bashrc_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] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 300 - fn backup_bashrc(data: &String, bashrc_path: &PathBuf) -> Result<(), String> { [INFO] [stdout] 300 + fn backup_bashrc(data: &String, bashrc_path: &Path) -> Result<(), String> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: file opened with `create`, but `truncate` behavior not defined [INFO] [stdout] --> src/java.rs:303:10 [INFO] [stdout] | [INFO] [stdout] 303 | .create(true) [INFO] [stdout] | ^^^^^^^^^^^^- help: add: `.truncate(true)` [INFO] [stdout] | [INFO] [stdout] = help: if you intend to overwrite an existing file entirely, call `.truncate(true)` [INFO] [stdout] = help: if you instead know that you may want to keep some parts of the old file, call `.truncate(false)` [INFO] [stdout] = help: alternatively, use `.append(true)` to append to the file instead of overwriting it [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_open_options [INFO] [stdout] = note: `#[warn(clippy::suspicious_open_options)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/java.rs:304:15 [INFO] [stdout] | [INFO] [stdout] 304 | .open(&format!("{}.bak", bashrc_path.display())) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("{}.bak", bashrc_path.display())` [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/java.rs:335:9 [INFO] [stdout] | [INFO] [stdout] 335 | return Ok(link.to_string().replace("\"", "")); [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] 335 - return Ok(link.to_string().replace("\"", "")); [INFO] [stdout] 335 + Ok(link.to_string().replace("\"", "")) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/java.rs:337:9 [INFO] [stdout] | [INFO] [stdout] 337 | / return Err(format!( [INFO] [stdout] 338 | | "❌ Could not extract metadata for v{} , are you sure this is a valid vesion?", [INFO] [stdout] 339 | | version [INFO] [stdout] 340 | | )); [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] 337 ~ Err(format!( [INFO] [stdout] 338 ~ "❌ Could not extract metadata for v{} , are you sure this is a valid vesion?", [INFO] [stdout] 339 + version [INFO] [stdout] 340 ~ )) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/pom.rs:59:21 [INFO] [stdout] | [INFO] [stdout] 59 | / if let Some(optional) = dep.optional { [INFO] [stdout] 60 | | if optional.contains("true") { [INFO] [stdout] 61 | | is_optional = true; [INFO] [stdout] 62 | | } [INFO] [stdout] 63 | | } [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] 59 ~ if let Some(optional) = dep.optional [INFO] [stdout] 60 ~ && optional.contains("true") { [INFO] [stdout] 61 | is_optional = true; [INFO] [stdout] 62 ~ } [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/lock.rs:19:30 [INFO] [stdout] | [INFO] [stdout] 19 | pub fn lock_file(input_deps: &Vec, locked_deps: &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] 19 - pub fn lock_file(input_deps: &Vec, locked_deps: &Vec) { [INFO] [stdout] 19 + pub fn lock_file(input_deps: &[Dependency], locked_deps: &Vec) { [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/lock.rs:19:61 [INFO] [stdout] | [INFO] [stdout] 19 | pub fn lock_file(input_deps: &Vec, locked_deps: &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] 19 - pub fn lock_file(input_deps: &Vec, locked_deps: &Vec) { [INFO] [stdout] 19 + pub fn lock_file(input_deps: &Vec, locked_deps: &[Dependency]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/lock.rs:25:5 [INFO] [stdout] | [INFO] [stdout] 25 | / if let Ok(updated) = serde_yaml::to_string(&lock) { [INFO] [stdout] 26 | | if fs::write("grind.lock", updated).is_ok() { [INFO] [stdout] 27 | | println!("🔃 grind.lock synced.."); [INFO] [stdout] 28 | | } [INFO] [stdout] 29 | | } [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] 25 ~ if let Ok(updated) = serde_yaml::to_string(&lock) [INFO] [stdout] 26 ~ && fs::write("grind.lock", updated).is_ok() { [INFO] [stdout] 27 | println!("🔃 grind.lock synced.."); [INFO] [stdout] 28 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/manage.rs:23:9 [INFO] [stdout] | [INFO] [stdout] 23 | / if artifact.contains("@") { [INFO] [stdout] 24 | | if let Some((a, v)) = artifact.split_once("@") { [INFO] [stdout] 25 | | let a = a.to_string(); [INFO] [stdout] 26 | | let v = v.to_string(); [INFO] [stdout] ... | [INFO] [stdout] 30 | | } [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] 23 ~ if artifact.contains("@") [INFO] [stdout] 24 ~ && let Some((a, v)) = artifact.split_once("@") { [INFO] [stdout] 25 | let a = a.to_string(); [INFO] [stdout] ... [INFO] [stdout] 28 | version = v; [INFO] [stdout] 29 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/pom.rs:59:21 [INFO] [stdout] | [INFO] [stdout] 59 | / if let Some(optional) = dep.optional { [INFO] [stdout] 60 | | if optional.contains("true") { [INFO] [stdout] 61 | | is_optional = true; [INFO] [stdout] 62 | | } [INFO] [stdout] 63 | | } [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] 59 ~ if let Some(optional) = dep.optional [INFO] [stdout] 60 ~ && optional.contains("true") { [INFO] [stdout] 61 | is_optional = true; [INFO] [stdout] 62 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_ok()` [INFO] [stdout] --> src/tests.rs:87:5 [INFO] [stdout] | [INFO] [stdout] 87 | / match handle_validate_integrity("plugins/TestTube".into()) { [INFO] [stdout] 88 | | Ok(_) => true, [INFO] [stdout] 89 | | Err(_) => false, [INFO] [stdout] 90 | | } [INFO] [stdout] | |_____^ help: try: `handle_validate_integrity("plugins/TestTube".into()).is_ok()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `flatten()` will run forever if the iterator repeatedly produces an `Err` [INFO] [stdout] --> src/util.rs:131:43 [INFO] [stdout] | [INFO] [stdout] 131 | for line in stderr_reader.lines().flatten() { [INFO] [stdout] | ^^^^^^^^^ help: replace with: `map_while(Result::ok)` [INFO] [stdout] | [INFO] [stdout] note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error [INFO] [stdout] --> src/util.rs:131:21 [INFO] [stdout] | [INFO] [stdout] 131 | for line in stderr_reader.lines().flatten() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lines_filter_map_ok [INFO] [stdout] = note: `#[warn(clippy::lines_filter_map_ok)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `flatten()` will run forever if the iterator repeatedly produces an `Err` [INFO] [stdout] --> src/util.rs:137:39 [INFO] [stdout] | [INFO] [stdout] 137 | for line in stdout_reader.lines().flatten() { [INFO] [stdout] | ^^^^^^^^^ help: replace with: `map_while(Result::ok)` [INFO] [stdout] | [INFO] [stdout] note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error [INFO] [stdout] --> src/util.rs:137:17 [INFO] [stdout] | [INFO] [stdout] 137 | for line in stdout_reader.lines().flatten() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lines_filter_map_ok [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/util.rs:154:9 [INFO] [stdout] | [INFO] [stdout] 154 | / if path.is_file() { [INFO] [stdout] 155 | | if let Some(ext) = path.extension() [INFO] [stdout] 156 | | && ext == extension [INFO] [stdout] ... | [INFO] [stdout] 162 | | } [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] 154 ~ if path.is_file() [INFO] [stdout] 155 ~ && let Some(ext) = path.extension() [INFO] [stdout] 156 | && ext == extension [INFO] [stdout] ... [INFO] [stdout] 160 | } [INFO] [stdout] 161 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/util.rs:155:13 [INFO] [stdout] | [INFO] [stdout] 155 | / if let Some(ext) = path.extension() [INFO] [stdout] 156 | | && ext == extension [INFO] [stdout] 157 | | { [INFO] [stdout] 158 | | if let Some(file_str) = path.to_str() { [INFO] [stdout] ... | [INFO] [stdout] 161 | | } [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] 156 ~ && ext == extension [INFO] [stdout] 157 ~ && let Some(file_str) = path.to_str() { [INFO] [stdout] 158 | files.push(file_str.to_string()); [INFO] [stdout] 159 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/util.rs:179:13 [INFO] [stdout] | [INFO] [stdout] 179 | / if let Some(parent) = outpath.parent() { [INFO] [stdout] 180 | | if !parent.exists() { [INFO] [stdout] 181 | | fs::create_dir_all(parent)?; [INFO] [stdout] 182 | | } [INFO] [stdout] 183 | | } [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] 179 ~ if let Some(parent) = outpath.parent() [INFO] [stdout] 180 ~ && !parent.exists() { [INFO] [stdout] 181 | fs::create_dir_all(parent)?; [INFO] [stdout] 182 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/util.rs:205:46 [INFO] [stdout] | [INFO] [stdout] 205 | return Some(PathBuf::from(home).join(path[1..].trim_start_matches('/'))); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/util.rs:203:5 [INFO] [stdout] | [INFO] [stdout] 203 | if path.starts_with('~') { [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] 203 ~ if let Some() = path.strip_prefix('~') { [INFO] [stdout] 204 | let home = env::var("HOME").ok()?; [INFO] [stdout] 205 ~ return Some(PathBuf::from(home).join(.trim_start_matches('/'))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this manual char comparison can be written more succinctly [INFO] [stdout] --> src/util.rs:327:13 [INFO] [stdout] | [INFO] [stdout] 327 | v.split(|c| c == '.' || c == '-' || c == '_') [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using an array of `char`: `['.', '-', '_']` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_pattern_char_comparison [INFO] [stdout] = note: `#[warn(clippy::manual_pattern_char_comparison)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_ok()` [INFO] [stdout] --> src/tests.rs:87:5 [INFO] [stdout] | [INFO] [stdout] 87 | / match handle_validate_integrity("plugins/TestTube".into()) { [INFO] [stdout] 88 | | Ok(_) => true, [INFO] [stdout] 89 | | Err(_) => false, [INFO] [stdout] 90 | | } [INFO] [stdout] | |_____^ help: try: `handle_validate_integrity("plugins/TestTube".into()).is_ok()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `flatten()` will run forever if the iterator repeatedly produces an `Err` [INFO] [stdout] --> src/util.rs:131:43 [INFO] [stdout] | [INFO] [stdout] 131 | for line in stderr_reader.lines().flatten() { [INFO] [stdout] | ^^^^^^^^^ help: replace with: `map_while(Result::ok)` [INFO] [stdout] | [INFO] [stdout] note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error [INFO] [stdout] --> src/util.rs:131:21 [INFO] [stdout] | [INFO] [stdout] 131 | for line in stderr_reader.lines().flatten() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lines_filter_map_ok [INFO] [stdout] = note: `#[warn(clippy::lines_filter_map_ok)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `flatten()` will run forever if the iterator repeatedly produces an `Err` [INFO] [stdout] --> src/util.rs:137:39 [INFO] [stdout] | [INFO] [stdout] 137 | for line in stdout_reader.lines().flatten() { [INFO] [stdout] | ^^^^^^^^^ help: replace with: `map_while(Result::ok)` [INFO] [stdout] | [INFO] [stdout] note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error [INFO] [stdout] --> src/util.rs:137:17 [INFO] [stdout] | [INFO] [stdout] 137 | for line in stdout_reader.lines().flatten() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lines_filter_map_ok [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/util.rs:154:9 [INFO] [stdout] | [INFO] [stdout] 154 | / if path.is_file() { [INFO] [stdout] 155 | | if let Some(ext) = path.extension() [INFO] [stdout] 156 | | && ext == extension [INFO] [stdout] ... | [INFO] [stdout] 162 | | } [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] 154 ~ if path.is_file() [INFO] [stdout] 155 ~ && let Some(ext) = path.extension() [INFO] [stdout] 156 | && ext == extension [INFO] [stdout] ... [INFO] [stdout] 160 | } [INFO] [stdout] 161 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/util.rs:155:13 [INFO] [stdout] | [INFO] [stdout] 155 | / if let Some(ext) = path.extension() [INFO] [stdout] 156 | | && ext == extension [INFO] [stdout] 157 | | { [INFO] [stdout] 158 | | if let Some(file_str) = path.to_str() { [INFO] [stdout] ... | [INFO] [stdout] 161 | | } [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] 156 ~ && ext == extension [INFO] [stdout] 157 ~ && let Some(file_str) = path.to_str() { [INFO] [stdout] 158 | files.push(file_str.to_string()); [INFO] [stdout] 159 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/util.rs:179:13 [INFO] [stdout] | [INFO] [stdout] 179 | / if let Some(parent) = outpath.parent() { [INFO] [stdout] 180 | | if !parent.exists() { [INFO] [stdout] 181 | | fs::create_dir_all(parent)?; [INFO] [stdout] 182 | | } [INFO] [stdout] 183 | | } [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] 179 ~ if let Some(parent) = outpath.parent() [INFO] [stdout] 180 ~ && !parent.exists() { [INFO] [stdout] 181 | fs::create_dir_all(parent)?; [INFO] [stdout] 182 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/util.rs:205:46 [INFO] [stdout] | [INFO] [stdout] 205 | return Some(PathBuf::from(home).join(path[1..].trim_start_matches('/'))); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/util.rs:203:5 [INFO] [stdout] | [INFO] [stdout] 203 | if path.starts_with('~') { [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] 203 ~ if let Some() = path.strip_prefix('~') { [INFO] [stdout] 204 | let home = env::var("HOME").ok()?; [INFO] [stdout] 205 ~ return Some(PathBuf::from(home).join(.trim_start_matches('/'))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this manual char comparison can be written more succinctly [INFO] [stdout] --> src/util.rs:327:13 [INFO] [stdout] | [INFO] [stdout] 327 | v.split(|c| c == '.' || c == '-' || c == '_') [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using an array of `char`: `['.', '-', '_']` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_pattern_char_comparison [INFO] [stdout] = note: `#[warn(clippy::manual_pattern_char_comparison)]` 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/main.rs:275:5 [INFO] [stdout] | [INFO] [stdout] 275 | / match identifier.chars().nth(0).unwrap() { [INFO] [stdout] 276 | | '0'..='9' => return false, [INFO] [stdout] 277 | | _ => {} [INFO] [stdout] 278 | | } [INFO] [stdout] | |_____^ help: try: `if let '0'..='9' = identifier.chars().nth(0).unwrap() { return false }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/main.rs:275:11 [INFO] [stdout] | [INFO] [stdout] 275 | match identifier.chars().nth(0).unwrap() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `identifier.chars().next()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] = note: `#[warn(clippy::iter_nth_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/main.rs:367:5 [INFO] [stdout] | [INFO] [stdout] 367 | / if let Some(profiles) = &grind.project.profiles { [INFO] [stdout] 368 | | if let Some(matched) = profiles.get(&profile) { [INFO] [stdout] 369 | | if let Some(matched_flags) = &matched.flags { [INFO] [stdout] 370 | | flags = matched_flags.join(" ") [INFO] [stdout] ... | [INFO] [stdout] 373 | | } [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] 367 ~ if let Some(profiles) = &grind.project.profiles [INFO] [stdout] 368 ~ && let Some(matched) = profiles.get(&profile) { [INFO] [stdout] 369 | if let Some(matched_flags) = &matched.flags { [INFO] [stdout] 370 | flags = matched_flags.join(" ") [INFO] [stdout] 371 | } [INFO] [stdout] 372 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/main.rs:368:9 [INFO] [stdout] | [INFO] [stdout] 368 | / if let Some(matched) = profiles.get(&profile) { [INFO] [stdout] 369 | | if let Some(matched_flags) = &matched.flags { [INFO] [stdout] 370 | | flags = matched_flags.join(" ") [INFO] [stdout] 371 | | } [INFO] [stdout] 372 | | } [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] 368 ~ if let Some(matched) = profiles.get(&profile) [INFO] [stdout] 369 ~ && let Some(matched_flags) = &matched.flags { [INFO] [stdout] 370 | flags = matched_flags.join(" ") [INFO] [stdout] 371 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:401:33 [INFO] [stdout] | [INFO] [stdout] 401 | flags = self::get_flags(&grind, profile.to_string()); [INFO] [stdout] | ^^^^^^ help: change this to: `grind` [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/main.rs:402:31 [INFO] [stdout] | [INFO] [stdout] 402 | envs = self::get_envs(&grind, profile.to_string()); [INFO] [stdout] | ^^^^^^ help: change this to: `grind` [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/main.rs:419:5 [INFO] [stdout] | [INFO] [stdout] 419 | / if let Some(profiles) = &grind.project.profiles { [INFO] [stdout] 420 | | if let Some(matched) = profiles.get(&profile) { [INFO] [stdout] 421 | | if let Some(matched_envs) = &matched.envs { [INFO] [stdout] 422 | | envs = matched_envs [INFO] [stdout] ... | [INFO] [stdout] 429 | | } [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] 419 ~ if let Some(profiles) = &grind.project.profiles [INFO] [stdout] 420 ~ && let Some(matched) = profiles.get(&profile) { [INFO] [stdout] 421 | if let Some(matched_envs) = &matched.envs { [INFO] [stdout] ... [INFO] [stdout] 427 | } [INFO] [stdout] 428 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/main.rs:420:9 [INFO] [stdout] | [INFO] [stdout] 420 | / if let Some(matched) = profiles.get(&profile) { [INFO] [stdout] 421 | | if let Some(matched_envs) = &matched.envs { [INFO] [stdout] 422 | | envs = matched_envs [INFO] [stdout] 423 | | .iter() [INFO] [stdout] ... | [INFO] [stdout] 428 | | } [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] 420 ~ if let Some(matched) = profiles.get(&profile) [INFO] [stdout] 421 ~ && let Some(matched_envs) = &matched.envs { [INFO] [stdout] 422 | envs = matched_envs [INFO] [stdout] ... [INFO] [stdout] 426 | .join(" "); [INFO] [stdout] 427 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/main.rs:275:5 [INFO] [stdout] | [INFO] [stdout] 275 | / match identifier.chars().nth(0).unwrap() { [INFO] [stdout] 276 | | '0'..='9' => return false, [INFO] [stdout] 277 | | _ => {} [INFO] [stdout] 278 | | } [INFO] [stdout] | |_____^ help: try: `if let '0'..='9' = identifier.chars().nth(0).unwrap() { return false }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/main.rs:275:11 [INFO] [stdout] | [INFO] [stdout] 275 | match identifier.chars().nth(0).unwrap() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `identifier.chars().next()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] = note: `#[warn(clippy::iter_nth_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/main.rs:367:5 [INFO] [stdout] | [INFO] [stdout] 367 | / if let Some(profiles) = &grind.project.profiles { [INFO] [stdout] 368 | | if let Some(matched) = profiles.get(&profile) { [INFO] [stdout] 369 | | if let Some(matched_flags) = &matched.flags { [INFO] [stdout] 370 | | flags = matched_flags.join(" ") [INFO] [stdout] ... | [INFO] [stdout] 373 | | } [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] 367 ~ if let Some(profiles) = &grind.project.profiles [INFO] [stdout] 368 ~ && let Some(matched) = profiles.get(&profile) { [INFO] [stdout] 369 | if let Some(matched_flags) = &matched.flags { [INFO] [stdout] 370 | flags = matched_flags.join(" ") [INFO] [stdout] 371 | } [INFO] [stdout] 372 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/main.rs:368:9 [INFO] [stdout] | [INFO] [stdout] 368 | / if let Some(matched) = profiles.get(&profile) { [INFO] [stdout] 369 | | if let Some(matched_flags) = &matched.flags { [INFO] [stdout] 370 | | flags = matched_flags.join(" ") [INFO] [stdout] 371 | | } [INFO] [stdout] 372 | | } [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] 368 ~ if let Some(matched) = profiles.get(&profile) [INFO] [stdout] 369 ~ && let Some(matched_flags) = &matched.flags { [INFO] [stdout] 370 | flags = matched_flags.join(" ") [INFO] [stdout] 371 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:401:33 [INFO] [stdout] | [INFO] [stdout] 401 | flags = self::get_flags(&grind, profile.to_string()); [INFO] [stdout] | ^^^^^^ help: change this to: `grind` [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/main.rs:402:31 [INFO] [stdout] | [INFO] [stdout] 402 | envs = self::get_envs(&grind, profile.to_string()); [INFO] [stdout] | ^^^^^^ help: change this to: `grind` [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/main.rs:419:5 [INFO] [stdout] | [INFO] [stdout] 419 | / if let Some(profiles) = &grind.project.profiles { [INFO] [stdout] 420 | | if let Some(matched) = profiles.get(&profile) { [INFO] [stdout] 421 | | if let Some(matched_envs) = &matched.envs { [INFO] [stdout] 422 | | envs = matched_envs [INFO] [stdout] ... | [INFO] [stdout] 429 | | } [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] 419 ~ if let Some(profiles) = &grind.project.profiles [INFO] [stdout] 420 ~ && let Some(matched) = profiles.get(&profile) { [INFO] [stdout] 421 | if let Some(matched_envs) = &matched.envs { [INFO] [stdout] ... [INFO] [stdout] 427 | } [INFO] [stdout] 428 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/main.rs:420:9 [INFO] [stdout] | [INFO] [stdout] 420 | / if let Some(matched) = profiles.get(&profile) { [INFO] [stdout] 421 | | if let Some(matched_envs) = &matched.envs { [INFO] [stdout] 422 | | envs = matched_envs [INFO] [stdout] 423 | | .iter() [INFO] [stdout] ... | [INFO] [stdout] 428 | | } [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] 420 ~ if let Some(matched) = profiles.get(&profile) [INFO] [stdout] 421 ~ && let Some(matched_envs) = &matched.envs { [INFO] [stdout] 422 | envs = matched_envs [INFO] [stdout] ... [INFO] [stdout] 426 | .join(" "); [INFO] [stdout] 427 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 36.87s [INFO] running `Command { std: "docker" "inspect" "9055f656bf1af270c2c96249df34015d44b8fa9f070c6f06aaeadc48fcc0f7df", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "9055f656bf1af270c2c96249df34015d44b8fa9f070c6f06aaeadc48fcc0f7df", kill_on_drop: false }` [INFO] [stdout] 9055f656bf1af270c2c96249df34015d44b8fa9f070c6f06aaeadc48fcc0f7df