[INFO] cloning repository https://github.com/gaborcsardi/rim [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/gaborcsardi/rim" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fgaborcsardi%2Frim", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fgaborcsardi%2Frim'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] c56caf82f9a4f12e071edfea55adf013e02c8c78 [INFO] linting gaborcsardi/rim against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fgaborcsardi%2Frim" "/workspace/builds/worker-0-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-0-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/gaborcsardi/rim [INFO] finished tweaking git repo https://github.com/gaborcsardi/rim [INFO] tweaked toml for git repo https://github.com/gaborcsardi/rim written to /workspace/builds/worker-0-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/gaborcsardi/rim 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/gaborcsardi/rim already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Updating crates.io index [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded tabular v0.2.0 [INFO] [stderr] Downloaded static_vcruntime v2.0.0 [INFO] [stderr] Downloaded getrandom v0.2.13 [INFO] [stderr] Downloaded simple-error v0.2.3 [INFO] [stderr] Downloaded os_pipe v1.1.5 [INFO] [stderr] Downloaded remove_dir_all v0.7.0 [INFO] [stderr] Downloaded ctrlc v3.4.4 [INFO] [stderr] Downloaded shared_child v1.0.0 [INFO] [stderr] Downloaded is_elevated v0.1.2 [INFO] [stderr] Downloaded version-ranges v0.1.2 [INFO] [stderr] Downloaded deb822-fast v0.2.3 [INFO] [stderr] Downloaded wasm-streams v0.4.0 [INFO] [stderr] Downloaded hyper-util v0.1.7 [INFO] [stderr] Downloaded clap_complete v4.5.11 [INFO] [stderr] Downloaded priority-queue v2.7.0 [INFO] [stderr] Downloaded pubgrub v0.3.0 [INFO] [stderr] Downloaded clap v4.5.11 [INFO] [stderr] Downloaded wiremock v0.6.4 [INFO] [stderr] Downloaded duct v0.13.7 [INFO] [stderr] Downloaded serde_json v1.0.121 [INFO] [stderr] Downloaded clap_builder v4.5.11 [INFO] [stderr] Downloaded rds2rust v0.1.41 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-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] 1e973a4095d50c137bac391e0918360209774f240761382cb5968174b1cadeca [INFO] running `Command { std: "docker" "start" "-a" "1e973a4095d50c137bac391e0918360209774f240761382cb5968174b1cadeca", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "1e973a4095d50c137bac391e0918360209774f240761382cb5968174b1cadeca", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "1e973a4095d50c137bac391e0918360209774f240761382cb5968174b1cadeca", kill_on_drop: false }` [INFO] [stdout] 1e973a4095d50c137bac391e0918360209774f240761382cb5968174b1cadeca [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-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] 094622ef169b37973a55704cb830f02739817916dd5010372f139ee27620fdd2 [INFO] running `Command { std: "docker" "start" "-a" "094622ef169b37973a55704cb830f02739817916dd5010372f139ee27620fdd2", kill_on_drop: false }` [INFO] [stderr] Checking smallvec v1.15.1 [INFO] [stderr] Compiling proc-macro2 v1.0.106 [INFO] [stderr] Compiling lock_api v0.4.11 [INFO] [stderr] Compiling parking_lot_core v0.9.9 [INFO] [stderr] Checking indexmap v2.13.0 [INFO] [stderr] Checking signal-hook-registry v1.4.1 [INFO] [stderr] Checking mio v0.8.11 [INFO] [stderr] Checking num_cpus v1.16.0 [INFO] [stderr] Checking socket2 v0.5.6 [INFO] [stderr] Compiling serde_core v1.0.228 [INFO] [stderr] Checking getrandom v0.2.13 [INFO] [stderr] Checking tracing-core v0.1.32 [INFO] [stderr] Compiling ring v0.17.8 [INFO] [stderr] Checking aho-corasick v1.1.3 [INFO] [stderr] Checking parking_lot v0.12.1 [INFO] [stderr] Compiling utf8parse v0.2.1 [INFO] [stderr] Compiling quote v1.0.44 [INFO] [stderr] Compiling anstyle-parse v0.2.3 [INFO] [stderr] Compiling colorchoice v1.0.0 [INFO] [stderr] Compiling syn v2.0.114 [INFO] [stderr] Compiling anstyle v1.0.6 [INFO] [stderr] Compiling anstyle-query v1.0.2 [INFO] [stderr] Checking tracing v0.1.40 [INFO] [stderr] Compiling zerocopy v0.8.39 [INFO] [stderr] Compiling serde_json v1.0.121 [INFO] [stderr] Compiling generic-array v0.14.7 [INFO] [stderr] Compiling anstream v0.6.13 [INFO] [stderr] Compiling ahash v0.8.12 [INFO] [stderr] Compiling clap_lex v0.7.0 [INFO] [stderr] Compiling rustls v0.21.10 [INFO] [stderr] Compiling rustix v1.1.3 [INFO] [stderr] Checking regex-automata v0.4.6 [INFO] [stderr] Compiling clap_builder v4.5.11 [INFO] [stderr] Compiling lzma-sys v0.1.20 [INFO] [stderr] Checking http v1.4.0 [INFO] [stderr] Compiling cfg_aliases v0.1.1 [INFO] [stderr] Compiling nix v0.28.0 [INFO] [stderr] Compiling libsqlite3-sys v0.30.1 [INFO] [stderr] Checking getrandom v0.4.1 [INFO] [stderr] Checking dirs-sys v0.3.7 [INFO] [stderr] Checking simd-adler32 v0.3.8 [INFO] [stderr] Compiling portable-atomic v1.13.1 [INFO] [stderr] Checking miniz_oxide v0.8.9 [INFO] [stderr] Checking console v0.15.8 [INFO] [stderr] Checking regex v1.10.5 [INFO] [stderr] Checking bstr v1.9.1 [INFO] [stderr] Checking crc32fast v1.5.0 [INFO] [stderr] Checking http-body v1.0.1 [INFO] [stderr] Checking rand_core v0.6.4 [INFO] [stderr] Checking tempfile v3.25.0 [INFO] [stderr] Compiling clap v4.5.11 [INFO] [stderr] Compiling clap_complete v4.5.11 [INFO] [stderr] Compiling num-traits v0.2.18 [INFO] [stderr] Checking sct v0.7.1 [INFO] [stderr] Checking rustls-webpki v0.101.7 [INFO] [stderr] Compiling whoami v1.5.1 [INFO] [stderr] Compiling static_vcruntime v2.0.0 [INFO] [stderr] Checking rand_chacha v0.3.1 [INFO] [stderr] Checking rustls-native-certs v0.6.3 [INFO] [stderr] Checking flate2 v1.1.9 [INFO] [stderr] Compiling tokio-macros v2.2.0 [INFO] [stderr] Compiling futures-macro v0.3.30 [INFO] [stderr] Compiling serde_derive v1.0.228 [INFO] [stderr] Checking tokio v1.37.0 [INFO] [stderr] Checking futures-util v0.3.30 [INFO] [stderr] Compiling thiserror-impl v2.0.18 [INFO] [stderr] Checking hashbrown v0.14.5 [INFO] [stderr] Compiling rig v0.8.0-beta (/opt/rustwide/workdir) [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/args.rs:87:18 [INFO] [stdout] | [INFO] [stdout] 87 | .aliases(&["switch"]) [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `["switch"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/args.rs:104:18 [INFO] [stdout] | [INFO] [stdout] 104 | .aliases(&["ls"]) [INFO] [stdout] | ^^^^^^^ help: change this to: `["ls"]` [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/args.rs:128:18 [INFO] [stdout] | [INFO] [stdout] 128 | .aliases(&["install"]); [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `["install"]` [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/args.rs:147:37 [INFO] [stdout] | [INFO] [stdout] 147 | .conflicts_with_all(&["without-cran-mirror", "without-p3m"]), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["without-cran-mirror", "without-p3m"]` [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/args.rs:162:37 [INFO] [stdout] | [INFO] [stdout] 162 | .conflicts_with_all(&["without-cran-mirror", "without-p3m"]), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["without-cran-mirror", "without-p3m"]` [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/args.rs:173:37 [INFO] [stdout] | [INFO] [stdout] 173 | .conflicts_with_all(&["with-repos", "without-repos"]), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["with-repos", "without-repos"]` [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/args.rs:177:26 [INFO] [stdout] | [INFO] [stdout] 177 | .aliases(&["without-rspm"]) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: change this to: `["without-rspm"]` [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/args.rs:186:37 [INFO] [stdout] | [INFO] [stdout] 186 | .conflicts_with_all(&["with-repos", "without-repos"]), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["with-repos", "without-repos"]` [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/args.rs:264:18 [INFO] [stdout] | [INFO] [stdout] 264 | .aliases(&["del", "remove", "delete"]) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["del", "remove", "delete"]` [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/args.rs:375:18 [INFO] [stdout] | [INFO] [stdout] 375 | .aliases(&["create-lib"]) [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: change this to: `["create-lib"]` [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/args.rs:679:18 [INFO] [stdout] | [INFO] [stdout] 679 | .aliases(&["lib"]) [INFO] [stdout] | ^^^^^^^^ help: change this to: `["lib"]` [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/args.rs:690:26 [INFO] [stdout] | [INFO] [stdout] 690 | .aliases(&["ls"]) [INFO] [stdout] | ^^^^^^^ help: change this to: `["ls"]` [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] [stderr] Checking xz2 v0.1.7 [INFO] [stderr] Checking env_filter v1.0.0 [INFO] [stderr] Checking digest v0.9.0 [INFO] [stderr] Checking block-buffer v0.9.0 [INFO] [stderr] Checking hashlink v0.9.1 [INFO] [stderr] Checking dirs v4.0.0 [INFO] [stderr] Checking priority-queue v2.7.0 [INFO] [stderr] Checking version-ranges v0.1.2 [INFO] [stderr] Checking shared_child v1.0.0 [INFO] [stderr] Checking memmap2 v0.9.10 [INFO] [stderr] Checking os_pipe v1.1.5 [INFO] [stderr] Checking csv-core v0.1.13 [INFO] [stderr] Checking cpufeatures v0.2.12 [INFO] [stderr] Checking jiff v0.2.20 [INFO] [stderr] Checking thiserror v2.0.18 [INFO] [stderr] Checking sha2 v0.9.9 [INFO] [stderr] Checking indicatif v0.17.11 [INFO] [stderr] Checking pubgrub v0.3.0 [INFO] [stderr] Checking csv v1.4.0 [INFO] [stderr] Checking duct v0.13.7 [INFO] [stderr] Checking shellexpand v2.1.2 [INFO] [stderr] Checking ctrlc v3.4.4 [INFO] [stderr] Compiling async-trait v0.1.89 [INFO] [stderr] Checking rand v0.8.5 [INFO] [stderr] Checking serde v1.0.228 [INFO] [stderr] Checking futures-executor v0.3.30 [INFO] [stderr] Checking globset v0.4.18 [INFO] [stderr] Checking futures v0.3.30 [INFO] [stderr] Checking directories v4.0.1 [INFO] [stderr] Checking tabular v0.2.0 [INFO] [stderr] Checking sudo v0.6.0 [INFO] [stderr] Checking filetime v0.2.27 [INFO] [stderr] Checking serde_urlencoded v0.7.1 [INFO] [stderr] Checking serde_yaml v0.9.34+deprecated [INFO] [stderr] Checking simple-error v0.2.3 [INFO] [stderr] Checking deb822-fast v0.2.3 [INFO] [stderr] Checking deadpool-runtime v0.1.4 [INFO] [stderr] Checking path-clean v1.0.1 [INFO] [stderr] Checking either v1.10.0 [INFO] [stderr] Checking float-cmp v0.9.0 [INFO] [stderr] Checking predicates v3.1.0 [INFO] [stderr] Checking http-body-util v0.1.3 [INFO] [stderr] Checking itertools v0.10.5 [INFO] [stderr] Checking tokio-util v0.7.10 [INFO] [stderr] Checking tokio-rustls v0.24.1 [INFO] [stderr] Checking deadpool v0.10.0 [INFO] [stderr] Checking wait-timeout v0.2.0 [INFO] [stderr] Checking similar v2.7.0 [INFO] [stderr] Checking h2 v0.3.26 [INFO] [stderr] Checking h2 v0.4.13 [INFO] [stderr] Checking rds2rust v0.1.41 [INFO] [stderr] Checking assert-json-diff v2.0.2 [INFO] [stderr] Checking insta v1.46.3 [INFO] [stderr] Checking assert_cmd v2.0.14 [INFO] [stderr] Checking env_logger v0.11.9 [INFO] [stderr] Checking predicates v2.1.5 [INFO] [stderr] Checking hyper v0.14.28 [INFO] [stderr] Checking hyper v1.6.0 [INFO] [stderr] Checking rusqlite v0.32.1 [INFO] [stderr] Checking hyper-util v0.1.7 [INFO] [stderr] Checking wiremock v0.6.4 [INFO] [stderr] Checking hyper-rustls v0.24.2 [INFO] [stderr] Checking reqwest v0.11.27 [INFO] [stdout] warning: unneeded sub `cfg` when there is only one condition [INFO] [stdout] --> src/args.rs:322:11 [INFO] [stdout] | [INFO] [stdout] 322 | #[cfg(any(target_os = "linux"))] [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `target_os = "linux"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_minimal_cfg [INFO] [stdout] = note: `#[warn(clippy::non_minimal_cfg)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded sub `cfg` when there is only one condition [INFO] [stdout] --> src/args.rs:609:11 [INFO] [stdout] | [INFO] [stdout] 609 | #[cfg(any(target_os = "linux"))] [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `target_os = "linux"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_minimal_cfg [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded sub `cfg` when there is only one condition [INFO] [stdout] --> src/args.rs:621:11 [INFO] [stdout] | [INFO] [stdout] 621 | #[cfg(any(target_os = "macos"))] [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `target_os = "macos"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_minimal_cfg [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded sub `cfg` when there is only one condition [INFO] [stdout] --> src/args.rs:634:11 [INFO] [stdout] | [INFO] [stdout] 634 | #[cfg(any(target_os = "windows"))] [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `target_os = "windows"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_minimal_cfg [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded sub `cfg` when there is only one condition [INFO] [stdout] --> src/utils.rs:83:7 [INFO] [stdout] | [INFO] [stdout] 83 | #[cfg(any(target_os = "macos"))] [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `target_os = "macos"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_minimal_cfg [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded sub `cfg` when there is only one condition [INFO] [stdout] --> src/args.rs:322:11 [INFO] [stdout] | [INFO] [stdout] 322 | #[cfg(any(target_os = "linux"))] [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `target_os = "linux"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_minimal_cfg [INFO] [stdout] = note: `#[warn(clippy::non_minimal_cfg)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded sub `cfg` when there is only one condition [INFO] [stdout] --> src/args.rs:609:11 [INFO] [stdout] | [INFO] [stdout] 609 | #[cfg(any(target_os = "linux"))] [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `target_os = "linux"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_minimal_cfg [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded sub `cfg` when there is only one condition [INFO] [stdout] --> src/args.rs:621:11 [INFO] [stdout] | [INFO] [stdout] 621 | #[cfg(any(target_os = "macos"))] [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `target_os = "macos"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_minimal_cfg [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded sub `cfg` when there is only one condition [INFO] [stdout] --> src/args.rs:634:11 [INFO] [stdout] | [INFO] [stdout] 634 | #[cfg(any(target_os = "windows"))] [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `target_os = "windows"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_minimal_cfg [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded sub `cfg` when there is only one condition [INFO] [stdout] --> src/utils.rs:83:7 [INFO] [stdout] | [INFO] [stdout] 83 | #[cfg(any(target_os = "macos"))] [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `target_os = "macos"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_minimal_cfg [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this import is redundant [INFO] [stdout] --> src/main.rs:7:1 [INFO] [stdout] | [INFO] [stdout] 7 | use env_logger; [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: this import is redundant [INFO] [stdout] --> src/scrun.rs:10:1 [INFO] [stdout] | [INFO] [stdout] 10 | use serde_yaml; [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] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit expression [INFO] [stdout] --> src/scrun.rs:95:5 [INFO] [stdout] | [INFO] [stdout] 95 | () [INFO] [stdout] | ^^ help: remove the final `()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stdout] = note: `#[warn(clippy::unused_unit)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/common.rs:150:9 [INFO] [stdout] | [INFO] [stdout] 150 | version: version, [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace it with: `version` [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: this import is redundant [INFO] [stdout] --> src/main.rs:7:1 [INFO] [stdout] | [INFO] [stdout] 7 | use env_logger; [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: this import is redundant [INFO] [stdout] --> src/scrun.rs:10:1 [INFO] [stdout] | [INFO] [stdout] 10 | use serde_yaml; [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] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit expression [INFO] [stdout] --> src/scrun.rs:95:5 [INFO] [stdout] | [INFO] [stdout] 95 | () [INFO] [stdout] | ^^ help: remove the final `()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stdout] = note: `#[warn(clippy::unused_unit)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/dcf/mod.rs:339:13 [INFO] [stdout] | [INFO] [stdout] 339 | r: r, [INFO] [stdout] | ^^^^ help: replace it with: `r` [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/library.rs:248:9 [INFO] [stdout] | [INFO] [stdout] 248 | name: name, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `name` [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/common.rs:150:9 [INFO] [stdout] | [INFO] [stdout] 150 | version: version, [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace it with: `version` [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/dcf/mod.rs:339:13 [INFO] [stdout] | [INFO] [stdout] 339 | r: r, [INFO] [stdout] | ^^^^ help: replace it with: `r` [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/resolve.rs:104:9 [INFO] [stdout] | [INFO] [stdout] 104 | ppm: ppm, [INFO] [stdout] | ^^^^^^^^ help: replace it with: `ppm` [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/resolve.rs:105:9 [INFO] [stdout] | [INFO] [stdout] 105 | ppmurl: ppmurl, [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace it with: `ppmurl` [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/library.rs:248:9 [INFO] [stdout] | [INFO] [stdout] 248 | name: name, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `name` [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/resolve.rs:104:9 [INFO] [stdout] | [INFO] [stdout] 104 | ppm: ppm, [INFO] [stdout] | ^^^^^^^^ help: replace it with: `ppm` [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/resolve.rs:105:9 [INFO] [stdout] | [INFO] [stdout] 105 | ppmurl: ppmurl, [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace it with: `ppmurl` [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: the borrowed expression implements the required traits [INFO] [stdout] --> src/args.rs:87:18 [INFO] [stdout] | [INFO] [stdout] 87 | .aliases(&["switch"]) [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `["switch"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/args.rs:104:18 [INFO] [stdout] | [INFO] [stdout] 104 | .aliases(&["ls"]) [INFO] [stdout] | ^^^^^^^ help: change this to: `["ls"]` [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/args.rs:128:18 [INFO] [stdout] | [INFO] [stdout] 128 | .aliases(&["install"]); [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `["install"]` [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/args.rs:147:37 [INFO] [stdout] | [INFO] [stdout] 147 | .conflicts_with_all(&["without-cran-mirror", "without-p3m"]), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["without-cran-mirror", "without-p3m"]` [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/args.rs:162:37 [INFO] [stdout] | [INFO] [stdout] 162 | .conflicts_with_all(&["without-cran-mirror", "without-p3m"]), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["without-cran-mirror", "without-p3m"]` [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/args.rs:173:37 [INFO] [stdout] | [INFO] [stdout] 173 | .conflicts_with_all(&["with-repos", "without-repos"]), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["with-repos", "without-repos"]` [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/args.rs:177:26 [INFO] [stdout] | [INFO] [stdout] 177 | .aliases(&["without-rspm"]) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: change this to: `["without-rspm"]` [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/args.rs:186:37 [INFO] [stdout] | [INFO] [stdout] 186 | .conflicts_with_all(&["with-repos", "without-repos"]), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["with-repos", "without-repos"]` [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/args.rs:264:18 [INFO] [stdout] | [INFO] [stdout] 264 | .aliases(&["del", "remove", "delete"]) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["del", "remove", "delete"]` [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/args.rs:375:18 [INFO] [stdout] | [INFO] [stdout] 375 | .aliases(&["create-lib"]) [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: change this to: `["create-lib"]` [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/args.rs:679:18 [INFO] [stdout] | [INFO] [stdout] 679 | .aliases(&["lib"]) [INFO] [stdout] | ^^^^^^^^ help: change this to: `["lib"]` [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/args.rs:690:26 [INFO] [stdout] | [INFO] [stdout] 690 | .aliases(&["ls"]) [INFO] [stdout] | ^^^^^^^ help: change this to: `["ls"]` [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: called `unwrap` on `eval` after checking its variant with `is_some` [INFO] [stdout] --> src/scrun.rs:55:41 [INFO] [stdout] | [INFO] [stdout] 54 | if eval.is_some() { [INFO] [stdout] | ----------------- help: try: `if let Some() = eval` [INFO] [stdout] 55 | return sc_run_eval(rbin, rargs, eval.unwrap().to_string(), cmdargs, dry_run); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/scrun.rs:55:9 [INFO] [stdout] | [INFO] [stdout] 55 | return sc_run_eval(rbin, rargs, eval.unwrap().to_string(), cmdargs, dry_run); [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] 55 - return sc_run_eval(rbin, rargs, eval.unwrap().to_string(), cmdargs, dry_run); [INFO] [stdout] 55 + sc_run_eval(rbin, rargs, eval.unwrap().to_string(), cmdargs, dry_run) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/scrun.rs:57:9 [INFO] [stdout] | [INFO] [stdout] 57 | return sc_run_script(rbin, rargs, script.unwrap().to_string(), cmdargs, dry_run); [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] 57 - return sc_run_script(rbin, rargs, script.unwrap().to_string(), cmdargs, dry_run); [INFO] [stdout] 57 + sc_run_script(rbin, rargs, script.unwrap().to_string(), cmdargs, dry_run) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/scrun.rs:65:13 [INFO] [stdout] | [INFO] [stdout] 65 | return sc_run_package_script(rbin, rargs, cmdargs, dry_run); [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] 65 - return sc_run_package_script(rbin, rargs, cmdargs, dry_run); [INFO] [stdout] 65 + sc_run_package_script(rbin, rargs, cmdargs, dry_run) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/scrun.rs:67:13 [INFO] [stdout] | [INFO] [stdout] 67 | return sc_run_app(rbin, rargs, cmdargs, app_type, dry_run); [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] 67 - return sc_run_app(rbin, rargs, cmdargs, app_type, dry_run); [INFO] [stdout] 67 + sc_run_app(rbin, rargs, cmdargs, app_type, dry_run) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/scrun.rs:78:9 [INFO] [stdout] | [INFO] [stdout] 78 | return sc_run_rver(rbin, rargs, cmdargs, dry_run); [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] 78 - return sc_run_rver(rbin, rargs, cmdargs, dry_run); [INFO] [stdout] 78 + sc_run_rver(rbin, rargs, cmdargs, dry_run) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/scrun.rs:58:15 [INFO] [stdout] | [INFO] [stdout] 58 | } else if cmdargs.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!cmdargs.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: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/scrun.rs:88:14 [INFO] [stdout] | [INFO] [stdout] 88 | e.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] = note: `#[warn(clippy::to_string_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `warn!` args [INFO] [stdout] --> src/scrun.rs:92:14 [INFO] [stdout] | [INFO] [stdout] 92 | e.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/scrun.rs:209:24 [INFO] [stdout] | [INFO] [stdout] 209 | Ok(x) => x.map(|x| utf8_file_name(x)).collect(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `utf8_file_name` [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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/scrun.rs:270:12 [INFO] [stdout] | [INFO] [stdout] 270 | files: &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] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 270 - files: &Vec, [INFO] [stdout] 270 + files: &[String], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/scrun.rs:283:8 [INFO] [stdout] | [INFO] [stdout] 283 | if idxs.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `idxs.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: length comparison to zero [INFO] [stdout] --> src/scrun.rs:293:12 [INFO] [stdout] | [INFO] [stdout] 293 | if idxs.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `idxs.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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/scrun.rs:315:42 [INFO] [stdout] | [INFO] [stdout] 315 | fn detect_app_type(project: &str, files: &Vec) -> 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] 315 - fn detect_app_type(project: &str, files: &Vec) -> Result> { [INFO] [stdout] 315 + fn detect_app_type(project: &str, files: &[String]) -> Result> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/scrun.rs:336:23 [INFO] [stdout] | [INFO] [stdout] 336 | let uses_quarto = qmds.len() > 0 || (quartoyml && rmds.len() > 0); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!qmds.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: length comparison to zero [INFO] [stdout] --> src/scrun.rs:336:55 [INFO] [stdout] | [INFO] [stdout] 336 | let uses_quarto = qmds.len() > 0 || (quartoyml && rmds.len() > 0); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!rmds.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/scrun.rs:340:25 [INFO] [stdout] | [INFO] [stdout] 340 | if is_shiny_rmd(&project, rmd)? { [INFO] [stdout] | ^^^^^^^^ help: change this to: `project` [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/scrun.rs:347:25 [INFO] [stdout] | [INFO] [stdout] 347 | if is_shiny_rmd(&project, qmd)? { [INFO] [stdout] | ^^^^^^^^ help: change this to: `project` [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: length comparison to zero [INFO] [stdout] --> src/scrun.rs:369:8 [INFO] [stdout] | [INFO] [stdout] 369 | if rmds.len() > 0 || qmds.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!rmds.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: length comparison to zero [INFO] [stdout] --> src/scrun.rs:369:26 [INFO] [stdout] | [INFO] [stdout] 369 | if rmds.len() > 0 || qmds.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!qmds.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: called `unwrap` on `rt` after checking its variant with `is_some` [INFO] [stdout] --> src/scrun.rs:403:23 [INFO] [stdout] | [INFO] [stdout] 402 | if rt.is_some() { [INFO] [stdout] | --------------- help: try: `if let Some() = rt` [INFO] [stdout] 403 | let rt2 = rt.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `sv` after checking its variant with `is_some` [INFO] [stdout] --> src/scrun.rs:410:23 [INFO] [stdout] | [INFO] [stdout] 409 | if sv.is_some() { [INFO] [stdout] | --------------- help: try: `if let Some() = sv` [INFO] [stdout] 410 | let sv2 = sv.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `sv3` after checking its variant with `is_some` [INFO] [stdout] --> src/scrun.rs:416:31 [INFO] [stdout] | [INFO] [stdout] 415 | if sv3.is_some() { [INFO] [stdout] | ---------------- help: try: `if let Some() = sv3` [INFO] [stdout] 416 | let sv4 = sv3.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/scrun.rs:432:67 [INFO] [stdout] | [INFO] [stdout] 432 | if runtime.is_some() && runtime.unwrap().starts_with("shiny") { [INFO] [stdout] | ___________________________________________________________________^ [INFO] [stdout] 433 | | Ok(true) [INFO] [stdout] 434 | | } else if server.is_some() && server.unwrap() == "Shiny" { [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/scrun.rs:434:62 [INFO] [stdout] | [INFO] [stdout] 434 | } else if server.is_some() && server.unwrap() == "Shiny" { [INFO] [stdout] | ______________________________________________________________^ [INFO] [stdout] 435 | | Ok(true) [INFO] [stdout] 436 | | } else { [INFO] [stdout] | |_____^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] = note: `#[warn(clippy::if_same_then_else)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/scrun.rs:533:51 [INFO] [stdout] | [INFO] [stdout] 533 | if start_lines && re_line.is_match(&line) { [INFO] [stdout] | ___________________________________________________^ [INFO] [stdout] 534 | | trace!("End of YAML header"); [INFO] [stdout] 535 | | break; [INFO] [stdout] 536 | | } else if !start_lines && re_dots.is_match(&line) { [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/scrun.rs:536:59 [INFO] [stdout] | [INFO] [stdout] 536 | } else if !start_lines && re_dots.is_match(&line) { [INFO] [stdout] | ___________________________________________________________^ [INFO] [stdout] 537 | | trace!("End of YAML header"); [INFO] [stdout] 538 | | break; [INFO] [stdout] 539 | | } else { [INFO] [stdout] | |_________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/scrun.rs:542:13 [INFO] [stdout] | [INFO] [stdout] 542 | header.push_str("\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `header.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: unnecessary closure used to substitute value for `Option::None` [INFO] [stdout] --> src/linux.rs:89:20 [INFO] [stdout] | [INFO] [stdout] 89 | let filename = basename(&url).unwrap_or_else(|| "foo"); [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] 89 - let filename = basename(&url).unwrap_or_else(|| "foo"); [INFO] [stdout] 89 + let filename = basename(&url).unwrap_or("foo"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/linux.rs:91:31 [INFO] [stdout] | [INFO] [stdout] 91 | let target = tmp_dir.join(&filename); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `filename` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/linux.rs:99:37 [INFO] [stdout] | [INFO] [stdout] 99 | download_file(client, &url, &target.as_os_str())?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: change this to: `target.as_os_str()` [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 late initialization [INFO] [stdout] --> src/linux.rs:102:5 [INFO] [stdout] | [INFO] [stdout] 102 | let dirname; [INFO] [stdout] | ^^^^^^^^^^^^ created here [INFO] [stdout] 103 | dirname = add_package(target.as_os_str(), &platform)?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ initialised here [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] = note: `#[warn(clippy::needless_late_init)]` on by default [INFO] [stdout] help: move the declaration `dirname` here [INFO] [stdout] | [INFO] [stdout] 102 ~ [INFO] [stdout] 103 ~ let dirname = add_package(target.as_os_str(), &platform)?; [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/linux.rs:110:5 [INFO] [stdout] | [INFO] [stdout] 110 | / match alias { [INFO] [stdout] 111 | | Some(alias) => add_alias(&dirname, &alias)?, [INFO] [stdout] 112 | | None => {} [INFO] [stdout] 113 | | }; [INFO] [stdout] | |_____^ help: try: `if let Some(alias) = alias { add_alias(&dirname, &alias)? }` [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: this `map_or` can be simplified [INFO] [stdout] --> src/linux.rs:184:16 [INFO] [stdout] | [INFO] [stdout] 184 | || platform [INFO] [stdout] | ________________^ [INFO] [stdout] 185 | | .version [INFO] [stdout] 186 | | .as_ref() [INFO] [stdout] 187 | | .map_or(false, |v| v.starts_with("7."))) [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] 187 - .map_or(false, |v| v.starts_with("7."))) [INFO] [stdout] 187 + .is_some_and(|v| v.starts_with("7."))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/linux.rs:201:16 [INFO] [stdout] | [INFO] [stdout] 201 | || platform [INFO] [stdout] | ________________^ [INFO] [stdout] 202 | | .version [INFO] [stdout] 203 | | .as_ref() [INFO] [stdout] 204 | | .map_or(false, |v| v.starts_with("7."))) [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] 204 - .map_or(false, |v| v.starts_with("7."))) [INFO] [stdout] 204 + .is_some_and(|v| v.starts_with("7."))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/linux.rs:223:16 [INFO] [stdout] | [INFO] [stdout] 223 | || platform [INFO] [stdout] | ________________^ [INFO] [stdout] 224 | | .version [INFO] [stdout] 225 | | .as_ref() [INFO] [stdout] 226 | | .map_or(false, |v| v.starts_with("8."))) [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] 226 - .map_or(false, |v| v.starts_with("8."))) [INFO] [stdout] 226 + .is_some_and(|v| v.starts_with("8."))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/linux.rs:238:16 [INFO] [stdout] | [INFO] [stdout] 238 | || platform [INFO] [stdout] | ________________^ [INFO] [stdout] 239 | | .version [INFO] [stdout] 240 | | .as_ref() [INFO] [stdout] 241 | | .map_or(false, |v| v.starts_with("9."))) [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] 241 - .map_or(false, |v| v.starts_with("9."))) [INFO] [stdout] 241 + .is_some_and(|v| v.starts_with("9."))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/linux.rs:257:16 [INFO] [stdout] | [INFO] [stdout] 257 | || platform [INFO] [stdout] | ________________^ [INFO] [stdout] 258 | | .version [INFO] [stdout] 259 | | .as_ref() [INFO] [stdout] 260 | | .map_or(false, |v| v.starts_with("9."))) [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] 260 - .map_or(false, |v| v.starts_with("9."))) [INFO] [stdout] 260 + .is_some_and(|v| v.starts_with("9."))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/linux.rs:413:24 [INFO] [stdout] | [INFO] [stdout] 413 | if re.is_match(&fnamestr) { [INFO] [stdout] | ^^^^^^^^^ help: change this to: `fnamestr` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/linux.rs:423:25 [INFO] [stdout] | [INFO] [stdout] 423 | / match std::fs::remove_file(&path) { [INFO] [stdout] 424 | | Err(err) => { [INFO] [stdout] 425 | | OUTPUT.warn(&format!( [INFO] [stdout] 426 | | "Failed to remove {}: {}", [INFO] [stdout] ... | [INFO] [stdout] 432 | | _ => {} [INFO] [stdout] 433 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 423 ~ if let Err(err) = std::fs::remove_file(&path) { [INFO] [stdout] 424 + OUTPUT.warn(&format!( [INFO] [stdout] 425 + "Failed to remove {}: {}", [INFO] [stdout] 426 + path.display(), [INFO] [stdout] 427 + err.to_string() [INFO] [stdout] 428 + )); [INFO] [stdout] 429 + warn!("Failed to remove {}: {}", path.display(), err.to_string()) [INFO] [stdout] 430 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/linux.rs:428:40 [INFO] [stdout] | [INFO] [stdout] 428 | ... err.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `warn!` args [INFO] [stdout] --> src/linux.rs:430:85 [INFO] [stdout] | [INFO] [stdout] 430 | ... warn!("Failed to remove {}: {}", path.display(), err.to_string()) [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/linux.rs:444:5 [INFO] [stdout] | [INFO] [stdout] 443 | let re = Regex::new("^R-(release|oldrel)$").unwrap(); [INFO] [stdout] | ----------------------------------------------------- unnecessary `let` binding [INFO] [stdout] 444 | re [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 443 ~ [INFO] [stdout] 444 ~ Regex::new("^R-(release|oldrel)$").unwrap() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/linux.rs:466:24 [INFO] [stdout] | [INFO] [stdout] 466 | if re.is_match(&fnamestr) { [INFO] [stdout] | ^^^^^^^^^ help: change this to: `fnamestr` [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: returning the result of a `let` binding from a block [INFO] [stdout] --> src/linux.rs:510:5 [INFO] [stdout] | [INFO] [stdout] 505 | / let s = match osver { [INFO] [stdout] 506 | | None => None, [INFO] [stdout] 507 | | Some(os) => os.into_string().ok(), [INFO] [stdout] 508 | | }; [INFO] [stdout] | |______- unnecessary `let` binding [INFO] [stdout] 509 | [INFO] [stdout] 510 | s [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 505 ~ [INFO] [stdout] 506 | [INFO] [stdout] 507 ~ match osver { [INFO] [stdout] 508 + None => None, [INFO] [stdout] 509 + Some(os) => os.into_string().ok(), [INFO] [stdout] 510 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/linux.rs:496:17 [INFO] [stdout] | [INFO] [stdout] 496 | let osver = match pb [INFO] [stdout] | _________________^ [INFO] [stdout] 497 | | .parent() [INFO] [stdout] 498 | | .and_then(|x| x.parent()) [INFO] [stdout] 499 | | .and_then(|x| x.file_name()) [INFO] [stdout] ... | [INFO] [stdout] 502 | | Some(s) => Some(s.to_os_string()), [INFO] [stdout] 503 | | }; [INFO] [stdout] | |_____^ [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] help: try [INFO] [stdout] | [INFO] [stdout] 496 ~ let osver = pb [INFO] [stdout] 497 + .parent() [INFO] [stdout] 498 + .and_then(|x| x.parent()) [INFO] [stdout] 499 ~ .and_then(|x| x.file_name()).map(|s| s.to_os_string()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/linux.rs:571:32 [INFO] [stdout] | [INFO] [stdout] 571 | std::os::unix::fs::symlink(&cr, &r)?; [INFO] [stdout] | ^^^ help: change this to: `cr` [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/linux.rs:571:37 [INFO] [stdout] | [INFO] [stdout] 571 | std::os::unix::fs::symlink(&cr, &r)?; [INFO] [stdout] | ^^ help: change this to: `r` [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/linux.rs:581:32 [INFO] [stdout] | [INFO] [stdout] 581 | std::os::unix::fs::symlink(&crs, &rs)?; [INFO] [stdout] | ^^^^ help: change this to: `crs` [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/linux.rs:581:38 [INFO] [stdout] | [INFO] [stdout] 581 | std::os::unix::fs::symlink(&crs, &rs)?; [INFO] [stdout] | ^^^ help: change this to: `rs` [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: unnecessary use of `to_string` [INFO] [stdout] --> src/linux.rs:606:33 [INFO] [stdout] | [INFO] [stdout] 606 | let profile = path.join("lib/R/library/base/R/Rprofile".to_string()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `"lib/R/library/base/R/Rprofile"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] = note: `#[warn(clippy::unnecessary_to_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/linux.rs:761:8 [INFO] [stdout] | [INFO] [stdout] 761 | if idx_sed.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `idx_sed.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: unneeded `return` statement [INFO] [stdout] --> src/linux.rs:779:13 [INFO] [stdout] | [INFO] [stdout] 779 | return; [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] 778 ~ debug!("SSL_CERT_FILE is already set, keeping it."); [INFO] [stdout] 779 | } [INFO] [stdout] ... [INFO] [stdout] 792 | } [INFO] [stdout] 793 ~ } [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/alias.rs:210:21 [INFO] [stdout] | [INFO] [stdout] 210 | / match std::fs::remove_file(&linkfile) { [INFO] [stdout] 211 | | Err(err) => { [INFO] [stdout] 212 | | OUTPUT.error(&format!( [INFO] [stdout] 213 | | "Failed to delete {}, cannot update alias: {}", [INFO] [stdout] ... | [INFO] [stdout] 228 | | _ => {} [INFO] [stdout] 229 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 210 ~ if let Err(err) = std::fs::remove_file(&linkfile) { [INFO] [stdout] 211 + OUTPUT.error(&format!( [INFO] [stdout] 212 + "Failed to delete {}, cannot update alias: {}", [INFO] [stdout] 213 + linkfile.display(), [INFO] [stdout] 214 + err.to_string() [INFO] [stdout] 215 + )); [INFO] [stdout] 216 + error!( [INFO] [stdout] 217 + "Failed to delete {}, cannot update alias: {}", [INFO] [stdout] 218 + linkfile.display(), [INFO] [stdout] 219 + err.to_string() [INFO] [stdout] 220 + ); [INFO] [stdout] 221 + bail!( [INFO] [stdout] 222 + "Failed to delete {}, cannot update alias: {}", [INFO] [stdout] 223 + linkfile.display(), [INFO] [stdout] 224 + err.to_string() [INFO] [stdout] 225 + ); [INFO] [stdout] 226 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/alias.rs:215:36 [INFO] [stdout] | [INFO] [stdout] 215 | ... err.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `error!` args [INFO] [stdout] --> src/alias.rs:220:36 [INFO] [stdout] | [INFO] [stdout] 220 | ... err.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [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/alias.rs:237:5 [INFO] [stdout] | [INFO] [stdout] 237 | / match symlink(&target, &linkfile) { [INFO] [stdout] 238 | | Err(err) => { [INFO] [stdout] 239 | | OUTPUT.error(&format!( [INFO] [stdout] 240 | | "Cannot create alias {}: {}", [INFO] [stdout] ... | [INFO] [stdout] 255 | | _ => {} [INFO] [stdout] 256 | | }; [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 237 ~ if let Err(err) = symlink(&target, &linkfile) { [INFO] [stdout] 238 + OUTPUT.error(&format!( [INFO] [stdout] 239 + "Cannot create alias {}: {}", [INFO] [stdout] 240 + linkfile.display(), [INFO] [stdout] 241 + err.to_string() [INFO] [stdout] 242 + )); [INFO] [stdout] 243 + error!( [INFO] [stdout] 244 + "Cannot create alias {}: {}", [INFO] [stdout] 245 + linkfile.display(), [INFO] [stdout] 246 + err.to_string() [INFO] [stdout] 247 + ); [INFO] [stdout] 248 + bail!( [INFO] [stdout] 249 + "Cannot create alias {}: {}", [INFO] [stdout] 250 + linkfile.display(), [INFO] [stdout] 251 + err.to_string() [INFO] [stdout] 252 + ) [INFO] [stdout] 253 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/alias.rs:242:20 [INFO] [stdout] | [INFO] [stdout] 242 | err.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `error!` args [INFO] [stdout] --> src/alias.rs:247:20 [INFO] [stdout] | [INFO] [stdout] 247 | err.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match can be simplified with `.unwrap_or_default()` [INFO] [stdout] --> src/common.rs:89:25 [INFO] [stdout] | [INFO] [stdout] 89 | let lines = match read_lines(&desc) { [INFO] [stdout] | _________________________^ [INFO] [stdout] 90 | | Ok(x) => x, [INFO] [stdout] 91 | | Err(_) => vec![], [INFO] [stdout] 92 | | }; [INFO] [stdout] | |_____________^ help: replace it with: `read_lines(&desc).unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default [INFO] [stdout] = note: `#[warn(clippy::manual_unwrap_or_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/common.rs:94:46 [INFO] [stdout] | [INFO] [stdout] 94 | let version: Option = if idx.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `idx.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: match can be simplified with `.unwrap_or_default()` [INFO] [stdout] --> src/common.rs:112:17 [INFO] [stdout] | [INFO] [stdout] 112 | let lines = match read_lines(&desc) { [INFO] [stdout] | _________________^ [INFO] [stdout] 113 | | Ok(x) => x, [INFO] [stdout] 114 | | Err(_) => vec![], [INFO] [stdout] 115 | | }; [INFO] [stdout] | |_____^ help: replace it with: `read_lines(&desc).unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/common.rs:117:8 [INFO] [stdout] | [INFO] [stdout] 117 | if idx.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `idx.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: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/common.rs:151:15 [INFO] [stdout] | [INFO] [stdout] 151 | path: path.to_str().and_then(|x| Some(x.to_string())), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `path.to_str().map(|x| x.to_string())` [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: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/common.rs:152:17 [INFO] [stdout] | [INFO] [stdout] 152 | binary: binary.to_str().and_then(|x| Some(x.to_string())), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `binary.to_str().map(|x| x.to_string())` [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] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/common.rs:172:27 [INFO] [stdout] | [INFO] [stdout] 172 | pub fn check_has_pak(ver: &String) -> 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] 172 - pub fn check_has_pak(ver: &String) -> Result> { [INFO] [stdout] 172 + pub fn check_has_pak(ver: &str) -> Result> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/common.rs:179:9 [INFO] [stdout] | [INFO] [stdout] 179 | ver = ver + ".0"; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace it with: `ver += ".0"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/common.rs:213:9 [INFO] [stdout] | [INFO] [stdout] 213 | let msg; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `msg` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 213 ~ [INFO] [stdout] 214 ~ let msg = if update { [INFO] [stdout] 215 ~ format!("Updating pak for R {}", ver) [INFO] [stdout] 216 | } else { [INFO] [stdout] 217 ~ format!("Installing pak for R {} (if not installed yet)", ver) [INFO] [stdout] 218 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/common.rs:232:22 [INFO] [stdout] | [INFO] [stdout] 232 | x.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `error!` args [INFO] [stdout] --> src/common.rs:234:71 [INFO] [stdout] | [INFO] [stdout] 234 | error!("Failed to to install pak for R {}: {}", ver, x.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/common.rs:240:9 [INFO] [stdout] | [INFO] [stdout] 240 | let cmd; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `cmd` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 240 ~ [INFO] [stdout] 241 ~ let cmd = if update { [INFO] [stdout] 242 ~ r#" [INFO] [stdout] 243 | install.packages('pak', repos = sprintf('https://r-lib.github.io/p/pak/{}/%s/%s/%s', .Platform$pkgType, R.Version()$os, R.Version()$arch)) [INFO] [stdout] 244 ~ "# [INFO] [stdout] 245 | } else { [INFO] [stdout] 246 ~ r#" [INFO] [stdout] 247 | if (!requireNamespace('pak', quietly = TRUE)) { [INFO] [stdout] 248 | install.packages('pak', repos = sprintf('https://r-lib.github.io/p/pak/{}/%s/%s/%s', .Platform$pkgType, R.Version()$os, R.Version()$arch)) [INFO] [stdout] 249 | } [INFO] [stdout] 250 ~ "# [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/common.rs:260:22 [INFO] [stdout] | [INFO] [stdout] 260 | x.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `error!` args [INFO] [stdout] --> src/common.rs:262:68 [INFO] [stdout] | [INFO] [stdout] 262 | error!("Failed to install pak for R {}: {}", ver, x.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/common.rs:285:24 [INFO] [stdout] | [INFO] [stdout] 285 | if re.is_match(&pathstr) { [INFO] [stdout] | ^^^^^^^^ help: change this to: `pathstr` [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: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/common.rs:330:20 [INFO] [stdout] | [INFO] [stdout] 330 | prj2 = Some(p.to_string() + "/").and_then(|x| Some(x.to_string())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Some(p.to_string() + "/").map(|x| x.to_string())` [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] [INFO] [stdout] [INFO] [stdout] warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/common.rs:336:20 [INFO] [stdout] | [INFO] [stdout] 336 | prj2 = Some("./".to_string() + p).and_then(|x| Some(x.to_string())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Some("./".to_string() + p).map(|x| x.to_string())` [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] [INFO] [stdout] [INFO] [stdout] warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/common.rs:392:23 [INFO] [stdout] | [INFO] [stdout] 392 | let projstr = proj [INFO] [stdout] | _______________________^ [INFO] [stdout] 393 | | .as_ref() [INFO] [stdout] 394 | | .and_then(|x| x.to_str()) [INFO] [stdout] 395 | | .and_then(|x| Some(x.to_string())); [INFO] [stdout] | |______________________________________________^ [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] help: try [INFO] [stdout] | [INFO] [stdout] 392 ~ let projstr = proj [INFO] [stdout] 393 + .as_ref() [INFO] [stdout] 394 ~ .and_then(|x| x.to_str()).map(|x| x.to_string()); [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/common.rs:437:5 [INFO] [stdout] | [INFO] [stdout] 437 | / match args.try_contains_id("platform") { [INFO] [stdout] 438 | | Ok(_) => { [INFO] [stdout] 439 | | let platform = args.get_one::("platform"); [INFO] [stdout] 440 | | if let Some(x) = platform { [INFO] [stdout] ... | [INFO] [stdout] 444 | | Err(_) => {} [INFO] [stdout] 445 | | }; [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 437 ~ if let Ok(_) = args.try_contains_id("platform") { [INFO] [stdout] 438 + let platform = args.get_one::("platform"); [INFO] [stdout] 439 + if let Some(x) = platform { [INFO] [stdout] 440 + return Ok(x.to_string()); [INFO] [stdout] 441 + } [INFO] [stdout] 442 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/common.rs:517:37 [INFO] [stdout] | [INFO] [stdout] 517 | if !args.get_flag("all") && vers.len() > 0 && new.name != "next" && new.name != "devel" { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!vers.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 use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/common.rs:602:36 [INFO] [stdout] | [INFO] [stdout] 602 | for (_idx, item) in resp.iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index [INFO] [stdout] = note: `#[warn(clippy::unused_enumerate_index)]` on by default [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 602 - for (_idx, item) in resp.iter().enumerate() { [INFO] [stdout] 602 + for item in resp.iter() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match can be simplified with `.unwrap_or_default()` [INFO] [stdout] --> src/common.rs:611:23 [INFO] [stdout] | [INFO] [stdout] 611 | let ppm = match item["ppm-binaries"].as_bool() { [INFO] [stdout] | _______________________^ [INFO] [stdout] 612 | | Some(v) => v, [INFO] [stdout] 613 | | None => false, [INFO] [stdout] 614 | | }; [INFO] [stdout] | |_____________^ help: ascribe the type bool and replace your expression with: `item["ppm-binaries"].as_bool().unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match can be simplified with `.unwrap_or_default()` [INFO] [stdout] --> src/common.rs:615:27 [INFO] [stdout] | [INFO] [stdout] 615 | let retired = match item["retired"].as_bool() { [INFO] [stdout] | ___________________________^ [INFO] [stdout] 616 | | Some(v) => v, [INFO] [stdout] 617 | | None => false, [INFO] [stdout] 618 | | }; [INFO] [stdout] | |_____________^ help: ascribe the type bool and replace your expression with: `item["retired"].as_bool().unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/common.rs:619:24 [INFO] [stdout] | [INFO] [stdout] 619 | let last = match item["last-build"].as_str() { [INFO] [stdout] | ________________________^ [INFO] [stdout] 620 | | Some(s) => Some(s.to_string()), [INFO] [stdout] 621 | | None => None, [INFO] [stdout] 622 | | }; [INFO] [stdout] | |_____________^ help: try: `item["last-build"].as_str().map(|s| s.to_string())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [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/common.rs:637:13 [INFO] [stdout] | [INFO] [stdout] 637 | / match alias { [INFO] [stdout] 638 | | Some(alias2) => { [INFO] [stdout] 639 | | let d = Distro { [INFO] [stdout] 640 | | name, [INFO] [stdout] ... | [INFO] [stdout] 650 | | None => (), [INFO] [stdout] 651 | | }; [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 637 ~ if let Some(alias2) = alias { [INFO] [stdout] 638 + let d = Distro { [INFO] [stdout] 639 + name, [INFO] [stdout] 640 + version, [INFO] [stdout] 641 + id, [INFO] [stdout] 642 + ppm: alias2.ppm, [INFO] [stdout] 643 + retired: alias2.retired, [INFO] [stdout] 644 + eol, [INFO] [stdout] 645 + last: alias2.last.clone(), [INFO] [stdout] 646 + }; [INFO] [stdout] 647 + distros.push(d); [INFO] [stdout] 648 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `!RangeInclusive::contains` implementation [INFO] [stdout] --> src/common.rs:719:33 [INFO] [stdout] | [INFO] [stdout] 719 | Ok(x) => x >= 35 && (x < 210 || x > 215), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: use: `!(210..=215).contains(&x)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] = note: `#[warn(clippy::manual_range_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/config.rs:52:33 [INFO] [stdout] | [INFO] [stdout] 52 | std::fs::create_dir_all(&parent)?; [INFO] [stdout] | ^^^^^^^ help: change this to: `parent` [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: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/config.rs:58:9 [INFO] [stdout] | [INFO] [stdout] 58 | self.userlibrary.get(rver).and_then(|x| Some(x.to_string())) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `self.userlibrary.get(rver).map(|x| x.to_string())` [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] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/config.rs:63:45 [INFO] [stdout] | [INFO] [stdout] 63 | None => self.userlibrary.remove(&rver.to_string()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace it with: `rver` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/dcf/mod.rs:127:23 [INFO] [stdout] | [INFO] [stdout] 127 | let ver = spec[2..].trim(); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/dcf/mod.rs:126:46 [INFO] [stdout] | [INFO] [stdout] 126 | let (constraint_type, version_str) = if spec.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] 126 ~ let (constraint_type, version_str) = if let Some() = spec.strip_prefix(">=") { [INFO] [stdout] 127 ~ let ver = .trim(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/dcf/mod.rs:130:23 [INFO] [stdout] | [INFO] [stdout] 130 | let ver = spec[2..].trim(); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/dcf/mod.rs:129:16 [INFO] [stdout] | [INFO] [stdout] 129 | } else if spec.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] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 129 ~ } else if let Some() = spec.strip_prefix("<=") { [INFO] [stdout] 130 ~ let ver = .trim(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/dcf/mod.rs:133:23 [INFO] [stdout] | [INFO] [stdout] 133 | let ver = spec[2..].trim(); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/dcf/mod.rs:132:16 [INFO] [stdout] | [INFO] [stdout] 132 | } else if spec.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] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 132 ~ } else if let Some() = spec.strip_prefix("==") { [INFO] [stdout] 133 ~ let ver = .trim(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/dcf/mod.rs:136:23 [INFO] [stdout] | [INFO] [stdout] 136 | let ver = spec[1..].trim(); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/dcf/mod.rs:135:16 [INFO] [stdout] | [INFO] [stdout] 135 | } else if spec.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] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 135 ~ } else if let Some() = spec.strip_prefix('=') { [INFO] [stdout] 136 ~ let ver = .trim(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/dcf/mod.rs:139:23 [INFO] [stdout] | [INFO] [stdout] 139 | let ver = spec[2..].trim(); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/dcf/mod.rs:138:16 [INFO] [stdout] | [INFO] [stdout] 138 | } else if spec.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] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 138 ~ } else if let Some() = spec.strip_prefix(">>") { [INFO] [stdout] 139 ~ let ver = .trim(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/dcf/mod.rs:142:23 [INFO] [stdout] | [INFO] [stdout] 142 | let ver = spec[1..].trim(); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/dcf/mod.rs:141:16 [INFO] [stdout] | [INFO] [stdout] 141 | } else if spec.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] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 141 ~ } else if let Some() = spec.strip_prefix('>') { [INFO] [stdout] 142 ~ let ver = .trim(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/dcf/mod.rs:145:23 [INFO] [stdout] | [INFO] [stdout] 145 | let ver = spec[2..].trim(); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/dcf/mod.rs:144:16 [INFO] [stdout] | [INFO] [stdout] 144 | } else if spec.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] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 144 ~ } else if let Some() = spec.strip_prefix("<<") { [INFO] [stdout] 145 ~ let ver = .trim(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/dcf/mod.rs:148:23 [INFO] [stdout] | [INFO] [stdout] 148 | let ver = spec[1..].trim(); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/dcf/mod.rs:147:16 [INFO] [stdout] | [INFO] [stdout] 147 | } else if spec.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] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 147 ~ } else if let Some() = spec.strip_prefix('<') { [INFO] [stdout] 148 ~ let ver = .trim(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/dcf/mod.rs:189:12 [INFO] [stdout] | [INFO] [stdout] 189 | if spec.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!spec.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: length comparison to zero [INFO] [stdout] --> src/dcf/mod.rs:261:16 [INFO] [stdout] | [INFO] [stdout] 261 | if dep.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `dep.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: stripping a prefix manually [INFO] [stdout] --> src/dcf/mod.rs:320:13 [INFO] [stdout] | [INFO] [stdout] 320 | r_part[1..].trim().to_string() [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/dcf/mod.rs:319:17 [INFO] [stdout] | [INFO] [stdout] 319 | let r = if r_part.starts_with('R') { [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] 319 ~ let r = if let Some() = r_part.strip_prefix('R') { [INFO] [stdout] 320 ~ .trim().to_string() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/dcf/mod.rs:420:18 [INFO] [stdout] | [INFO] [stdout] 420 | .map(|b| DCFBuilt::from_str(b)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `DCFBuilt::from_str` [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: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/download.rs:119:67 [INFO] [stdout] | [INFO] [stdout] 119 | OUTPUT.error(&format!("HTTP error at {}: {}", url, err.to_string())); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `error!` args [INFO] [stdout] --> src/download.rs:120:52 [INFO] [stdout] | [INFO] [stdout] 120 | error!("HTTP error at {}: {}", url, err.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/download.rs:127:67 [INFO] [stdout] | [INFO] [stdout] 127 | OUTPUT.error(&format!("HTTP error at {}: {}", url, err.to_string())); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `error!` args [INFO] [stdout] --> src/download.rs:128:52 [INFO] [stdout] | [INFO] [stdout] 128 | error!("HTTP error at {}: {}", url, err.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [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/download.rs:135:5 [INFO] [stdout] | [INFO] [stdout] 135 | / match dir { [INFO] [stdout] 136 | | Some(dir) => { [INFO] [stdout] 137 | | match std::fs::create_dir_all(dir) { [INFO] [stdout] 138 | | Err(err) => { [INFO] [stdout] ... | [INFO] [stdout] 151 | | None => {} [INFO] [stdout] 152 | | }; [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 135 ~ if let Some(dir) = dir { [INFO] [stdout] 136 + match std::fs::create_dir_all(dir) { [INFO] [stdout] 137 + Err(err) => { [INFO] [stdout] 138 + let dir = dir.to_str().unwrap_or_else(|| "???"); [INFO] [stdout] 139 + OUTPUT.error(&format!( [INFO] [stdout] 140 + "Cannot create directory {}: {}", [INFO] [stdout] 141 + dir, [INFO] [stdout] 142 + err.to_string() [INFO] [stdout] 143 + )); [INFO] [stdout] 144 + error!("Cannot create directory {}: {}", dir, err.to_string()); [INFO] [stdout] 145 + bail!("Cannot create directory {}: {}", dir, err.to_string()) [INFO] [stdout] 146 + } [INFO] [stdout] 147 + _ => {} [INFO] [stdout] 148 + }; [INFO] [stdout] 149 ~ }; [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/download.rs:137:13 [INFO] [stdout] | [INFO] [stdout] 137 | / match std::fs::create_dir_all(dir) { [INFO] [stdout] 138 | | Err(err) => { [INFO] [stdout] 139 | | let dir = dir.to_str().unwrap_or_else(|| "???"); [INFO] [stdout] 140 | | OUTPUT.error(&format!( [INFO] [stdout] ... | [INFO] [stdout] 148 | | _ => {} [INFO] [stdout] 149 | | }; [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 137 ~ if let Err(err) = std::fs::create_dir_all(dir) { [INFO] [stdout] 138 + let dir = dir.to_str().unwrap_or_else(|| "???"); [INFO] [stdout] 139 + OUTPUT.error(&format!( [INFO] [stdout] 140 + "Cannot create directory {}: {}", [INFO] [stdout] 141 + dir, [INFO] [stdout] 142 + err.to_string() [INFO] [stdout] 143 + )); [INFO] [stdout] 144 + error!("Cannot create directory {}: {}", dir, err.to_string()); [INFO] [stdout] 145 + bail!("Cannot create directory {}: {}", dir, err.to_string()) [INFO] [stdout] 146 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used to substitute value for `Option::None` [INFO] [stdout] --> src/download.rs:139:31 [INFO] [stdout] | [INFO] [stdout] 139 | let dir = dir.to_str().unwrap_or_else(|| "???"); [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] help: use `unwrap_or` instead [INFO] [stdout] | [INFO] [stdout] 139 - let dir = dir.to_str().unwrap_or_else(|| "???"); [INFO] [stdout] 139 + let dir = dir.to_str().unwrap_or("???"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/download.rs:143:28 [INFO] [stdout] | [INFO] [stdout] 143 | err.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `error!` args [INFO] [stdout] --> src/download.rs:145:70 [INFO] [stdout] | [INFO] [stdout] 145 | error!("Cannot create directory {}: {}", dir, err.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/download.rs:153:29 [INFO] [stdout] | [INFO] [stdout] 153 | let file = File::create(&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: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/download.rs:160:20 [INFO] [stdout] | [INFO] [stdout] 160 | err.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `error!` args [INFO] [stdout] --> src/download.rs:165:20 [INFO] [stdout] | [INFO] [stdout] 165 | err.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/download.rs:180:71 [INFO] [stdout] | [INFO] [stdout] 180 | OUTPUT.error(&format!("HTTP error at {}: {}", url, err.to_string())); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `error!` args [INFO] [stdout] --> src/download.rs:181:56 [INFO] [stdout] | [INFO] [stdout] 181 | error!("HTTP error at {}: {}", url, err.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [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/download.rs:185:9 [INFO] [stdout] | [INFO] [stdout] 185 | / match file.write(&chunk) { [INFO] [stdout] 186 | | Err(err) => { [INFO] [stdout] 187 | | OUTPUT.error(&format!( [INFO] [stdout] 188 | | "Failed to write to file {}: {}", [INFO] [stdout] ... | [INFO] [stdout] 203 | | _ => {} [INFO] [stdout] 204 | | }; [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 185 ~ if let Err(err) = file.write(&chunk) { [INFO] [stdout] 186 + OUTPUT.error(&format!( [INFO] [stdout] 187 + "Failed to write to file {}: {}", [INFO] [stdout] 188 + path.display(), [INFO] [stdout] 189 + err.to_string() [INFO] [stdout] 190 + )); [INFO] [stdout] 191 + error!( [INFO] [stdout] 192 + "Failed to write to file {}: {}", [INFO] [stdout] 193 + path.display(), [INFO] [stdout] 194 + err.to_string() [INFO] [stdout] 195 + ); [INFO] [stdout] 196 + bail!( [INFO] [stdout] 197 + "Failed to write to file {}: {}", [INFO] [stdout] 198 + path.display(), [INFO] [stdout] 199 + err.to_string() [INFO] [stdout] 200 + ) [INFO] [stdout] 201 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/download.rs:190:24 [INFO] [stdout] | [INFO] [stdout] 190 | err.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `error!` args [INFO] [stdout] --> src/download.rs:195:24 [INFO] [stdout] | [INFO] [stdout] 195 | err.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [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/download.rs:207:5 [INFO] [stdout] | [INFO] [stdout] 207 | / match std::fs::rename(Path::new(&path), Path::new(&opath)) { [INFO] [stdout] 208 | | Err(err) => { [INFO] [stdout] 209 | | OUTPUT.error(&format!( [INFO] [stdout] 210 | | "Failed to rename downloaded file: {}", [INFO] [stdout] ... | [INFO] [stdout] 216 | | _ => {} [INFO] [stdout] 217 | | }; [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 207 ~ if let Err(err) = std::fs::rename(Path::new(&path), Path::new(&opath)) { [INFO] [stdout] 208 + OUTPUT.error(&format!( [INFO] [stdout] 209 + "Failed to rename downloaded file: {}", [INFO] [stdout] 210 + err.to_string() [INFO] [stdout] 211 + )); [INFO] [stdout] 212 + error!("Failed to rename downloaded file: {}", err.to_string()); [INFO] [stdout] 213 + bail!("Failed to rename downloaded file: {}", err.to_string()) [INFO] [stdout] 214 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/download.rs:211:20 [INFO] [stdout] | [INFO] [stdout] 211 | err.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `error!` args [INFO] [stdout] --> src/download.rs:213:63 [INFO] [stdout] | [INFO] [stdout] 213 | error!("Failed to rename downloaded file: {}", err.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/download.rs:226:5 [INFO] [stdout] | [INFO] [stdout] 226 | return Ok(resp); [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] 226 - return Ok(resp); [INFO] [stdout] 226 + Ok(resp) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/download.rs:555:68 [INFO] [stdout] | [INFO] [stdout] 555 | OUTPUT.error(&format!("Cannot download JSON: {}", e.to_string())); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `error!` args [INFO] [stdout] --> src/download.rs:556:53 [INFO] [stdout] | [INFO] [stdout] 556 | error!("Cannot download JSON: {}", e.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/install.rs:164:5 [INFO] [stdout] | [INFO] [stdout] 164 | / async fn try_start_packages

( [INFO] [stdout] 165 | | package_map: Arc>, [INFO] [stdout] 166 | | installed: Arc>>, [INFO] [stdout] 167 | | failed: Arc>>, [INFO] [stdout] ... | [INFO] [stdout] 174 | | where [INFO] [stdout] 175 | | P: Fn(&str) + Send + Sync + 'static, [INFO] [stdout] | |____________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] = note: `#[warn(clippy::too_many_arguments)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual arithmetic check found [INFO] [stdout] --> src/install.rs:291:25 [INFO] [stdout] | [INFO] [stdout] 291 | let can_start = if currently_running < max_concurrent { [INFO] [stdout] | _________________________^ [INFO] [stdout] 292 | | max_concurrent - currently_running [INFO] [stdout] 293 | | } else { [INFO] [stdout] 294 | | 0 [INFO] [stdout] 295 | | }; [INFO] [stdout] | |_________^ help: replace it with: `max_concurrent.saturating_sub(currently_running)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_saturating_sub [INFO] [stdout] = note: `#[warn(clippy::implicit_saturating_sub)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/library.rs:198:45 [INFO] [stdout] | [INFO] [stdout] 198 | let _ = std::fs::remove_dir_all(&dir.as_path()); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `dir.as_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: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/library.rs:302:18 [INFO] [stdout] | [INFO] [stdout] 302 | e.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `error!` args [INFO] [stdout] --> src/library.rs:307:18 [INFO] [stdout] | [INFO] [stdout] 307 | e.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/library.rs:320:8 [INFO] [stdout] | [INFO] [stdout] 320 | if idx_start.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `idx_start.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/library.rs:346:39 [INFO] [stdout] | [INFO] [stdout] 346 | let rprofile = get_system_profile(&rver)?; [INFO] [stdout] | ^^^^^ help: change this to: `rver` [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: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/library.rs:353:18 [INFO] [stdout] | [INFO] [stdout] 353 | e.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `error!` args [INFO] [stdout] --> src/library.rs:358:18 [INFO] [stdout] | [INFO] [stdout] 358 | e.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [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/library.rs:421:9 [INFO] [stdout] | [INFO] [stdout] 421 | / match append_to_file(&rprofile, vec![newlines.to_string()]) { [INFO] [stdout] 422 | | Err(e) => { [INFO] [stdout] 423 | | OUTPUT.error(&format!( [INFO] [stdout] 424 | | "Cannot update file {}: {}", [INFO] [stdout] ... | [INFO] [stdout] 441 | | _ => {} [INFO] [stdout] 442 | | }; [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 421 ~ if let Err(e) = append_to_file(&rprofile, vec![newlines.to_string()]) { [INFO] [stdout] 422 + OUTPUT.error(&format!( [INFO] [stdout] 423 + "Cannot update file {}: {}", [INFO] [stdout] 424 + rprofile.display(), [INFO] [stdout] 425 + e.to_string() [INFO] [stdout] 426 + )); [INFO] [stdout] 427 + error!( [INFO] [stdout] 428 + "Cannot update file {}: {}", [INFO] [stdout] 429 + rprofile.display(), [INFO] [stdout] 430 + e.to_string() [INFO] [stdout] 431 + ); [INFO] [stdout] 432 + bail!( [INFO] [stdout] 433 + "Cannot update file {} @{}:{}, {}", [INFO] [stdout] 434 + rprofile.display(), [INFO] [stdout] 435 + file!(), [INFO] [stdout] 436 + line!(), [INFO] [stdout] 437 + e.to_string() [INFO] [stdout] 438 + ); [INFO] [stdout] 439 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/library.rs:426:22 [INFO] [stdout] | [INFO] [stdout] 426 | e.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `error!` args [INFO] [stdout] --> src/library.rs:431:22 [INFO] [stdout] | [INFO] [stdout] 431 | e.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/library.rs:462:18 [INFO] [stdout] | [INFO] [stdout] 462 | e.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `info!` args [INFO] [stdout] --> src/library.rs:466:18 [INFO] [stdout] | [INFO] [stdout] 466 | e.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/library.rs:488:18 [INFO] [stdout] | [INFO] [stdout] 488 | e.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `error!` args [INFO] [stdout] --> src/library.rs:493:18 [INFO] [stdout] | [INFO] [stdout] 493 | e.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/library.rs:504:23 [INFO] [stdout] | [INFO] [stdout] 504 | let def_path = if conf_lines.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!conf_lines.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: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/library.rs:543:20 [INFO] [stdout] | [INFO] [stdout] 543 | err.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `error!` args [INFO] [stdout] --> src/library.rs:548:20 [INFO] [stdout] | [INFO] [stdout] 548 | err.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/library.rs:582:26 [INFO] [stdout] | [INFO] [stdout] 582 | e.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `error!` args [INFO] [stdout] --> src/library.rs:586:26 [INFO] [stdout] | [INFO] [stdout] 586 | e.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/platform.rs:103:13 [INFO] [stdout] | [INFO] [stdout] 103 | id = if wid_line.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `wid_line.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/platform.rs:107:32 [INFO] [stdout] | [INFO] [stdout] 107 | let id = re_id.replace(&id_line, "").to_string(); [INFO] [stdout] | ^^^^^^^^ help: change this to: `id_line` [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: length comparison to zero [INFO] [stdout] --> src/platform.rs:113:14 [INFO] [stdout] | [INFO] [stdout] 113 | ver = if wver_line.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `wver_line.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/platform.rs:117:34 [INFO] [stdout] | [INFO] [stdout] 117 | let ver = re_ver.replace(&ver_line, "").to_string(); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `ver_line` [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: length comparison to zero [INFO] [stdout] --> src/proj.rs:60:8 [INFO] [stdout] | [INFO] [stdout] 60 | if desc.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `desc.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: comparison to empty slice [INFO] [stdout] --> src/proj.rs:136:28 [INFO] [stdout] | [INFO] [stdout] 136 | let comma = if cst == "" { "" } else { ", " }; [INFO] [stdout] | ^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `cst.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: comparison to empty slice [INFO] [stdout] --> src/proj.rs:146:16 [INFO] [stdout] | [INFO] [stdout] 146 | if cst != "" { [INFO] [stdout] | ^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!cst.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: use of `default` to create a unit struct [INFO] [stdout] --> src/proj.rs:211:30 [INFO] [stdout] | [INFO] [stdout] 211 | HashMap::with_hasher(rustc_hash::FxBuildHasher::default()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] = note: `#[warn(clippy::default_constructed_unit_structs)]` on by default [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 211 - HashMap::with_hasher(rustc_hash::FxBuildHasher::default()), [INFO] [stdout] 211 + HashMap::with_hasher(rustc_hash::FxBuildHasher), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `default` to create a unit struct [INFO] [stdout] --> src/proj.rs:219:34 [INFO] [stdout] | [INFO] [stdout] 219 | HashMap::with_hasher(rustc_hash::FxBuildHasher::default()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 219 - HashMap::with_hasher(rustc_hash::FxBuildHasher::default()), [INFO] [stdout] 219 + HashMap::with_hasher(rustc_hash::FxBuildHasher), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `default` to create a unit struct [INFO] [stdout] --> src/proj.rs:260:30 [INFO] [stdout] | [INFO] [stdout] 260 | HashMap::with_hasher(rustc_hash::FxBuildHasher::default()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 260 - HashMap::with_hasher(rustc_hash::FxBuildHasher::default()), [INFO] [stdout] 260 + HashMap::with_hasher(rustc_hash::FxBuildHasher), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `default` to create a unit struct [INFO] [stdout] --> src/proj.rs:268:34 [INFO] [stdout] | [INFO] [stdout] 268 | HashMap::with_hasher(rustc_hash::FxBuildHasher::default()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 268 - HashMap::with_hasher(rustc_hash::FxBuildHasher::default()), [INFO] [stdout] 268 + HashMap::with_hasher(rustc_hash::FxBuildHasher), [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/renv.rs:40:9 [INFO] [stdout] | [INFO] [stdout] 40 | / match ver { [INFO] [stdout] 41 | | InstalledVersion { [INFO] [stdout] 42 | | name: n, [INFO] [stdout] 43 | | version: Some(v), [INFO] [stdout] ... | [INFO] [stdout] 57 | | _ => {} [INFO] [stdout] 58 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 40 ~ if let InstalledVersion { [INFO] [stdout] 41 + name: n, [INFO] [stdout] 42 + version: Some(v), [INFO] [stdout] 43 + path: Some(p), [INFO] [stdout] 44 + binary: Some(b), [INFO] [stdout] 45 + aliases: _, [INFO] [stdout] 46 + } = ver { [INFO] [stdout] 47 + if let Ok(sv) = semver::Version::parse(v) { [INFO] [stdout] 48 + ok.push(OKInstalledVersion { [INFO] [stdout] 49 + name: n.to_string(), [INFO] [stdout] 50 + version: sv, [INFO] [stdout] 51 + path: p.to_string(), [INFO] [stdout] 52 + binary: b.to_string(), [INFO] [stdout] 53 + }); [INFO] [stdout] 54 + } [INFO] [stdout] 55 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/renv.rs:84:5 [INFO] [stdout] | [INFO] [stdout] 84 | let goodvers2: Vec; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `goodvers2` here and remove the assignments from the `match` arms [INFO] [stdout] | [INFO] [stdout] 84 ~ [INFO] [stdout] 85 ~ let goodvers2: Vec = match goodvers.iter().find(|v| v.version.patch == ver.patch) { [INFO] [stdout] 86 | Some(_) => { [INFO] [stdout] 87 ~ goodvers [INFO] [stdout] 88 | .into_iter() [INFO] [stdout] 89 | .filter(|v| v.version.patch == ver.patch) [INFO] [stdout] 90 ~ .collect() [INFO] [stdout] 91 | } [INFO] [stdout] 92 ~ None => goodvers, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/renv.rs:96:5 [INFO] [stdout] | [INFO] [stdout] 96 | let goodvers3: Vec; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `goodvers3` here and remove the assignments from the `match` arms [INFO] [stdout] | [INFO] [stdout] 96 ~ [INFO] [stdout] 97 ~ let goodvers3: Vec = match goodvers2.iter().find(|v| v.name.ends_with("-arm64")) { [INFO] [stdout] 98 | Some(_) => { [INFO] [stdout] 99 ~ goodvers2 [INFO] [stdout] 100 | .into_iter() [INFO] [stdout] 101 | .filter(|v| v.name.ends_with("-arm64")) [INFO] [stdout] 102 ~ .collect() [INFO] [stdout] 103 | } [INFO] [stdout] 104 ~ None => goodvers2, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/repos/repos_available.rs:33:36 [INFO] [stdout] | [INFO] [stdout] 33 | let comma = if extra != "" { ", " } else { "" }; [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!extra.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: comparison to empty slice [INFO] [stdout] --> src/repos/repos_available.rs:37:36 [INFO] [stdout] | [INFO] [stdout] 37 | let comma = if extra != "" { ", " } else { "" }; [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!extra.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: comparison to empty slice [INFO] [stdout] --> src/repos/repos_available.rs:40:20 [INFO] [stdout] | [INFO] [stdout] 40 | if extra != "" { [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!extra.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: this expression can be written more simply using `.retain()` [INFO] [stdout] --> src/repos/repos_list.rs:26:9 [INFO] [stdout] | [INFO] [stdout] 26 | repos = repos.into_iter().filter(|x| x.default).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `repos.retain(|x| x.default)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_retain [INFO] [stdout] = note: `#[warn(clippy::manual_retain)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/repos/repos_list.rs:28:5 [INFO] [stdout] | [INFO] [stdout] 28 | repos.sort_by(|a, b| b.default.cmp(&a.default)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] = note: `#[warn(clippy::unnecessary_sort_by)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 28 - repos.sort_by(|a, b| b.default.cmp(&a.default)); [INFO] [stdout] 28 + repos.sort_by_key(|b| std::cmp::Reverse(b.default)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/repos/cranlike_metadata.rs:225:22 [INFO] [stdout] | [INFO] [stdout] 225 | let is_rds = (data[0] == 0x58 && data[1] == 0x00) // X format [INFO] [stdout] | ______________________^ [INFO] [stdout] 226 | | || (data[0] == 0x41 && data[1] == 0x00) // A format [INFO] [stdout] 227 | | || (data[0] == 0x42 && data[1] == 0x00); // B format [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] 225 - let is_rds = (data[0] == 0x58 && data[1] == 0x00) // X format [INFO] [stdout] 226 - || (data[0] == 0x41 && data[1] == 0x00) // A format [INFO] [stdout] 227 - || (data[0] == 0x42 && data[1] == 0x00); // B format [INFO] [stdout] 225 + let is_rds = !(data[1] != 0x00 || data[0] != 0x58 && data[0] != 0x41 && data[0] != 0x42); // B format [INFO] [stdout] | [INFO] [stdout] 225 - let is_rds = (data[0] == 0x58 && data[1] == 0x00) // X format [INFO] [stdout] 226 - || (data[0] == 0x41 && data[1] == 0x00) // A format [INFO] [stdout] 227 - || (data[0] == 0x42 && data[1] == 0x00); // B format [INFO] [stdout] 225 + let is_rds = (data[0] == 0x42 || data[0] == 0x41 || data[0] == 0x58) && data[1] == 0x00; // B format [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/repos/cranlike_metadata.rs:225:22 [INFO] [stdout] | [INFO] [stdout] 225 | let is_rds = (data[0] == 0x58 && data[1] == 0x00) // X format [INFO] [stdout] | ______________________^ [INFO] [stdout] 226 | | || (data[0] == 0x41 && data[1] == 0x00) // A format [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] help: try [INFO] [stdout] | [INFO] [stdout] 225 - let is_rds = (data[0] == 0x58 && data[1] == 0x00) // X format [INFO] [stdout] 226 - || (data[0] == 0x41 && data[1] == 0x00) // A format [INFO] [stdout] 225 + let is_rds = !(data[1] != 0x00 || data[0] != 0x58 && data[0] != 0x41) // A format [INFO] [stdout] | [INFO] [stdout] 225 - let is_rds = (data[0] == 0x58 && data[1] == 0x00) // X format [INFO] [stdout] 226 - || (data[0] == 0x41 && data[1] == 0x00) // A format [INFO] [stdout] 225 + let is_rds = (data[0] == 0x41 || data[0] == 0x58) && data[1] == 0x00 // A format [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Option` [INFO] [stdout] --> src/repos/cranlike_metadata.rs:566:22 [INFO] [stdout] | [INFO] [stdout] 566 | .map(|s| serde_json::from_str(&s).ok()) [INFO] [stdout] | ______________________^ [INFO] [stdout] 567 | | .flatten(), [INFO] [stdout] | |______________________________^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|s| serde_json::from_str(&s).ok())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] = note: `#[warn(clippy::map_flatten)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Option` [INFO] [stdout] --> src/repos/cranlike_metadata.rs:640:14 [INFO] [stdout] | [INFO] [stdout] 640 | .map(|b| serde_json::to_string(b).ok()) [INFO] [stdout] | ______________^ [INFO] [stdout] 641 | | .flatten(); [INFO] [stdout] | |______________________^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|b| serde_json::to_string(b).ok())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&PathBuf` instead of `&Path` involves a new object where a slice will do [INFO] [stdout] --> src/repos/cranlike_metadata.rs:667:27 [INFO] [stdout] | [INFO] [stdout] 667 | fn repo_db_file(dcf_path: &PathBuf) -> 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] 667 - fn repo_db_file(dcf_path: &PathBuf) -> Result> { [INFO] [stdout] 667 + fn repo_db_file(dcf_path: &Path) -> Result> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/repos/setup.rs:165:44 [INFO] [stdout] | [INFO] [stdout] 165 | let mut profile_lines = read_lines(&Path::new(&profile))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `Path::new(&profile)` [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: length comparison to zero [INFO] [stdout] --> src/repos/setup.rs:168:12 [INFO] [stdout] | [INFO] [stdout] 168 | if grep_lines( [INFO] [stdout] | ____________^ [INFO] [stdout] 169 | | &Regex::new(&HC_PROFILE_REPOS_MARKERS.current_start.to_string())?, [INFO] [stdout] 170 | | &profile_lines, [INFO] [stdout] ... | [INFO] [stdout] 173 | | > 0 [INFO] [stdout] | |_______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] help: using `!is_empty` is clearer and more explicit [INFO] [stdout] | [INFO] [stdout] 168 ~ if !grep_lines( [INFO] [stdout] 169 + &Regex::new(&HC_PROFILE_REPOS_MARKERS.current_start.to_string())?, [INFO] [stdout] 170 + &profile_lines, [INFO] [stdout] 171 + ).is_empty() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/repos/setup.rs:191:19 [INFO] [stdout] | [INFO] [stdout] 191 | } else if start.len() == 0 && end.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `start.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: length comparison to zero [INFO] [stdout] --> src/repos/setup.rs:191:39 [INFO] [stdout] | [INFO] [stdout] 191 | } else if start.len() == 0 && end.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `end.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: called `unwrap` on `entry.platforms` after checking its variant with `is_some` [INFO] [stdout] --> src/repos/setup.rs:231:25 [INFO] [stdout] | [INFO] [stdout] 220 | if entry.platforms.is_some() { [INFO] [stdout] | ---------------------------- help: try: `if let Some() = &entry.platforms` [INFO] [stdout] ... [INFO] [stdout] 231 | for platform in entry.platforms.as_ref().unwrap().iter() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `entry.archs` after checking its variant with `is_some` [INFO] [stdout] --> src/repos/setup.rs:264:21 [INFO] [stdout] | [INFO] [stdout] 262 | if entry.archs.is_some() { [INFO] [stdout] | ------------------------ help: try: `if let Some() = &entry.archs` [INFO] [stdout] 263 | let mut ok = false; [INFO] [stdout] 264 | for arch in entry.archs.as_ref().unwrap().iter() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `entry.rversions` after checking its variant with `is_some` [INFO] [stdout] --> src/repos/setup.rs:279:27 [INFO] [stdout] | [INFO] [stdout] 277 | if entry.rversions.is_some() { [INFO] [stdout] | ---------------------------- help: try: `if let Some() = &entry.rversions` [INFO] [stdout] 278 | let mut ok = false; [INFO] [stdout] 279 | for constraint in entry.rversions.as_ref().unwrap().iter() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/repos/setup.rs:225:31 [INFO] [stdout] | [INFO] [stdout] 225 | rdata_platform += &p; [INFO] [stdout] | ^^ help: change this to: `p` [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/repos/setup.rs:229:31 [INFO] [stdout] | [INFO] [stdout] 229 | rdata_platform += &r; [INFO] [stdout] | ^^ help: change this to: `r` [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: length comparison to zero [INFO] [stdout] --> src/repos/setup.rs:334:8 [INFO] [stdout] | [INFO] [stdout] 334 | if bltidx.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `bltidx.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: comparison to empty slice [INFO] [stdout] --> src/repos/setup.rs:382:8 [INFO] [stdout] | [INFO] [stdout] 382 | if arch == "" { [INFO] [stdout] | ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `arch.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: taken reference of right operand [INFO] [stdout] --> src/repos/crandb.rs:16:19 [INFO] [stdout] | [INFO] [stdout] 16 | let mut url = "https://crandb.r-pkg.org/".to_string() + &package; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-------- [INFO] [stdout] | | [INFO] [stdout] | help: use the right value directly: `package` [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/repos/crandb.rs:16:61 [INFO] [stdout] | [INFO] [stdout] 16 | let mut url = "https://crandb.r-pkg.org/".to_string() + &package; [INFO] [stdout] | ^^^^^^^^ help: change this to: `package` [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: taken reference of right operand [INFO] [stdout] --> src/repos/crandb.rs:24:16 [INFO] [stdout] | [INFO] [stdout] 24 | local.push("package-".to_string() + &package + "-" + version + ".json"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^-------- [INFO] [stdout] | | [INFO] [stdout] | help: use the right value directly: `package` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/repos/crandb.rs:24:41 [INFO] [stdout] | [INFO] [stdout] 24 | local.push("package-".to_string() + &package + "-" + version + ".json"); [INFO] [stdout] | ^^^^^^^^ help: change this to: `package` [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: taken reference of right operand [INFO] [stdout] --> src/repos/crandb.rs:50:15 [INFO] [stdout] | [INFO] [stdout] 50 | let url = "https://crandb.r-pkg.org/".to_string() + &package + "/" + "all"; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-------- [INFO] [stdout] | | [INFO] [stdout] | help: use the right value directly: `package` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/repos/crandb.rs:50:57 [INFO] [stdout] | [INFO] [stdout] 50 | let url = "https://crandb.r-pkg.org/".to_string() + &package + "/" + "all"; [INFO] [stdout] | ^^^^^^^^ help: change this to: `package` [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: taken reference of right operand [INFO] [stdout] --> src/repos/crandb.rs:53:16 [INFO] [stdout] | [INFO] [stdout] 53 | local.push("package-".to_string() + &package + ".json"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^-------- [INFO] [stdout] | | [INFO] [stdout] | help: use the right value directly: `package` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/repos/crandb.rs:53:41 [INFO] [stdout] | [INFO] [stdout] 53 | local.push("package-".to_string() + &package + ".json"); [INFO] [stdout] | ^^^^^^^^ help: change this to: `package` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/args.rs:87:18 [INFO] [stdout] | [INFO] [stdout] 87 | .aliases(&["switch"]) [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `["switch"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/args.rs:104:18 [INFO] [stdout] | [INFO] [stdout] 104 | .aliases(&["ls"]) [INFO] [stdout] | ^^^^^^^ help: change this to: `["ls"]` [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/args.rs:128:18 [INFO] [stdout] | [INFO] [stdout] 128 | .aliases(&["install"]); [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `["install"]` [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/args.rs:147:37 [INFO] [stdout] | [INFO] [stdout] 147 | .conflicts_with_all(&["without-cran-mirror", "without-p3m"]), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["without-cran-mirror", "without-p3m"]` [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/args.rs:162:37 [INFO] [stdout] | [INFO] [stdout] 162 | .conflicts_with_all(&["without-cran-mirror", "without-p3m"]), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["without-cran-mirror", "without-p3m"]` [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/args.rs:173:37 [INFO] [stdout] | [INFO] [stdout] 173 | .conflicts_with_all(&["with-repos", "without-repos"]), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["with-repos", "without-repos"]` [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/args.rs:177:26 [INFO] [stdout] | [INFO] [stdout] 177 | .aliases(&["without-rspm"]) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: change this to: `["without-rspm"]` [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/args.rs:186:37 [INFO] [stdout] | [INFO] [stdout] 186 | .conflicts_with_all(&["with-repos", "without-repos"]), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["with-repos", "without-repos"]` [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/args.rs:264:18 [INFO] [stdout] | [INFO] [stdout] 264 | .aliases(&["del", "remove", "delete"]) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["del", "remove", "delete"]` [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/args.rs:375:18 [INFO] [stdout] | [INFO] [stdout] 375 | .aliases(&["create-lib"]) [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: change this to: `["create-lib"]` [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/args.rs:679:18 [INFO] [stdout] | [INFO] [stdout] 679 | .aliases(&["lib"]) [INFO] [stdout] | ^^^^^^^^ help: change this to: `["lib"]` [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/args.rs:690:26 [INFO] [stdout] | [INFO] [stdout] 690 | .aliases(&["ls"]) [INFO] [stdout] | ^^^^^^^ help: change this to: `["ls"]` [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/repositories.rs:164:6 [INFO] [stdout] | [INFO] [stdout] 164 | ) -> Result<(Vec<(usize, String)>, Option>, Vec>), Box> [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `headers` after checking its variant with `is_some` [INFO] [stdout] --> src/repositories.rs:270:50 [INFO] [stdout] | [INFO] [stdout] 269 | if !header_written && headers.is_some() { [INFO] [stdout] | ----------------- the check is happening here [INFO] [stdout] 270 | let header_line = format_tsv_row(headers.as_ref().unwrap())?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/resolve.rs:65:75 [INFO] [stdout] | [INFO] [stdout] 65 | OUTPUT.error(&format!("Failed to resolve R version: {}", x.to_string())); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `error!` args [INFO] [stdout] --> src/resolve.rs:66:60 [INFO] [stdout] | [INFO] [stdout] 66 | error!("Failed to resolve R version: {}", x.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `eval` after checking its variant with `is_some` [INFO] [stdout] --> src/scrun.rs:55:41 [INFO] [stdout] | [INFO] [stdout] 54 | if eval.is_some() { [INFO] [stdout] | ----------------- help: try: `if let Some() = eval` [INFO] [stdout] 55 | return sc_run_eval(rbin, rargs, eval.unwrap().to_string(), cmdargs, dry_run); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/scrun.rs:55:9 [INFO] [stdout] | [INFO] [stdout] 55 | return sc_run_eval(rbin, rargs, eval.unwrap().to_string(), cmdargs, dry_run); [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] 55 - return sc_run_eval(rbin, rargs, eval.unwrap().to_string(), cmdargs, dry_run); [INFO] [stdout] 55 + sc_run_eval(rbin, rargs, eval.unwrap().to_string(), cmdargs, dry_run) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/scrun.rs:57:9 [INFO] [stdout] | [INFO] [stdout] 57 | return sc_run_script(rbin, rargs, script.unwrap().to_string(), cmdargs, dry_run); [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] 57 - return sc_run_script(rbin, rargs, script.unwrap().to_string(), cmdargs, dry_run); [INFO] [stdout] 57 + sc_run_script(rbin, rargs, script.unwrap().to_string(), cmdargs, dry_run) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match can be simplified with `.unwrap_or_default()` [INFO] [stdout] --> src/resolve.rs:92:15 [INFO] [stdout] | [INFO] [stdout] 92 | let ppm = match resp["ppm-binaries"].as_bool() { [INFO] [stdout] | _______________^ [INFO] [stdout] 93 | | Some(v) => v, [INFO] [stdout] 94 | | None => false, [INFO] [stdout] 95 | | }; [INFO] [stdout] | |_____^ help: ascribe the type bool and replace your expression with: `resp["ppm-binaries"].as_bool().unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/resolve.rs:96:18 [INFO] [stdout] | [INFO] [stdout] 96 | let ppmurl = match resp["ppm-binary-url"].as_str() { [INFO] [stdout] | __________________^ [INFO] [stdout] 97 | | Some(v) => Some(v.to_string()), [INFO] [stdout] 98 | | None => None, [INFO] [stdout] 99 | | }; [INFO] [stdout] | |_____^ help: try: `resp["ppm-binary-url"].as_str().map(|v| v.to_string())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/scrun.rs:65:13 [INFO] [stdout] | [INFO] [stdout] 65 | return sc_run_package_script(rbin, rargs, cmdargs, dry_run); [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] 65 - return sc_run_package_script(rbin, rargs, cmdargs, dry_run); [INFO] [stdout] 65 + sc_run_package_script(rbin, rargs, cmdargs, dry_run) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/scrun.rs:67:13 [INFO] [stdout] | [INFO] [stdout] 67 | return sc_run_app(rbin, rargs, cmdargs, app_type, dry_run); [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] 67 - return sc_run_app(rbin, rargs, cmdargs, app_type, dry_run); [INFO] [stdout] 67 + sc_run_app(rbin, rargs, cmdargs, app_type, dry_run) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/scrun.rs:78:9 [INFO] [stdout] | [INFO] [stdout] 78 | return sc_run_rver(rbin, rargs, cmdargs, dry_run); [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] 78 - return sc_run_rver(rbin, rargs, cmdargs, dry_run); [INFO] [stdout] 78 + sc_run_rver(rbin, rargs, cmdargs, dry_run) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/scrun.rs:58:15 [INFO] [stdout] | [INFO] [stdout] 58 | } else if cmdargs.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!cmdargs.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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/run.rs:67:53 [INFO] [stdout] | [INFO] [stdout] 67 | let cmdline = Regex::new("[\n\r]")?.replace_all(&command, "").to_string(); [INFO] [stdout] | ^^^^^^^^ help: change this to: `command` [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: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/scrun.rs:88:14 [INFO] [stdout] | [INFO] [stdout] 88 | e.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] = note: `#[warn(clippy::to_string_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `warn!` args [INFO] [stdout] --> src/scrun.rs:92:14 [INFO] [stdout] | [INFO] [stdout] 92 | e.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/run.rs:71:16 [INFO] [stdout] | [INFO] [stdout] 71 | r_sudo(&version, &cmdline, &user) [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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/run.rs:74:18 [INFO] [stdout] | [INFO] [stdout] 74 | r_nosudo(&version, &cmdline) [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: redundant closure [INFO] [stdout] --> src/scrun.rs:209:24 [INFO] [stdout] | [INFO] [stdout] 209 | Ok(x) => x.map(|x| utf8_file_name(x)).collect(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `utf8_file_name` [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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/scrun.rs:270:12 [INFO] [stdout] | [INFO] [stdout] 270 | files: &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] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 270 - files: &Vec, [INFO] [stdout] 270 + files: &[String], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/scrun.rs:283:8 [INFO] [stdout] | [INFO] [stdout] 283 | if idxs.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `idxs.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: length comparison to zero [INFO] [stdout] --> src/scrun.rs:293:12 [INFO] [stdout] | [INFO] [stdout] 293 | if idxs.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `idxs.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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/scrun.rs:315:42 [INFO] [stdout] | [INFO] [stdout] 315 | fn detect_app_type(project: &str, files: &Vec) -> 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] 315 - fn detect_app_type(project: &str, files: &Vec) -> Result> { [INFO] [stdout] 315 + fn detect_app_type(project: &str, files: &[String]) -> Result> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/scrun.rs:336:23 [INFO] [stdout] | [INFO] [stdout] 336 | let uses_quarto = qmds.len() > 0 || (quartoyml && rmds.len() > 0); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!qmds.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: length comparison to zero [INFO] [stdout] --> src/scrun.rs:336:55 [INFO] [stdout] | [INFO] [stdout] 336 | let uses_quarto = qmds.len() > 0 || (quartoyml && rmds.len() > 0); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!rmds.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/scrun.rs:340:25 [INFO] [stdout] | [INFO] [stdout] 340 | if is_shiny_rmd(&project, rmd)? { [INFO] [stdout] | ^^^^^^^^ help: change this to: `project` [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/scrun.rs:347:25 [INFO] [stdout] | [INFO] [stdout] 347 | if is_shiny_rmd(&project, qmd)? { [INFO] [stdout] | ^^^^^^^^ help: change this to: `project` [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: length comparison to zero [INFO] [stdout] --> src/scrun.rs:369:8 [INFO] [stdout] | [INFO] [stdout] 369 | if rmds.len() > 0 || qmds.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!rmds.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: length comparison to zero [INFO] [stdout] --> src/scrun.rs:369:26 [INFO] [stdout] | [INFO] [stdout] 369 | if rmds.len() > 0 || qmds.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!qmds.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: called `unwrap` on `rt` after checking its variant with `is_some` [INFO] [stdout] --> src/scrun.rs:403:23 [INFO] [stdout] | [INFO] [stdout] 402 | if rt.is_some() { [INFO] [stdout] | --------------- help: try: `if let Some() = rt` [INFO] [stdout] 403 | let rt2 = rt.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `sv` after checking its variant with `is_some` [INFO] [stdout] --> src/scrun.rs:410:23 [INFO] [stdout] | [INFO] [stdout] 409 | if sv.is_some() { [INFO] [stdout] | --------------- help: try: `if let Some() = sv` [INFO] [stdout] 410 | let sv2 = sv.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `sv3` after checking its variant with `is_some` [INFO] [stdout] --> src/scrun.rs:416:31 [INFO] [stdout] | [INFO] [stdout] 415 | if sv3.is_some() { [INFO] [stdout] | ---------------- help: try: `if let Some() = sv3` [INFO] [stdout] 416 | let sv4 = sv3.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/scrun.rs:432:67 [INFO] [stdout] | [INFO] [stdout] 432 | if runtime.is_some() && runtime.unwrap().starts_with("shiny") { [INFO] [stdout] | ___________________________________________________________________^ [INFO] [stdout] 433 | | Ok(true) [INFO] [stdout] 434 | | } else if server.is_some() && server.unwrap() == "Shiny" { [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/scrun.rs:434:62 [INFO] [stdout] | [INFO] [stdout] 434 | } else if server.is_some() && server.unwrap() == "Shiny" { [INFO] [stdout] | ______________________________________________________________^ [INFO] [stdout] 435 | | Ok(true) [INFO] [stdout] 436 | | } else { [INFO] [stdout] | |_____^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] = note: `#[warn(clippy::if_same_then_else)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/scrun.rs:533:51 [INFO] [stdout] | [INFO] [stdout] 533 | if start_lines && re_line.is_match(&line) { [INFO] [stdout] | ___________________________________________________^ [INFO] [stdout] 534 | | trace!("End of YAML header"); [INFO] [stdout] 535 | | break; [INFO] [stdout] 536 | | } else if !start_lines && re_dots.is_match(&line) { [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/scrun.rs:536:59 [INFO] [stdout] | [INFO] [stdout] 536 | } else if !start_lines && re_dots.is_match(&line) { [INFO] [stdout] | ___________________________________________________________^ [INFO] [stdout] 537 | | trace!("End of YAML header"); [INFO] [stdout] 538 | | break; [INFO] [stdout] 539 | | } else { [INFO] [stdout] | |_________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&PathBuf` instead of `&Path` involves a new object where a slice will do [INFO] [stdout] --> src/rversion.rs:90:11 [INFO] [stdout] | [INFO] [stdout] 90 | path: &std::path::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] 90 - path: &std::path::PathBuf, [INFO] [stdout] 90 + path: &Path, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/scrun.rs:542:13 [INFO] [stdout] | [INFO] [stdout] 542 | header.push_str("\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `header.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: unnecessary closure used to substitute value for `Option::None` [INFO] [stdout] --> src/linux.rs:89:20 [INFO] [stdout] | [INFO] [stdout] 89 | let filename = basename(&url).unwrap_or_else(|| "foo"); [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] 89 - let filename = basename(&url).unwrap_or_else(|| "foo"); [INFO] [stdout] 89 + let filename = basename(&url).unwrap_or("foo"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/linux.rs:91:31 [INFO] [stdout] | [INFO] [stdout] 91 | let target = tmp_dir.join(&filename); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `filename` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/linux.rs:99:37 [INFO] [stdout] | [INFO] [stdout] 99 | download_file(client, &url, &target.as_os_str())?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: change this to: `target.as_os_str()` [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 late initialization [INFO] [stdout] --> src/linux.rs:102:5 [INFO] [stdout] | [INFO] [stdout] 102 | let dirname; [INFO] [stdout] | ^^^^^^^^^^^^ created here [INFO] [stdout] 103 | dirname = add_package(target.as_os_str(), &platform)?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ initialised here [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] = note: `#[warn(clippy::needless_late_init)]` on by default [INFO] [stdout] help: move the declaration `dirname` here [INFO] [stdout] | [INFO] [stdout] 102 ~ [INFO] [stdout] 103 ~ let dirname = add_package(target.as_os_str(), &platform)?; [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/linux.rs:110:5 [INFO] [stdout] | [INFO] [stdout] 110 | / match alias { [INFO] [stdout] 111 | | Some(alias) => add_alias(&dirname, &alias)?, [INFO] [stdout] 112 | | None => {} [INFO] [stdout] 113 | | }; [INFO] [stdout] | |_____^ help: try: `if let Some(alias) = alias { add_alias(&dirname, &alias)? }` [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: use of `default` to create a unit struct [INFO] [stdout] --> src/solver.rs:56:44 [INFO] [stdout] | [INFO] [stdout] 56 | let mut vranges = HashMap::with_hasher(rustc_hash::FxBuildHasher::default()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 56 - let mut vranges = HashMap::with_hasher(rustc_hash::FxBuildHasher::default()); [INFO] [stdout] 56 + let mut vranges = HashMap::with_hasher(rustc_hash::FxBuildHasher); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/solver.rs:58:69 [INFO] [stdout] | [INFO] [stdout] 58 | if !dev && dep.types.iter().all(|x| DEP_TYPES_SOFT.contains(&x)) { [INFO] [stdout] | ^^ help: change this to: `x` [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/solver.rs:96:11 [INFO] [stdout] | [INFO] [stdout] 96 | deps: RefCell< [INFO] [stdout] | ___________^ [INFO] [stdout] 97 | | HashMap< [INFO] [stdout] 98 | | (RPackageName, RegistryPackageVersion), [INFO] [stdout] 99 | | HashMap, [INFO] [stdout] 100 | | >, [INFO] [stdout] 101 | | >, [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/linux.rs:184:16 [INFO] [stdout] | [INFO] [stdout] 184 | || platform [INFO] [stdout] | ________________^ [INFO] [stdout] 185 | | .version [INFO] [stdout] 186 | | .as_ref() [INFO] [stdout] 187 | | .map_or(false, |v| v.starts_with("7."))) [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] 187 - .map_or(false, |v| v.starts_with("7."))) [INFO] [stdout] 187 + .is_some_and(|v| v.starts_with("7."))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/linux.rs:201:16 [INFO] [stdout] | [INFO] [stdout] 201 | || platform [INFO] [stdout] | ________________^ [INFO] [stdout] 202 | | .version [INFO] [stdout] 203 | | .as_ref() [INFO] [stdout] 204 | | .map_or(false, |v| v.starts_with("7."))) [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] 204 - .map_or(false, |v| v.starts_with("7."))) [INFO] [stdout] 204 + .is_some_and(|v| v.starts_with("7."))) [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/solver.rs:202:13 [INFO] [stdout] | [INFO] [stdout] 202 | / match self.get_all_versions(package) { [INFO] [stdout] 203 | | Err(_) => return Err(ProviderError::UnknownPackage), [INFO] [stdout] 204 | | _ => {} [INFO] [stdout] 205 | | }; [INFO] [stdout] | |_____________^ help: try: `if let Err(_) = self.get_all_versions(package) { return Err(ProviderError::UnknownPackage) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/linux.rs:223:16 [INFO] [stdout] | [INFO] [stdout] 223 | || platform [INFO] [stdout] | ________________^ [INFO] [stdout] 224 | | .version [INFO] [stdout] 225 | | .as_ref() [INFO] [stdout] 226 | | .map_or(false, |v| v.starts_with("8."))) [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] 226 - .map_or(false, |v| v.starts_with("8."))) [INFO] [stdout] 226 + .is_some_and(|v| v.starts_with("8."))) [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/solver.rs:230:9 [INFO] [stdout] | [INFO] [stdout] 230 | / match self.get_all_versions(package) { [INFO] [stdout] 231 | | Err(_) => return Err(ProviderError::UnknownPackage), [INFO] [stdout] 232 | | _ => {} [INFO] [stdout] 233 | | }; [INFO] [stdout] | |_________^ help: try: `if let Err(_) = self.get_all_versions(package) { return Err(ProviderError::UnknownPackage) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/linux.rs:238:16 [INFO] [stdout] | [INFO] [stdout] 238 | || platform [INFO] [stdout] | ________________^ [INFO] [stdout] 239 | | .version [INFO] [stdout] 240 | | .as_ref() [INFO] [stdout] 241 | | .map_or(false, |v| v.starts_with("9."))) [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] 241 - .map_or(false, |v| v.starts_with("9."))) [INFO] [stdout] 241 + .is_some_and(|v| v.starts_with("9."))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/linux.rs:257:16 [INFO] [stdout] | [INFO] [stdout] 257 | || platform [INFO] [stdout] | ________________^ [INFO] [stdout] 258 | | .version [INFO] [stdout] 259 | | .as_ref() [INFO] [stdout] 260 | | .map_or(false, |v| v.starts_with("9."))) [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] 260 - .map_or(false, |v| v.starts_with("9."))) [INFO] [stdout] 260 + .is_some_and(|v| v.starts_with("9."))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `rsplitn` [INFO] [stdout] --> src/utils.rs:40:5 [INFO] [stdout] | [INFO] [stdout] 40 | path.rsplitn(2, '/').next() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try: `path.rsplit('/')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_splitn [INFO] [stdout] = note: `#[warn(clippy::needless_splitn)]` 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/utils.rs:58:38 [INFO] [stdout] | [INFO] [stdout] 58 | pub fn grep_lines(re: &Regex, lines: &Vec) -> 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] 58 - pub fn grep_lines(re: &Regex, lines: &Vec) -> Vec { [INFO] [stdout] 58 + pub fn grep_lines(re: &Regex, lines: &[String]) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `write!()` with a format string that ends in a single newline [INFO] [stdout] --> src/utils.rs:112:9 [INFO] [stdout] | [INFO] [stdout] 112 | write!(f, "{}\n", line)?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_with_newline [INFO] [stdout] = note: `#[warn(clippy::write_with_newline)]` on by default [INFO] [stdout] help: use `writeln!` instead [INFO] [stdout] | [INFO] [stdout] 112 - write!(f, "{}\n", line)?; [INFO] [stdout] 112 + writeln!(f, "{}", line)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `write!()` with a format string that ends in a single newline [INFO] [stdout] --> src/utils.rs:115:9 [INFO] [stdout] | [INFO] [stdout] 115 | write!(f, "{}\n", line)?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_with_newline [INFO] [stdout] help: use `writeln!` instead [INFO] [stdout] | [INFO] [stdout] 115 - write!(f, "{}\n", line)?; [INFO] [stdout] 115 + writeln!(f, "{}", line)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/linux.rs:413:24 [INFO] [stdout] | [INFO] [stdout] 413 | if re.is_match(&fnamestr) { [INFO] [stdout] | ^^^^^^^^^ help: change this to: `fnamestr` [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/utils.rs:185:19 [INFO] [stdout] | [INFO] [stdout] 185 | Err(_) => return 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] 185 - Err(_) => return false, [INFO] [stdout] 185 + Err(_) => false, [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/linux.rs:423:25 [INFO] [stdout] | [INFO] [stdout] 423 | / match std::fs::remove_file(&path) { [INFO] [stdout] 424 | | Err(err) => { [INFO] [stdout] 425 | | OUTPUT.warn(&format!( [INFO] [stdout] 426 | | "Failed to remove {}: {}", [INFO] [stdout] ... | [INFO] [stdout] 432 | | _ => {} [INFO] [stdout] 433 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 423 ~ if let Err(err) = std::fs::remove_file(&path) { [INFO] [stdout] 424 + OUTPUT.warn(&format!( [INFO] [stdout] 425 + "Failed to remove {}: {}", [INFO] [stdout] 426 + path.display(), [INFO] [stdout] 427 + err.to_string() [INFO] [stdout] 428 + )); [INFO] [stdout] 429 + warn!("Failed to remove {}: {}", path.display(), err.to_string()) [INFO] [stdout] 430 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/linux.rs:428:40 [INFO] [stdout] | [INFO] [stdout] 428 | ... err.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `warn!` args [INFO] [stdout] --> src/linux.rs:430:85 [INFO] [stdout] | [INFO] [stdout] 430 | ... warn!("Failed to remove {}: {}", path.display(), err.to_string()) [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/linux.rs:444:5 [INFO] [stdout] | [INFO] [stdout] 443 | let re = Regex::new("^R-(release|oldrel)$").unwrap(); [INFO] [stdout] | ----------------------------------------------------- unnecessary `let` binding [INFO] [stdout] 444 | re [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 443 ~ [INFO] [stdout] 444 ~ Regex::new("^R-(release|oldrel)$").unwrap() [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/utils.rs:310:42 [INFO] [stdout] | [INFO] [stdout] 310 | pub fn create_parent_dir_if_needed(path: &PathBuf) -> Result<(), Box> { [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] 310 - pub fn create_parent_dir_if_needed(path: &PathBuf) -> Result<(), Box> { [INFO] [stdout] 310 + pub fn create_parent_dir_if_needed(path: &Path) -> Result<(), Box> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/linux.rs:466:24 [INFO] [stdout] | [INFO] [stdout] 466 | if re.is_match(&fnamestr) { [INFO] [stdout] | ^^^^^^^^^ help: change this to: `fnamestr` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/main.rs:144:5 [INFO] [stdout] | [INFO] [stdout] 144 | / match env_logger::Builder::from_env(env_logger::Env::default()) [INFO] [stdout] 145 | | .filter(None, loglevel) [INFO] [stdout] 146 | | .parse_filters(&filter_str) [INFO] [stdout] 147 | | .target(env_logger::Target::Stderr) [INFO] [stdout] ... | [INFO] [stdout] 207 | | _ => {} [INFO] [stdout] 208 | | }; [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] help: try [INFO] [stdout] | [INFO] [stdout] 144 ~ if let Err(e) = env_logger::Builder::from_env(env_logger::Env::default()) [INFO] [stdout] 145 + .filter(None, loglevel) [INFO] [stdout] 146 + .parse_filters(&filter_str) [INFO] [stdout] 147 + .target(env_logger::Target::Stderr) [INFO] [stdout] 148 + .format(move |buf, record| { [INFO] [stdout] 149 + // In interactive mode, write only to log file [INFO] [stdout] 150 + if is_interactive { [INFO] [stdout] 151 + if let Some(ref log_file) = log_file_for_format { [INFO] [stdout] 152 + if let Ok(mut file) = log_file.lock() { [INFO] [stdout] 153 + // Always include timestamps in log file [INFO] [stdout] 154 + let log_line = if verbose_count >= 1 { [INFO] [stdout] 155 + format!( [INFO] [stdout] 156 + "[{} {} {}:{}] {}\n", [INFO] [stdout] 157 + buf.timestamp(), [INFO] [stdout] 158 + record.level(), [INFO] [stdout] 159 + record.file().unwrap_or("unknown"), [INFO] [stdout] 160 + record.line().unwrap_or(0), [INFO] [stdout] 161 + record.args() [INFO] [stdout] 162 + ) [INFO] [stdout] 163 + } else { [INFO] [stdout] 164 + format!( [INFO] [stdout] 165 + "[{} {}] {}\n", [INFO] [stdout] 166 + buf.timestamp(), [INFO] [stdout] 167 + record.level(), [INFO] [stdout] 168 + record.args() [INFO] [stdout] 169 + ) [INFO] [stdout] 170 + }; [INFO] [stdout] 171 + let _ = file.write_all(log_line.as_bytes()); [INFO] [stdout] 172 + } [INFO] [stdout] 173 + } [INFO] [stdout] 174 + // Don't write to stderr in interactive mode [INFO] [stdout] 175 + Ok(()) [INFO] [stdout] 176 + } else { [INFO] [stdout] 177 + // Non-interactive: write to stderr with colors [INFO] [stdout] 178 + let level_string = match record.level() { [INFO] [stdout] 179 + Level::Error => record.level().to_string().red().bold().to_string(), [INFO] [stdout] 180 + Level::Warn => record.level().to_string().yellow().bold().to_string(), [INFO] [stdout] 181 + Level::Info => record.level().to_string().blue().to_string(), [INFO] [stdout] 182 + Level::Debug => record.level().to_string().cyan().to_string(), [INFO] [stdout] 183 + Level::Trace => record.level().to_string().white().to_string(), [INFO] [stdout] 184 + }; [INFO] [stdout] 185 + [INFO] [stdout] 186 + if verbose_count >= 1 { [INFO] [stdout] 187 + writeln!( [INFO] [stdout] 188 + buf, [INFO] [stdout] 189 + "[{} {} {}:{}] {}", [INFO] [stdout] 190 + buf.timestamp(), [INFO] [stdout] 191 + level_string, [INFO] [stdout] 192 + record.file().unwrap_or("unknown"), [INFO] [stdout] 193 + record.line().unwrap_or(0), [INFO] [stdout] 194 + record.args() [INFO] [stdout] 195 + ) [INFO] [stdout] 196 + } else { [INFO] [stdout] 197 + writeln!(buf, "[{}] {}", level_string, record.args()) [INFO] [stdout] 198 + } [INFO] [stdout] 199 + } [INFO] [stdout] 200 + }) [INFO] [stdout] 201 + .try_init() { [INFO] [stdout] 202 + eprintln!("Fatal error, cannot set up logger: {}", e.to_string()); [INFO] [stdout] 203 + return 2; [INFO] [stdout] 204 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/linux.rs:510:5 [INFO] [stdout] | [INFO] [stdout] 505 | / let s = match osver { [INFO] [stdout] 506 | | None => None, [INFO] [stdout] 507 | | Some(os) => os.into_string().ok(), [INFO] [stdout] 508 | | }; [INFO] [stdout] | |______- unnecessary `let` binding [INFO] [stdout] 509 | [INFO] [stdout] 510 | s [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 505 ~ [INFO] [stdout] 506 | [INFO] [stdout] 507 ~ match osver { [INFO] [stdout] 508 + None => None, [INFO] [stdout] 509 + Some(os) => os.into_string().ok(), [INFO] [stdout] 510 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/linux.rs:496:17 [INFO] [stdout] | [INFO] [stdout] 496 | let osver = match pb [INFO] [stdout] | _________________^ [INFO] [stdout] 497 | | .parent() [INFO] [stdout] 498 | | .and_then(|x| x.parent()) [INFO] [stdout] 499 | | .and_then(|x| x.file_name()) [INFO] [stdout] ... | [INFO] [stdout] 502 | | Some(s) => Some(s.to_os_string()), [INFO] [stdout] 503 | | }; [INFO] [stdout] | |_____^ [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] help: try [INFO] [stdout] | [INFO] [stdout] 496 ~ let osver = pb [INFO] [stdout] 497 + .parent() [INFO] [stdout] 498 + .and_then(|x| x.parent()) [INFO] [stdout] 499 ~ .and_then(|x| x.file_name()).map(|s| s.to_os_string()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `eprintln!` args [INFO] [stdout] --> src/main.rs:204:65 [INFO] [stdout] | [INFO] [stdout] 204 | eprintln!("Fatal error, cannot set up logger: {}", e.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `error!` args [INFO] [stdout] --> src/main.rs:227:29 [INFO] [stdout] | [INFO] [stdout] 227 | error!("{}", err.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/linux.rs:571:32 [INFO] [stdout] | [INFO] [stdout] 571 | std::os::unix::fs::symlink(&cr, &r)?; [INFO] [stdout] | ^^^ help: change this to: `cr` [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/linux.rs:571:37 [INFO] [stdout] | [INFO] [stdout] 571 | std::os::unix::fs::symlink(&cr, &r)?; [INFO] [stdout] | ^^ help: change this to: `r` [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/linux.rs:581:32 [INFO] [stdout] | [INFO] [stdout] 581 | std::os::unix::fs::symlink(&crs, &rs)?; [INFO] [stdout] | ^^^^ help: change this to: `crs` [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/linux.rs:581:38 [INFO] [stdout] | [INFO] [stdout] 581 | std::os::unix::fs::symlink(&crs, &rs)?; [INFO] [stdout] | ^^^ help: change this to: `rs` [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: unnecessary use of `to_string` [INFO] [stdout] --> src/linux.rs:606:33 [INFO] [stdout] | [INFO] [stdout] 606 | let profile = path.join("lib/R/library/base/R/Rprofile".to_string()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `"lib/R/library/base/R/Rprofile"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] = note: `#[warn(clippy::unnecessary_to_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/linux.rs:761:8 [INFO] [stdout] | [INFO] [stdout] 761 | if idx_sed.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `idx_sed.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: unneeded `return` statement [INFO] [stdout] --> src/linux.rs:779:13 [INFO] [stdout] | [INFO] [stdout] 779 | return; [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] 778 ~ debug!("SSL_CERT_FILE is already set, keeping it."); [INFO] [stdout] 779 | } [INFO] [stdout] ... [INFO] [stdout] 792 | } [INFO] [stdout] 793 ~ } [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/alias.rs:210:21 [INFO] [stdout] | [INFO] [stdout] 210 | / match std::fs::remove_file(&linkfile) { [INFO] [stdout] 211 | | Err(err) => { [INFO] [stdout] 212 | | OUTPUT.error(&format!( [INFO] [stdout] 213 | | "Failed to delete {}, cannot update alias: {}", [INFO] [stdout] ... | [INFO] [stdout] 228 | | _ => {} [INFO] [stdout] 229 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 210 ~ if let Err(err) = std::fs::remove_file(&linkfile) { [INFO] [stdout] 211 + OUTPUT.error(&format!( [INFO] [stdout] 212 + "Failed to delete {}, cannot update alias: {}", [INFO] [stdout] 213 + linkfile.display(), [INFO] [stdout] 214 + err.to_string() [INFO] [stdout] 215 + )); [INFO] [stdout] 216 + error!( [INFO] [stdout] 217 + "Failed to delete {}, cannot update alias: {}", [INFO] [stdout] 218 + linkfile.display(), [INFO] [stdout] 219 + err.to_string() [INFO] [stdout] 220 + ); [INFO] [stdout] 221 + bail!( [INFO] [stdout] 222 + "Failed to delete {}, cannot update alias: {}", [INFO] [stdout] 223 + linkfile.display(), [INFO] [stdout] 224 + err.to_string() [INFO] [stdout] 225 + ); [INFO] [stdout] 226 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/alias.rs:215:36 [INFO] [stdout] | [INFO] [stdout] 215 | ... err.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `error!` args [INFO] [stdout] --> src/alias.rs:220:36 [INFO] [stdout] | [INFO] [stdout] 220 | ... err.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [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/alias.rs:237:5 [INFO] [stdout] | [INFO] [stdout] 237 | / match symlink(&target, &linkfile) { [INFO] [stdout] 238 | | Err(err) => { [INFO] [stdout] 239 | | OUTPUT.error(&format!( [INFO] [stdout] 240 | | "Cannot create alias {}: {}", [INFO] [stdout] ... | [INFO] [stdout] 255 | | _ => {} [INFO] [stdout] 256 | | }; [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 237 ~ if let Err(err) = symlink(&target, &linkfile) { [INFO] [stdout] 238 + OUTPUT.error(&format!( [INFO] [stdout] 239 + "Cannot create alias {}: {}", [INFO] [stdout] 240 + linkfile.display(), [INFO] [stdout] 241 + err.to_string() [INFO] [stdout] 242 + )); [INFO] [stdout] 243 + error!( [INFO] [stdout] 244 + "Cannot create alias {}: {}", [INFO] [stdout] 245 + linkfile.display(), [INFO] [stdout] 246 + err.to_string() [INFO] [stdout] 247 + ); [INFO] [stdout] 248 + bail!( [INFO] [stdout] 249 + "Cannot create alias {}: {}", [INFO] [stdout] 250 + linkfile.display(), [INFO] [stdout] 251 + err.to_string() [INFO] [stdout] 252 + ) [INFO] [stdout] 253 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/alias.rs:242:20 [INFO] [stdout] | [INFO] [stdout] 242 | err.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `error!` args [INFO] [stdout] --> src/alias.rs:247:20 [INFO] [stdout] | [INFO] [stdout] 247 | err.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match can be simplified with `.unwrap_or_default()` [INFO] [stdout] --> src/common.rs:89:25 [INFO] [stdout] | [INFO] [stdout] 89 | let lines = match read_lines(&desc) { [INFO] [stdout] | _________________________^ [INFO] [stdout] 90 | | Ok(x) => x, [INFO] [stdout] 91 | | Err(_) => vec![], [INFO] [stdout] 92 | | }; [INFO] [stdout] | |_____________^ help: replace it with: `read_lines(&desc).unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default [INFO] [stdout] = note: `#[warn(clippy::manual_unwrap_or_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/common.rs:94:46 [INFO] [stdout] | [INFO] [stdout] 94 | let version: Option = if idx.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `idx.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: match can be simplified with `.unwrap_or_default()` [INFO] [stdout] --> src/common.rs:112:17 [INFO] [stdout] | [INFO] [stdout] 112 | let lines = match read_lines(&desc) { [INFO] [stdout] | _________________^ [INFO] [stdout] 113 | | Ok(x) => x, [INFO] [stdout] 114 | | Err(_) => vec![], [INFO] [stdout] 115 | | }; [INFO] [stdout] | |_____^ help: replace it with: `read_lines(&desc).unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/common.rs:117:8 [INFO] [stdout] | [INFO] [stdout] 117 | if idx.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `idx.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: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/common.rs:151:15 [INFO] [stdout] | [INFO] [stdout] 151 | path: path.to_str().and_then(|x| Some(x.to_string())), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `path.to_str().map(|x| x.to_string())` [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: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/common.rs:152:17 [INFO] [stdout] | [INFO] [stdout] 152 | binary: binary.to_str().and_then(|x| Some(x.to_string())), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `binary.to_str().map(|x| x.to_string())` [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] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/common.rs:172:27 [INFO] [stdout] | [INFO] [stdout] 172 | pub fn check_has_pak(ver: &String) -> 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] 172 - pub fn check_has_pak(ver: &String) -> Result> { [INFO] [stdout] 172 + pub fn check_has_pak(ver: &str) -> Result> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/common.rs:179:9 [INFO] [stdout] | [INFO] [stdout] 179 | ver = ver + ".0"; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace it with: `ver += ".0"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/common.rs:213:9 [INFO] [stdout] | [INFO] [stdout] 213 | let msg; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `msg` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 213 ~ [INFO] [stdout] 214 ~ let msg = if update { [INFO] [stdout] 215 ~ format!("Updating pak for R {}", ver) [INFO] [stdout] 216 | } else { [INFO] [stdout] 217 ~ format!("Installing pak for R {} (if not installed yet)", ver) [INFO] [stdout] 218 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/common.rs:232:22 [INFO] [stdout] | [INFO] [stdout] 232 | x.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `error!` args [INFO] [stdout] --> src/common.rs:234:71 [INFO] [stdout] | [INFO] [stdout] 234 | error!("Failed to to install pak for R {}: {}", ver, x.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/common.rs:240:9 [INFO] [stdout] | [INFO] [stdout] 240 | let cmd; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `cmd` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 240 ~ [INFO] [stdout] 241 ~ let cmd = if update { [INFO] [stdout] 242 ~ r#" [INFO] [stdout] 243 | install.packages('pak', repos = sprintf('https://r-lib.github.io/p/pak/{}/%s/%s/%s', .Platform$pkgType, R.Version()$os, R.Version()$arch)) [INFO] [stdout] 244 ~ "# [INFO] [stdout] 245 | } else { [INFO] [stdout] 246 ~ r#" [INFO] [stdout] 247 | if (!requireNamespace('pak', quietly = TRUE)) { [INFO] [stdout] 248 | install.packages('pak', repos = sprintf('https://r-lib.github.io/p/pak/{}/%s/%s/%s', .Platform$pkgType, R.Version()$os, R.Version()$arch)) [INFO] [stdout] 249 | } [INFO] [stdout] 250 ~ "# [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/common.rs:260:22 [INFO] [stdout] | [INFO] [stdout] 260 | x.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `error!` args [INFO] [stdout] --> src/common.rs:262:68 [INFO] [stdout] | [INFO] [stdout] 262 | error!("Failed to install pak for R {}: {}", ver, x.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/common.rs:285:24 [INFO] [stdout] | [INFO] [stdout] 285 | if re.is_match(&pathstr) { [INFO] [stdout] | ^^^^^^^^ help: change this to: `pathstr` [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: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/common.rs:330:20 [INFO] [stdout] | [INFO] [stdout] 330 | prj2 = Some(p.to_string() + "/").and_then(|x| Some(x.to_string())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Some(p.to_string() + "/").map(|x| x.to_string())` [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] [INFO] [stdout] [INFO] [stdout] warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/common.rs:336:20 [INFO] [stdout] | [INFO] [stdout] 336 | prj2 = Some("./".to_string() + p).and_then(|x| Some(x.to_string())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Some("./".to_string() + p).map(|x| x.to_string())` [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] [INFO] [stdout] [INFO] [stdout] warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/common.rs:392:23 [INFO] [stdout] | [INFO] [stdout] 392 | let projstr = proj [INFO] [stdout] | _______________________^ [INFO] [stdout] 393 | | .as_ref() [INFO] [stdout] 394 | | .and_then(|x| x.to_str()) [INFO] [stdout] 395 | | .and_then(|x| Some(x.to_string())); [INFO] [stdout] | |______________________________________________^ [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] help: try [INFO] [stdout] | [INFO] [stdout] 392 ~ let projstr = proj [INFO] [stdout] 393 + .as_ref() [INFO] [stdout] 394 ~ .and_then(|x| x.to_str()).map(|x| x.to_string()); [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/common.rs:437:5 [INFO] [stdout] | [INFO] [stdout] 437 | / match args.try_contains_id("platform") { [INFO] [stdout] 438 | | Ok(_) => { [INFO] [stdout] 439 | | let platform = args.get_one::("platform"); [INFO] [stdout] 440 | | if let Some(x) = platform { [INFO] [stdout] ... | [INFO] [stdout] 444 | | Err(_) => {} [INFO] [stdout] 445 | | }; [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 437 ~ if let Ok(_) = args.try_contains_id("platform") { [INFO] [stdout] 438 + let platform = args.get_one::("platform"); [INFO] [stdout] 439 + if let Some(x) = platform { [INFO] [stdout] 440 + return Ok(x.to_string()); [INFO] [stdout] 441 + } [INFO] [stdout] 442 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/common.rs:517:37 [INFO] [stdout] | [INFO] [stdout] 517 | if !args.get_flag("all") && vers.len() > 0 && new.name != "next" && new.name != "devel" { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!vers.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 use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/common.rs:602:36 [INFO] [stdout] | [INFO] [stdout] 602 | for (_idx, item) in resp.iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index [INFO] [stdout] = note: `#[warn(clippy::unused_enumerate_index)]` on by default [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 602 - for (_idx, item) in resp.iter().enumerate() { [INFO] [stdout] 602 + for item in resp.iter() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match can be simplified with `.unwrap_or_default()` [INFO] [stdout] --> src/common.rs:611:23 [INFO] [stdout] | [INFO] [stdout] 611 | let ppm = match item["ppm-binaries"].as_bool() { [INFO] [stdout] | _______________________^ [INFO] [stdout] 612 | | Some(v) => v, [INFO] [stdout] 613 | | None => false, [INFO] [stdout] 614 | | }; [INFO] [stdout] | |_____________^ help: ascribe the type bool and replace your expression with: `item["ppm-binaries"].as_bool().unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match can be simplified with `.unwrap_or_default()` [INFO] [stdout] --> src/common.rs:615:27 [INFO] [stdout] | [INFO] [stdout] 615 | let retired = match item["retired"].as_bool() { [INFO] [stdout] | ___________________________^ [INFO] [stdout] 616 | | Some(v) => v, [INFO] [stdout] 617 | | None => false, [INFO] [stdout] 618 | | }; [INFO] [stdout] | |_____________^ help: ascribe the type bool and replace your expression with: `item["retired"].as_bool().unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/common.rs:619:24 [INFO] [stdout] | [INFO] [stdout] 619 | let last = match item["last-build"].as_str() { [INFO] [stdout] | ________________________^ [INFO] [stdout] 620 | | Some(s) => Some(s.to_string()), [INFO] [stdout] 621 | | None => None, [INFO] [stdout] 622 | | }; [INFO] [stdout] | |_____________^ help: try: `item["last-build"].as_str().map(|s| s.to_string())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [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/common.rs:637:13 [INFO] [stdout] | [INFO] [stdout] 637 | / match alias { [INFO] [stdout] 638 | | Some(alias2) => { [INFO] [stdout] 639 | | let d = Distro { [INFO] [stdout] 640 | | name, [INFO] [stdout] ... | [INFO] [stdout] 650 | | None => (), [INFO] [stdout] 651 | | }; [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 637 ~ if let Some(alias2) = alias { [INFO] [stdout] 638 + let d = Distro { [INFO] [stdout] 639 + name, [INFO] [stdout] 640 + version, [INFO] [stdout] 641 + id, [INFO] [stdout] 642 + ppm: alias2.ppm, [INFO] [stdout] 643 + retired: alias2.retired, [INFO] [stdout] 644 + eol, [INFO] [stdout] 645 + last: alias2.last.clone(), [INFO] [stdout] 646 + }; [INFO] [stdout] 647 + distros.push(d); [INFO] [stdout] 648 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `!RangeInclusive::contains` implementation [INFO] [stdout] --> src/common.rs:719:33 [INFO] [stdout] | [INFO] [stdout] 719 | Ok(x) => x >= 35 && (x < 210 || x > 215), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: use: `!(210..=215).contains(&x)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] = note: `#[warn(clippy::manual_range_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/config.rs:52:33 [INFO] [stdout] | [INFO] [stdout] 52 | std::fs::create_dir_all(&parent)?; [INFO] [stdout] | ^^^^^^^ help: change this to: `parent` [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: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/config.rs:58:9 [INFO] [stdout] | [INFO] [stdout] 58 | self.userlibrary.get(rver).and_then(|x| Some(x.to_string())) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `self.userlibrary.get(rver).map(|x| x.to_string())` [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] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/config.rs:63:45 [INFO] [stdout] | [INFO] [stdout] 63 | None => self.userlibrary.remove(&rver.to_string()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace it with: `rver` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/dcf/mod.rs:127:23 [INFO] [stdout] | [INFO] [stdout] 127 | let ver = spec[2..].trim(); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/dcf/mod.rs:126:46 [INFO] [stdout] | [INFO] [stdout] 126 | let (constraint_type, version_str) = if spec.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] 126 ~ let (constraint_type, version_str) = if let Some() = spec.strip_prefix(">=") { [INFO] [stdout] 127 ~ let ver = .trim(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/dcf/mod.rs:130:23 [INFO] [stdout] | [INFO] [stdout] 130 | let ver = spec[2..].trim(); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/dcf/mod.rs:129:16 [INFO] [stdout] | [INFO] [stdout] 129 | } else if spec.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] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 129 ~ } else if let Some() = spec.strip_prefix("<=") { [INFO] [stdout] 130 ~ let ver = .trim(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/dcf/mod.rs:133:23 [INFO] [stdout] | [INFO] [stdout] 133 | let ver = spec[2..].trim(); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/dcf/mod.rs:132:16 [INFO] [stdout] | [INFO] [stdout] 132 | } else if spec.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] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 132 ~ } else if let Some() = spec.strip_prefix("==") { [INFO] [stdout] 133 ~ let ver = .trim(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/dcf/mod.rs:136:23 [INFO] [stdout] | [INFO] [stdout] 136 | let ver = spec[1..].trim(); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/dcf/mod.rs:135:16 [INFO] [stdout] | [INFO] [stdout] 135 | } else if spec.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] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 135 ~ } else if let Some() = spec.strip_prefix('=') { [INFO] [stdout] 136 ~ let ver = .trim(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/dcf/mod.rs:139:23 [INFO] [stdout] | [INFO] [stdout] 139 | let ver = spec[2..].trim(); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/dcf/mod.rs:138:16 [INFO] [stdout] | [INFO] [stdout] 138 | } else if spec.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] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 138 ~ } else if let Some() = spec.strip_prefix(">>") { [INFO] [stdout] 139 ~ let ver = .trim(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/dcf/mod.rs:142:23 [INFO] [stdout] | [INFO] [stdout] 142 | let ver = spec[1..].trim(); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/dcf/mod.rs:141:16 [INFO] [stdout] | [INFO] [stdout] 141 | } else if spec.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] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 141 ~ } else if let Some() = spec.strip_prefix('>') { [INFO] [stdout] 142 ~ let ver = .trim(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/dcf/mod.rs:145:23 [INFO] [stdout] | [INFO] [stdout] 145 | let ver = spec[2..].trim(); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/dcf/mod.rs:144:16 [INFO] [stdout] | [INFO] [stdout] 144 | } else if spec.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] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 144 ~ } else if let Some() = spec.strip_prefix("<<") { [INFO] [stdout] 145 ~ let ver = .trim(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/dcf/mod.rs:148:23 [INFO] [stdout] | [INFO] [stdout] 148 | let ver = spec[1..].trim(); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/dcf/mod.rs:147:16 [INFO] [stdout] | [INFO] [stdout] 147 | } else if spec.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] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 147 ~ } else if let Some() = spec.strip_prefix('<') { [INFO] [stdout] 148 ~ let ver = .trim(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/dcf/mod.rs:189:12 [INFO] [stdout] | [INFO] [stdout] 189 | if spec.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!spec.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: length comparison to zero [INFO] [stdout] --> src/dcf/mod.rs:261:16 [INFO] [stdout] | [INFO] [stdout] 261 | if dep.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `dep.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: stripping a prefix manually [INFO] [stdout] --> src/dcf/mod.rs:320:13 [INFO] [stdout] | [INFO] [stdout] 320 | r_part[1..].trim().to_string() [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/dcf/mod.rs:319:17 [INFO] [stdout] | [INFO] [stdout] 319 | let r = if r_part.starts_with('R') { [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] 319 ~ let r = if let Some() = r_part.strip_prefix('R') { [INFO] [stdout] 320 ~ .trim().to_string() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/dcf/mod.rs:420:18 [INFO] [stdout] | [INFO] [stdout] 420 | .map(|b| DCFBuilt::from_str(b)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `DCFBuilt::from_str` [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: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/download.rs:119:67 [INFO] [stdout] | [INFO] [stdout] 119 | OUTPUT.error(&format!("HTTP error at {}: {}", url, err.to_string())); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `error!` args [INFO] [stdout] --> src/download.rs:120:52 [INFO] [stdout] | [INFO] [stdout] 120 | error!("HTTP error at {}: {}", url, err.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/download.rs:127:67 [INFO] [stdout] | [INFO] [stdout] 127 | OUTPUT.error(&format!("HTTP error at {}: {}", url, err.to_string())); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `error!` args [INFO] [stdout] --> src/download.rs:128:52 [INFO] [stdout] | [INFO] [stdout] 128 | error!("HTTP error at {}: {}", url, err.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [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/download.rs:135:5 [INFO] [stdout] | [INFO] [stdout] 135 | / match dir { [INFO] [stdout] 136 | | Some(dir) => { [INFO] [stdout] 137 | | match std::fs::create_dir_all(dir) { [INFO] [stdout] 138 | | Err(err) => { [INFO] [stdout] ... | [INFO] [stdout] 151 | | None => {} [INFO] [stdout] 152 | | }; [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 135 ~ if let Some(dir) = dir { [INFO] [stdout] 136 + match std::fs::create_dir_all(dir) { [INFO] [stdout] 137 + Err(err) => { [INFO] [stdout] 138 + let dir = dir.to_str().unwrap_or_else(|| "???"); [INFO] [stdout] 139 + OUTPUT.error(&format!( [INFO] [stdout] 140 + "Cannot create directory {}: {}", [INFO] [stdout] 141 + dir, [INFO] [stdout] 142 + err.to_string() [INFO] [stdout] 143 + )); [INFO] [stdout] 144 + error!("Cannot create directory {}: {}", dir, err.to_string()); [INFO] [stdout] 145 + bail!("Cannot create directory {}: {}", dir, err.to_string()) [INFO] [stdout] 146 + } [INFO] [stdout] 147 + _ => {} [INFO] [stdout] 148 + }; [INFO] [stdout] 149 ~ }; [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/download.rs:137:13 [INFO] [stdout] | [INFO] [stdout] 137 | / match std::fs::create_dir_all(dir) { [INFO] [stdout] 138 | | Err(err) => { [INFO] [stdout] 139 | | let dir = dir.to_str().unwrap_or_else(|| "???"); [INFO] [stdout] 140 | | OUTPUT.error(&format!( [INFO] [stdout] ... | [INFO] [stdout] 148 | | _ => {} [INFO] [stdout] 149 | | }; [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 137 ~ if let Err(err) = std::fs::create_dir_all(dir) { [INFO] [stdout] 138 + let dir = dir.to_str().unwrap_or_else(|| "???"); [INFO] [stdout] 139 + OUTPUT.error(&format!( [INFO] [stdout] 140 + "Cannot create directory {}: {}", [INFO] [stdout] 141 + dir, [INFO] [stdout] 142 + err.to_string() [INFO] [stdout] 143 + )); [INFO] [stdout] 144 + error!("Cannot create directory {}: {}", dir, err.to_string()); [INFO] [stdout] 145 + bail!("Cannot create directory {}: {}", dir, err.to_string()) [INFO] [stdout] 146 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used to substitute value for `Option::None` [INFO] [stdout] --> src/download.rs:139:31 [INFO] [stdout] | [INFO] [stdout] 139 | let dir = dir.to_str().unwrap_or_else(|| "???"); [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] help: use `unwrap_or` instead [INFO] [stdout] | [INFO] [stdout] 139 - let dir = dir.to_str().unwrap_or_else(|| "???"); [INFO] [stdout] 139 + let dir = dir.to_str().unwrap_or("???"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/download.rs:143:28 [INFO] [stdout] | [INFO] [stdout] 143 | err.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `error!` args [INFO] [stdout] --> src/download.rs:145:70 [INFO] [stdout] | [INFO] [stdout] 145 | error!("Cannot create directory {}: {}", dir, err.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/download.rs:153:29 [INFO] [stdout] | [INFO] [stdout] 153 | let file = File::create(&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: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/download.rs:160:20 [INFO] [stdout] | [INFO] [stdout] 160 | err.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `error!` args [INFO] [stdout] --> src/download.rs:165:20 [INFO] [stdout] | [INFO] [stdout] 165 | err.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/download.rs:180:71 [INFO] [stdout] | [INFO] [stdout] 180 | OUTPUT.error(&format!("HTTP error at {}: {}", url, err.to_string())); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `error!` args [INFO] [stdout] --> src/download.rs:181:56 [INFO] [stdout] | [INFO] [stdout] 181 | error!("HTTP error at {}: {}", url, err.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [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/download.rs:185:9 [INFO] [stdout] | [INFO] [stdout] 185 | / match file.write(&chunk) { [INFO] [stdout] 186 | | Err(err) => { [INFO] [stdout] 187 | | OUTPUT.error(&format!( [INFO] [stdout] 188 | | "Failed to write to file {}: {}", [INFO] [stdout] ... | [INFO] [stdout] 203 | | _ => {} [INFO] [stdout] 204 | | }; [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 185 ~ if let Err(err) = file.write(&chunk) { [INFO] [stdout] 186 + OUTPUT.error(&format!( [INFO] [stdout] 187 + "Failed to write to file {}: {}", [INFO] [stdout] 188 + path.display(), [INFO] [stdout] 189 + err.to_string() [INFO] [stdout] 190 + )); [INFO] [stdout] 191 + error!( [INFO] [stdout] 192 + "Failed to write to file {}: {}", [INFO] [stdout] 193 + path.display(), [INFO] [stdout] 194 + err.to_string() [INFO] [stdout] 195 + ); [INFO] [stdout] 196 + bail!( [INFO] [stdout] 197 + "Failed to write to file {}: {}", [INFO] [stdout] 198 + path.display(), [INFO] [stdout] 199 + err.to_string() [INFO] [stdout] 200 + ) [INFO] [stdout] 201 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/download.rs:190:24 [INFO] [stdout] | [INFO] [stdout] 190 | err.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `error!` args [INFO] [stdout] --> src/download.rs:195:24 [INFO] [stdout] | [INFO] [stdout] 195 | err.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [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/download.rs:207:5 [INFO] [stdout] | [INFO] [stdout] 207 | / match std::fs::rename(Path::new(&path), Path::new(&opath)) { [INFO] [stdout] 208 | | Err(err) => { [INFO] [stdout] 209 | | OUTPUT.error(&format!( [INFO] [stdout] 210 | | "Failed to rename downloaded file: {}", [INFO] [stdout] ... | [INFO] [stdout] 216 | | _ => {} [INFO] [stdout] 217 | | }; [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 207 ~ if let Err(err) = std::fs::rename(Path::new(&path), Path::new(&opath)) { [INFO] [stdout] 208 + OUTPUT.error(&format!( [INFO] [stdout] 209 + "Failed to rename downloaded file: {}", [INFO] [stdout] 210 + err.to_string() [INFO] [stdout] 211 + )); [INFO] [stdout] 212 + error!("Failed to rename downloaded file: {}", err.to_string()); [INFO] [stdout] 213 + bail!("Failed to rename downloaded file: {}", err.to_string()) [INFO] [stdout] 214 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/download.rs:211:20 [INFO] [stdout] | [INFO] [stdout] 211 | err.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `error!` args [INFO] [stdout] --> src/download.rs:213:63 [INFO] [stdout] | [INFO] [stdout] 213 | error!("Failed to rename downloaded file: {}", err.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/download.rs:226:5 [INFO] [stdout] | [INFO] [stdout] 226 | return Ok(resp); [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] 226 - return Ok(resp); [INFO] [stdout] 226 + Ok(resp) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/download.rs:392:6 [INFO] [stdout] | [INFO] [stdout] 392 | ) -> Vec), Box>> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/download.rs:412:6 [INFO] [stdout] | [INFO] [stdout] 412 | ) -> Vec), Box>> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/download.rs:555:68 [INFO] [stdout] | [INFO] [stdout] 555 | OUTPUT.error(&format!("Cannot download JSON: {}", e.to_string())); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `error!` args [INFO] [stdout] --> src/download.rs:556:53 [INFO] [stdout] | [INFO] [stdout] 556 | error!("Cannot download JSON: {}", e.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/download.rs:621:9 [INFO] [stdout] | [INFO] [stdout] 621 | assert_eq!(results[0].as_ref().unwrap().0, true); // Downloaded [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_assert_comparison)]` on by default [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 621 - assert_eq!(results[0].as_ref().unwrap().0, true); // Downloaded [INFO] [stdout] 621 + assert!(results[0].as_ref().unwrap().0); // Downloaded [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/download.rs:622:9 [INFO] [stdout] | [INFO] [stdout] 622 | assert_eq!(results[1].as_ref().unwrap().0, true); // Downloaded [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 622 - assert_eq!(results[1].as_ref().unwrap().0, true); // Downloaded [INFO] [stdout] 622 + assert!(results[1].as_ref().unwrap().0); // Downloaded [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/download.rs:664:9 [INFO] [stdout] | [INFO] [stdout] 664 | assert_eq!(results[0].as_ref().unwrap().0, true); // Downloaded from fallback URL [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 664 - assert_eq!(results[0].as_ref().unwrap().0, true); // Downloaded from fallback URL [INFO] [stdout] 664 + assert!(results[0].as_ref().unwrap().0); // Downloaded from fallback URL [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/download.rs:716:9 [INFO] [stdout] | [INFO] [stdout] 716 | assert_eq!(results[0].as_ref().unwrap().0, true); // Success [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 716 - assert_eq!(results[0].as_ref().unwrap().0, true); // Success [INFO] [stdout] 716 + assert!(results[0].as_ref().unwrap().0); // Success [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/download.rs:761:9 [INFO] [stdout] | [INFO] [stdout] 761 | assert_eq!(results[0].as_ref().unwrap().0, false); // Cached, not downloaded [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 761 - assert_eq!(results[0].as_ref().unwrap().0, false); // Cached, not downloaded [INFO] [stdout] 761 + assert!(!results[0].as_ref().unwrap().0); // Cached, not downloaded [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/install.rs:164:5 [INFO] [stdout] | [INFO] [stdout] 164 | / async fn try_start_packages

( [INFO] [stdout] 165 | | package_map: Arc>, [INFO] [stdout] 166 | | installed: Arc>>, [INFO] [stdout] 167 | | failed: Arc>>, [INFO] [stdout] ... | [INFO] [stdout] 174 | | where [INFO] [stdout] 175 | | P: Fn(&str) + Send + Sync + 'static, [INFO] [stdout] | |____________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] = note: `#[warn(clippy::too_many_arguments)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual arithmetic check found [INFO] [stdout] --> src/install.rs:291:25 [INFO] [stdout] | [INFO] [stdout] 291 | let can_start = if currently_running < max_concurrent { [INFO] [stdout] | _________________________^ [INFO] [stdout] 292 | | max_concurrent - currently_running [INFO] [stdout] 293 | | } else { [INFO] [stdout] 294 | | 0 [INFO] [stdout] 295 | | }; [INFO] [stdout] | |_________^ help: replace it with: `max_concurrent.saturating_sub(currently_running)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_saturating_sub [INFO] [stdout] = note: `#[warn(clippy::implicit_saturating_sub)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/library.rs:198:45 [INFO] [stdout] | [INFO] [stdout] 198 | let _ = std::fs::remove_dir_all(&dir.as_path()); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `dir.as_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: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/library.rs:302:18 [INFO] [stdout] | [INFO] [stdout] 302 | e.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `error!` args [INFO] [stdout] --> src/library.rs:307:18 [INFO] [stdout] | [INFO] [stdout] 307 | e.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/library.rs:320:8 [INFO] [stdout] | [INFO] [stdout] 320 | if idx_start.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `idx_start.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/library.rs:346:39 [INFO] [stdout] | [INFO] [stdout] 346 | let rprofile = get_system_profile(&rver)?; [INFO] [stdout] | ^^^^^ help: change this to: `rver` [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: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/library.rs:353:18 [INFO] [stdout] | [INFO] [stdout] 353 | e.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `error!` args [INFO] [stdout] --> src/library.rs:358:18 [INFO] [stdout] | [INFO] [stdout] 358 | e.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [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/library.rs:421:9 [INFO] [stdout] | [INFO] [stdout] 421 | / match append_to_file(&rprofile, vec![newlines.to_string()]) { [INFO] [stdout] 422 | | Err(e) => { [INFO] [stdout] 423 | | OUTPUT.error(&format!( [INFO] [stdout] 424 | | "Cannot update file {}: {}", [INFO] [stdout] ... | [INFO] [stdout] 441 | | _ => {} [INFO] [stdout] 442 | | }; [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 421 ~ if let Err(e) = append_to_file(&rprofile, vec![newlines.to_string()]) { [INFO] [stdout] 422 + OUTPUT.error(&format!( [INFO] [stdout] 423 + "Cannot update file {}: {}", [INFO] [stdout] 424 + rprofile.display(), [INFO] [stdout] 425 + e.to_string() [INFO] [stdout] 426 + )); [INFO] [stdout] 427 + error!( [INFO] [stdout] 428 + "Cannot update file {}: {}", [INFO] [stdout] 429 + rprofile.display(), [INFO] [stdout] 430 + e.to_string() [INFO] [stdout] 431 + ); [INFO] [stdout] 432 + bail!( [INFO] [stdout] 433 + "Cannot update file {} @{}:{}, {}", [INFO] [stdout] 434 + rprofile.display(), [INFO] [stdout] 435 + file!(), [INFO] [stdout] 436 + line!(), [INFO] [stdout] 437 + e.to_string() [INFO] [stdout] 438 + ); [INFO] [stdout] 439 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/library.rs:426:22 [INFO] [stdout] | [INFO] [stdout] 426 | e.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `error!` args [INFO] [stdout] --> src/library.rs:431:22 [INFO] [stdout] | [INFO] [stdout] 431 | e.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/library.rs:462:18 [INFO] [stdout] | [INFO] [stdout] 462 | e.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `info!` args [INFO] [stdout] --> src/library.rs:466:18 [INFO] [stdout] | [INFO] [stdout] 466 | e.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/library.rs:488:18 [INFO] [stdout] | [INFO] [stdout] 488 | e.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `error!` args [INFO] [stdout] --> src/library.rs:493:18 [INFO] [stdout] | [INFO] [stdout] 493 | e.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/library.rs:504:23 [INFO] [stdout] | [INFO] [stdout] 504 | let def_path = if conf_lines.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!conf_lines.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: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/library.rs:543:20 [INFO] [stdout] | [INFO] [stdout] 543 | err.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `error!` args [INFO] [stdout] --> src/library.rs:548:20 [INFO] [stdout] | [INFO] [stdout] 548 | err.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/library.rs:582:26 [INFO] [stdout] | [INFO] [stdout] 582 | e.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `error!` args [INFO] [stdout] --> src/library.rs:586:26 [INFO] [stdout] | [INFO] [stdout] 586 | e.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/platform.rs:103:13 [INFO] [stdout] | [INFO] [stdout] 103 | id = if wid_line.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `wid_line.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/platform.rs:107:32 [INFO] [stdout] | [INFO] [stdout] 107 | let id = re_id.replace(&id_line, "").to_string(); [INFO] [stdout] | ^^^^^^^^ help: change this to: `id_line` [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: length comparison to zero [INFO] [stdout] --> src/platform.rs:113:14 [INFO] [stdout] | [INFO] [stdout] 113 | ver = if wver_line.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `wver_line.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/platform.rs:117:34 [INFO] [stdout] | [INFO] [stdout] 117 | let ver = re_ver.replace(&ver_line, "").to_string(); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `ver_line` [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: length comparison to zero [INFO] [stdout] --> src/proj.rs:60:8 [INFO] [stdout] | [INFO] [stdout] 60 | if desc.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `desc.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: comparison to empty slice [INFO] [stdout] --> src/proj.rs:136:28 [INFO] [stdout] | [INFO] [stdout] 136 | let comma = if cst == "" { "" } else { ", " }; [INFO] [stdout] | ^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `cst.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: comparison to empty slice [INFO] [stdout] --> src/proj.rs:146:16 [INFO] [stdout] | [INFO] [stdout] 146 | if cst != "" { [INFO] [stdout] | ^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!cst.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: use of `default` to create a unit struct [INFO] [stdout] --> src/proj.rs:211:30 [INFO] [stdout] | [INFO] [stdout] 211 | HashMap::with_hasher(rustc_hash::FxBuildHasher::default()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] = note: `#[warn(clippy::default_constructed_unit_structs)]` on by default [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 211 - HashMap::with_hasher(rustc_hash::FxBuildHasher::default()), [INFO] [stdout] 211 + HashMap::with_hasher(rustc_hash::FxBuildHasher), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `default` to create a unit struct [INFO] [stdout] --> src/proj.rs:219:34 [INFO] [stdout] | [INFO] [stdout] 219 | HashMap::with_hasher(rustc_hash::FxBuildHasher::default()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 219 - HashMap::with_hasher(rustc_hash::FxBuildHasher::default()), [INFO] [stdout] 219 + HashMap::with_hasher(rustc_hash::FxBuildHasher), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `default` to create a unit struct [INFO] [stdout] --> src/proj.rs:260:30 [INFO] [stdout] | [INFO] [stdout] 260 | HashMap::with_hasher(rustc_hash::FxBuildHasher::default()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 260 - HashMap::with_hasher(rustc_hash::FxBuildHasher::default()), [INFO] [stdout] 260 + HashMap::with_hasher(rustc_hash::FxBuildHasher), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `default` to create a unit struct [INFO] [stdout] --> src/proj.rs:268:34 [INFO] [stdout] | [INFO] [stdout] 268 | HashMap::with_hasher(rustc_hash::FxBuildHasher::default()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 268 - HashMap::with_hasher(rustc_hash::FxBuildHasher::default()), [INFO] [stdout] 268 + HashMap::with_hasher(rustc_hash::FxBuildHasher), [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/renv.rs:40:9 [INFO] [stdout] | [INFO] [stdout] 40 | / match ver { [INFO] [stdout] 41 | | InstalledVersion { [INFO] [stdout] 42 | | name: n, [INFO] [stdout] 43 | | version: Some(v), [INFO] [stdout] ... | [INFO] [stdout] 57 | | _ => {} [INFO] [stdout] 58 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 40 ~ if let InstalledVersion { [INFO] [stdout] 41 + name: n, [INFO] [stdout] 42 + version: Some(v), [INFO] [stdout] 43 + path: Some(p), [INFO] [stdout] 44 + binary: Some(b), [INFO] [stdout] 45 + aliases: _, [INFO] [stdout] 46 + } = ver { [INFO] [stdout] 47 + if let Ok(sv) = semver::Version::parse(v) { [INFO] [stdout] 48 + ok.push(OKInstalledVersion { [INFO] [stdout] 49 + name: n.to_string(), [INFO] [stdout] 50 + version: sv, [INFO] [stdout] 51 + path: p.to_string(), [INFO] [stdout] 52 + binary: b.to_string(), [INFO] [stdout] 53 + }); [INFO] [stdout] 54 + } [INFO] [stdout] 55 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/renv.rs:84:5 [INFO] [stdout] | [INFO] [stdout] 84 | let goodvers2: Vec; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `goodvers2` here and remove the assignments from the `match` arms [INFO] [stdout] | [INFO] [stdout] 84 ~ [INFO] [stdout] 85 ~ let goodvers2: Vec = match goodvers.iter().find(|v| v.version.patch == ver.patch) { [INFO] [stdout] 86 | Some(_) => { [INFO] [stdout] 87 ~ goodvers [INFO] [stdout] 88 | .into_iter() [INFO] [stdout] 89 | .filter(|v| v.version.patch == ver.patch) [INFO] [stdout] 90 ~ .collect() [INFO] [stdout] 91 | } [INFO] [stdout] 92 ~ None => goodvers, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/renv.rs:96:5 [INFO] [stdout] | [INFO] [stdout] 96 | let goodvers3: Vec; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `goodvers3` here and remove the assignments from the `match` arms [INFO] [stdout] | [INFO] [stdout] 96 ~ [INFO] [stdout] 97 ~ let goodvers3: Vec = match goodvers2.iter().find(|v| v.name.ends_with("-arm64")) { [INFO] [stdout] 98 | Some(_) => { [INFO] [stdout] 99 ~ goodvers2 [INFO] [stdout] 100 | .into_iter() [INFO] [stdout] 101 | .filter(|v| v.name.ends_with("-arm64")) [INFO] [stdout] 102 ~ .collect() [INFO] [stdout] 103 | } [INFO] [stdout] 104 ~ None => goodvers2, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/repos/repos_available.rs:33:36 [INFO] [stdout] | [INFO] [stdout] 33 | let comma = if extra != "" { ", " } else { "" }; [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!extra.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: comparison to empty slice [INFO] [stdout] --> src/repos/repos_available.rs:37:36 [INFO] [stdout] | [INFO] [stdout] 37 | let comma = if extra != "" { ", " } else { "" }; [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!extra.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: comparison to empty slice [INFO] [stdout] --> src/repos/repos_available.rs:40:20 [INFO] [stdout] | [INFO] [stdout] 40 | if extra != "" { [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!extra.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: this expression can be written more simply using `.retain()` [INFO] [stdout] --> src/repos/repos_list.rs:26:9 [INFO] [stdout] | [INFO] [stdout] 26 | repos = repos.into_iter().filter(|x| x.default).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.retain()` instead: `repos.retain(|x| x.default)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_retain [INFO] [stdout] = note: `#[warn(clippy::manual_retain)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/repos/repos_list.rs:28:5 [INFO] [stdout] | [INFO] [stdout] 28 | repos.sort_by(|a, b| b.default.cmp(&a.default)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] = note: `#[warn(clippy::unnecessary_sort_by)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 28 - repos.sort_by(|a, b| b.default.cmp(&a.default)); [INFO] [stdout] 28 + repos.sort_by_key(|b| std::cmp::Reverse(b.default)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/repos/cranlike_metadata.rs:225:22 [INFO] [stdout] | [INFO] [stdout] 225 | let is_rds = (data[0] == 0x58 && data[1] == 0x00) // X format [INFO] [stdout] | ______________________^ [INFO] [stdout] 226 | | || (data[0] == 0x41 && data[1] == 0x00) // A format [INFO] [stdout] 227 | | || (data[0] == 0x42 && data[1] == 0x00); // B format [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] 225 - let is_rds = (data[0] == 0x58 && data[1] == 0x00) // X format [INFO] [stdout] 226 - || (data[0] == 0x41 && data[1] == 0x00) // A format [INFO] [stdout] 227 - || (data[0] == 0x42 && data[1] == 0x00); // B format [INFO] [stdout] 225 + let is_rds = !(data[1] != 0x00 || data[0] != 0x58 && data[0] != 0x41 && data[0] != 0x42); // B format [INFO] [stdout] | [INFO] [stdout] 225 - let is_rds = (data[0] == 0x58 && data[1] == 0x00) // X format [INFO] [stdout] 226 - || (data[0] == 0x41 && data[1] == 0x00) // A format [INFO] [stdout] 227 - || (data[0] == 0x42 && data[1] == 0x00); // B format [INFO] [stdout] 225 + let is_rds = (data[0] == 0x42 || data[0] == 0x41 || data[0] == 0x58) && data[1] == 0x00; // B format [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/repos/cranlike_metadata.rs:225:22 [INFO] [stdout] | [INFO] [stdout] 225 | let is_rds = (data[0] == 0x58 && data[1] == 0x00) // X format [INFO] [stdout] | ______________________^ [INFO] [stdout] 226 | | || (data[0] == 0x41 && data[1] == 0x00) // A format [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] help: try [INFO] [stdout] | [INFO] [stdout] 225 - let is_rds = (data[0] == 0x58 && data[1] == 0x00) // X format [INFO] [stdout] 226 - || (data[0] == 0x41 && data[1] == 0x00) // A format [INFO] [stdout] 225 + let is_rds = !(data[1] != 0x00 || data[0] != 0x58 && data[0] != 0x41) // A format [INFO] [stdout] | [INFO] [stdout] 225 - let is_rds = (data[0] == 0x58 && data[1] == 0x00) // X format [INFO] [stdout] 226 - || (data[0] == 0x41 && data[1] == 0x00) // A format [INFO] [stdout] 225 + let is_rds = (data[0] == 0x41 || data[0] == 0x58) && data[1] == 0x00 // A format [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Option` [INFO] [stdout] --> src/repos/cranlike_metadata.rs:566:22 [INFO] [stdout] | [INFO] [stdout] 566 | .map(|s| serde_json::from_str(&s).ok()) [INFO] [stdout] | ______________________^ [INFO] [stdout] 567 | | .flatten(), [INFO] [stdout] | |______________________________^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|s| serde_json::from_str(&s).ok())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] = note: `#[warn(clippy::map_flatten)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Option` [INFO] [stdout] --> src/repos/cranlike_metadata.rs:640:14 [INFO] [stdout] | [INFO] [stdout] 640 | .map(|b| serde_json::to_string(b).ok()) [INFO] [stdout] | ______________^ [INFO] [stdout] 641 | | .flatten(); [INFO] [stdout] | |______________________^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|b| serde_json::to_string(b).ok())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&PathBuf` instead of `&Path` involves a new object where a slice will do [INFO] [stdout] --> src/repos/cranlike_metadata.rs:667:27 [INFO] [stdout] | [INFO] [stdout] 667 | fn repo_db_file(dcf_path: &PathBuf) -> 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] 667 - fn repo_db_file(dcf_path: &PathBuf) -> Result> { [INFO] [stdout] 667 + fn repo_db_file(dcf_path: &Path) -> Result> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/repos/cranlike_metadata.rs:700:17 [INFO] [stdout] | [INFO] [stdout] 700 | assert!(packages.len() > 0, "Expected at least one package"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!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: length comparison to zero [INFO] [stdout] --> src/repos/cranlike_metadata.rs:719:17 [INFO] [stdout] | [INFO] [stdout] 719 | assert!(packages.len() > 0, "Expected at least one package"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!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: length comparison to zero [INFO] [stdout] --> src/repos/cranlike_metadata.rs:738:17 [INFO] [stdout] | [INFO] [stdout] 738 | assert!(first_pkg.version.to_string().len() > 0); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!first_pkg.version.to_string().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/repos/setup.rs:165:44 [INFO] [stdout] | [INFO] [stdout] 165 | let mut profile_lines = read_lines(&Path::new(&profile))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `Path::new(&profile)` [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: length comparison to zero [INFO] [stdout] --> src/repos/setup.rs:168:12 [INFO] [stdout] | [INFO] [stdout] 168 | if grep_lines( [INFO] [stdout] | ____________^ [INFO] [stdout] 169 | | &Regex::new(&HC_PROFILE_REPOS_MARKERS.current_start.to_string())?, [INFO] [stdout] 170 | | &profile_lines, [INFO] [stdout] ... | [INFO] [stdout] 173 | | > 0 [INFO] [stdout] | |_______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] help: using `!is_empty` is clearer and more explicit [INFO] [stdout] | [INFO] [stdout] 168 ~ if !grep_lines( [INFO] [stdout] 169 + &Regex::new(&HC_PROFILE_REPOS_MARKERS.current_start.to_string())?, [INFO] [stdout] 170 + &profile_lines, [INFO] [stdout] 171 + ).is_empty() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/repos/setup.rs:191:19 [INFO] [stdout] | [INFO] [stdout] 191 | } else if start.len() == 0 && end.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `start.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: length comparison to zero [INFO] [stdout] --> src/repos/setup.rs:191:39 [INFO] [stdout] | [INFO] [stdout] 191 | } else if start.len() == 0 && end.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `end.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: called `unwrap` on `entry.platforms` after checking its variant with `is_some` [INFO] [stdout] --> src/repos/setup.rs:231:25 [INFO] [stdout] | [INFO] [stdout] 220 | if entry.platforms.is_some() { [INFO] [stdout] | ---------------------------- help: try: `if let Some() = &entry.platforms` [INFO] [stdout] ... [INFO] [stdout] 231 | for platform in entry.platforms.as_ref().unwrap().iter() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `entry.archs` after checking its variant with `is_some` [INFO] [stdout] --> src/repos/setup.rs:264:21 [INFO] [stdout] | [INFO] [stdout] 262 | if entry.archs.is_some() { [INFO] [stdout] | ------------------------ help: try: `if let Some() = &entry.archs` [INFO] [stdout] 263 | let mut ok = false; [INFO] [stdout] 264 | for arch in entry.archs.as_ref().unwrap().iter() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `entry.rversions` after checking its variant with `is_some` [INFO] [stdout] --> src/repos/setup.rs:279:27 [INFO] [stdout] | [INFO] [stdout] 277 | if entry.rversions.is_some() { [INFO] [stdout] | ---------------------------- help: try: `if let Some() = &entry.rversions` [INFO] [stdout] 278 | let mut ok = false; [INFO] [stdout] 279 | for constraint in entry.rversions.as_ref().unwrap().iter() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/repos/setup.rs:225:31 [INFO] [stdout] | [INFO] [stdout] 225 | rdata_platform += &p; [INFO] [stdout] | ^^ help: change this to: `p` [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/repos/setup.rs:229:31 [INFO] [stdout] | [INFO] [stdout] 229 | rdata_platform += &r; [INFO] [stdout] | ^^ help: change this to: `r` [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: length comparison to zero [INFO] [stdout] --> src/repos/setup.rs:334:8 [INFO] [stdout] | [INFO] [stdout] 334 | if bltidx.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `bltidx.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: comparison to empty slice [INFO] [stdout] --> src/repos/setup.rs:382:8 [INFO] [stdout] | [INFO] [stdout] 382 | if arch == "" { [INFO] [stdout] | ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `arch.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: taken reference of right operand [INFO] [stdout] --> src/repos/crandb.rs:16:19 [INFO] [stdout] | [INFO] [stdout] 16 | let mut url = "https://crandb.r-pkg.org/".to_string() + &package; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-------- [INFO] [stdout] | | [INFO] [stdout] | help: use the right value directly: `package` [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/repos/crandb.rs:16:61 [INFO] [stdout] | [INFO] [stdout] 16 | let mut url = "https://crandb.r-pkg.org/".to_string() + &package; [INFO] [stdout] | ^^^^^^^^ help: change this to: `package` [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: taken reference of right operand [INFO] [stdout] --> src/repos/crandb.rs:24:16 [INFO] [stdout] | [INFO] [stdout] 24 | local.push("package-".to_string() + &package + "-" + version + ".json"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^-------- [INFO] [stdout] | | [INFO] [stdout] | help: use the right value directly: `package` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/repos/crandb.rs:24:41 [INFO] [stdout] | [INFO] [stdout] 24 | local.push("package-".to_string() + &package + "-" + version + ".json"); [INFO] [stdout] | ^^^^^^^^ help: change this to: `package` [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: taken reference of right operand [INFO] [stdout] --> src/repos/crandb.rs:50:15 [INFO] [stdout] | [INFO] [stdout] 50 | let url = "https://crandb.r-pkg.org/".to_string() + &package + "/" + "all"; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-------- [INFO] [stdout] | | [INFO] [stdout] | help: use the right value directly: `package` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/repos/crandb.rs:50:57 [INFO] [stdout] | [INFO] [stdout] 50 | let url = "https://crandb.r-pkg.org/".to_string() + &package + "/" + "all"; [INFO] [stdout] | ^^^^^^^^ help: change this to: `package` [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: taken reference of right operand [INFO] [stdout] --> src/repos/crandb.rs:53:16 [INFO] [stdout] | [INFO] [stdout] 53 | local.push("package-".to_string() + &package + ".json"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^-------- [INFO] [stdout] | | [INFO] [stdout] | help: use the right value directly: `package` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/repos/crandb.rs:53:41 [INFO] [stdout] | [INFO] [stdout] 53 | local.push("package-".to_string() + &package + ".json"); [INFO] [stdout] | ^^^^^^^^ help: change this to: `package` [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/repositories.rs:164:6 [INFO] [stdout] | [INFO] [stdout] 164 | ) -> Result<(Vec<(usize, String)>, Option>, Vec>), Box> [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `headers` after checking its variant with `is_some` [INFO] [stdout] --> src/repositories.rs:270:50 [INFO] [stdout] | [INFO] [stdout] 269 | if !header_written && headers.is_some() { [INFO] [stdout] | ----------------- the check is happening here [INFO] [stdout] 270 | let header_line = format_tsv_row(headers.as_ref().unwrap())?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/resolve.rs:65:75 [INFO] [stdout] | [INFO] [stdout] 65 | OUTPUT.error(&format!("Failed to resolve R version: {}", x.to_string())); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `error!` args [INFO] [stdout] --> src/resolve.rs:66:60 [INFO] [stdout] | [INFO] [stdout] 66 | error!("Failed to resolve R version: {}", x.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match can be simplified with `.unwrap_or_default()` [INFO] [stdout] --> src/resolve.rs:92:15 [INFO] [stdout] | [INFO] [stdout] 92 | let ppm = match resp["ppm-binaries"].as_bool() { [INFO] [stdout] | _______________^ [INFO] [stdout] 93 | | Some(v) => v, [INFO] [stdout] 94 | | None => false, [INFO] [stdout] 95 | | }; [INFO] [stdout] | |_____^ help: ascribe the type bool and replace your expression with: `resp["ppm-binaries"].as_bool().unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/resolve.rs:96:18 [INFO] [stdout] | [INFO] [stdout] 96 | let ppmurl = match resp["ppm-binary-url"].as_str() { [INFO] [stdout] | __________________^ [INFO] [stdout] 97 | | Some(v) => Some(v.to_string()), [INFO] [stdout] 98 | | None => None, [INFO] [stdout] 99 | | }; [INFO] [stdout] | |_____^ help: try: `resp["ppm-binary-url"].as_str().map(|v| v.to_string())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/run.rs:67:53 [INFO] [stdout] | [INFO] [stdout] 67 | let cmdline = Regex::new("[\n\r]")?.replace_all(&command, "").to_string(); [INFO] [stdout] | ^^^^^^^^ help: change this to: `command` [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/run.rs:71:16 [INFO] [stdout] | [INFO] [stdout] 71 | r_sudo(&version, &cmdline, &user) [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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/run.rs:74:18 [INFO] [stdout] | [INFO] [stdout] 74 | r_nosudo(&version, &cmdline) [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: writing `&PathBuf` instead of `&Path` involves a new object where a slice will do [INFO] [stdout] --> src/rversion.rs:90:11 [INFO] [stdout] | [INFO] [stdout] 90 | path: &std::path::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] 90 - path: &std::path::PathBuf, [INFO] [stdout] 90 + path: &Path, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `default` to create a unit struct [INFO] [stdout] --> src/solver.rs:56:44 [INFO] [stdout] | [INFO] [stdout] 56 | let mut vranges = HashMap::with_hasher(rustc_hash::FxBuildHasher::default()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 56 - let mut vranges = HashMap::with_hasher(rustc_hash::FxBuildHasher::default()); [INFO] [stdout] 56 + let mut vranges = HashMap::with_hasher(rustc_hash::FxBuildHasher); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/solver.rs:58:69 [INFO] [stdout] | [INFO] [stdout] 58 | if !dev && dep.types.iter().all(|x| DEP_TYPES_SOFT.contains(&x)) { [INFO] [stdout] | ^^ help: change this to: `x` [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/solver.rs:96:11 [INFO] [stdout] | [INFO] [stdout] 96 | deps: RefCell< [INFO] [stdout] | ___________^ [INFO] [stdout] 97 | | HashMap< [INFO] [stdout] 98 | | (RPackageName, RegistryPackageVersion), [INFO] [stdout] 99 | | HashMap, [INFO] [stdout] 100 | | >, [INFO] [stdout] 101 | | >, [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [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/solver.rs:202:13 [INFO] [stdout] | [INFO] [stdout] 202 | / match self.get_all_versions(package) { [INFO] [stdout] 203 | | Err(_) => return Err(ProviderError::UnknownPackage), [INFO] [stdout] 204 | | _ => {} [INFO] [stdout] 205 | | }; [INFO] [stdout] | |_____________^ help: try: `if let Err(_) = self.get_all_versions(package) { return Err(ProviderError::UnknownPackage) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [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/solver.rs:230:9 [INFO] [stdout] | [INFO] [stdout] 230 | / match self.get_all_versions(package) { [INFO] [stdout] 231 | | Err(_) => return Err(ProviderError::UnknownPackage), [INFO] [stdout] 232 | | _ => {} [INFO] [stdout] 233 | | }; [INFO] [stdout] | |_________^ help: try: `if let Err(_) = self.get_all_versions(package) { return Err(ProviderError::UnknownPackage) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `rsplitn` [INFO] [stdout] --> src/utils.rs:40:5 [INFO] [stdout] | [INFO] [stdout] 40 | path.rsplitn(2, '/').next() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try: `path.rsplit('/')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_splitn [INFO] [stdout] = note: `#[warn(clippy::needless_splitn)]` 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/utils.rs:58:38 [INFO] [stdout] | [INFO] [stdout] 58 | pub fn grep_lines(re: &Regex, lines: &Vec) -> 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] 58 - pub fn grep_lines(re: &Regex, lines: &Vec) -> Vec { [INFO] [stdout] 58 + pub fn grep_lines(re: &Regex, lines: &[String]) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `write!()` with a format string that ends in a single newline [INFO] [stdout] --> src/utils.rs:112:9 [INFO] [stdout] | [INFO] [stdout] 112 | write!(f, "{}\n", line)?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_with_newline [INFO] [stdout] = note: `#[warn(clippy::write_with_newline)]` on by default [INFO] [stdout] help: use `writeln!` instead [INFO] [stdout] | [INFO] [stdout] 112 - write!(f, "{}\n", line)?; [INFO] [stdout] 112 + writeln!(f, "{}", line)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `write!()` with a format string that ends in a single newline [INFO] [stdout] --> src/utils.rs:115:9 [INFO] [stdout] | [INFO] [stdout] 115 | write!(f, "{}\n", line)?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_with_newline [INFO] [stdout] help: use `writeln!` instead [INFO] [stdout] | [INFO] [stdout] 115 - write!(f, "{}\n", line)?; [INFO] [stdout] 115 + writeln!(f, "{}", line)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/utils.rs:185:19 [INFO] [stdout] | [INFO] [stdout] 185 | Err(_) => return 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] 185 - Err(_) => return false, [INFO] [stdout] 185 + Err(_) => false, [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/utils.rs:310:42 [INFO] [stdout] | [INFO] [stdout] 310 | pub fn create_parent_dir_if_needed(path: &PathBuf) -> Result<(), Box> { [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] 310 - pub fn create_parent_dir_if_needed(path: &PathBuf) -> Result<(), Box> { [INFO] [stdout] 310 + pub fn create_parent_dir_if_needed(path: &Path) -> Result<(), Box> { [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:144:5 [INFO] [stdout] | [INFO] [stdout] 144 | / match env_logger::Builder::from_env(env_logger::Env::default()) [INFO] [stdout] 145 | | .filter(None, loglevel) [INFO] [stdout] 146 | | .parse_filters(&filter_str) [INFO] [stdout] 147 | | .target(env_logger::Target::Stderr) [INFO] [stdout] ... | [INFO] [stdout] 207 | | _ => {} [INFO] [stdout] 208 | | }; [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] help: try [INFO] [stdout] | [INFO] [stdout] 144 ~ if let Err(e) = env_logger::Builder::from_env(env_logger::Env::default()) [INFO] [stdout] 145 + .filter(None, loglevel) [INFO] [stdout] 146 + .parse_filters(&filter_str) [INFO] [stdout] 147 + .target(env_logger::Target::Stderr) [INFO] [stdout] 148 + .format(move |buf, record| { [INFO] [stdout] 149 + // In interactive mode, write only to log file [INFO] [stdout] 150 + if is_interactive { [INFO] [stdout] 151 + if let Some(ref log_file) = log_file_for_format { [INFO] [stdout] 152 + if let Ok(mut file) = log_file.lock() { [INFO] [stdout] 153 + // Always include timestamps in log file [INFO] [stdout] 154 + let log_line = if verbose_count >= 1 { [INFO] [stdout] 155 + format!( [INFO] [stdout] 156 + "[{} {} {}:{}] {}\n", [INFO] [stdout] 157 + buf.timestamp(), [INFO] [stdout] 158 + record.level(), [INFO] [stdout] 159 + record.file().unwrap_or("unknown"), [INFO] [stdout] 160 + record.line().unwrap_or(0), [INFO] [stdout] 161 + record.args() [INFO] [stdout] 162 + ) [INFO] [stdout] 163 + } else { [INFO] [stdout] 164 + format!( [INFO] [stdout] 165 + "[{} {}] {}\n", [INFO] [stdout] 166 + buf.timestamp(), [INFO] [stdout] 167 + record.level(), [INFO] [stdout] 168 + record.args() [INFO] [stdout] 169 + ) [INFO] [stdout] 170 + }; [INFO] [stdout] 171 + let _ = file.write_all(log_line.as_bytes()); [INFO] [stdout] 172 + } [INFO] [stdout] 173 + } [INFO] [stdout] 174 + // Don't write to stderr in interactive mode [INFO] [stdout] 175 + Ok(()) [INFO] [stdout] 176 + } else { [INFO] [stdout] 177 + // Non-interactive: write to stderr with colors [INFO] [stdout] 178 + let level_string = match record.level() { [INFO] [stdout] 179 + Level::Error => record.level().to_string().red().bold().to_string(), [INFO] [stdout] 180 + Level::Warn => record.level().to_string().yellow().bold().to_string(), [INFO] [stdout] 181 + Level::Info => record.level().to_string().blue().to_string(), [INFO] [stdout] 182 + Level::Debug => record.level().to_string().cyan().to_string(), [INFO] [stdout] 183 + Level::Trace => record.level().to_string().white().to_string(), [INFO] [stdout] 184 + }; [INFO] [stdout] 185 + [INFO] [stdout] 186 + if verbose_count >= 1 { [INFO] [stdout] 187 + writeln!( [INFO] [stdout] 188 + buf, [INFO] [stdout] 189 + "[{} {} {}:{}] {}", [INFO] [stdout] 190 + buf.timestamp(), [INFO] [stdout] 191 + level_string, [INFO] [stdout] 192 + record.file().unwrap_or("unknown"), [INFO] [stdout] 193 + record.line().unwrap_or(0), [INFO] [stdout] 194 + record.args() [INFO] [stdout] 195 + ) [INFO] [stdout] 196 + } else { [INFO] [stdout] 197 + writeln!(buf, "[{}] {}", level_string, record.args()) [INFO] [stdout] 198 + } [INFO] [stdout] 199 + } [INFO] [stdout] 200 + }) [INFO] [stdout] 201 + .try_init() { [INFO] [stdout] 202 + eprintln!("Fatal error, cannot set up logger: {}", e.to_string()); [INFO] [stdout] 203 + return 2; [INFO] [stdout] 204 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `eprintln!` args [INFO] [stdout] --> src/main.rs:204:65 [INFO] [stdout] | [INFO] [stdout] 204 | eprintln!("Fatal error, cannot set up logger: {}", e.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `error!` args [INFO] [stdout] --> src/main.rs:227:29 [INFO] [stdout] | [INFO] [stdout] 227 | error!("{}", err.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 1m 36s [INFO] running `Command { std: "docker" "inspect" "094622ef169b37973a55704cb830f02739817916dd5010372f139ee27620fdd2", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "094622ef169b37973a55704cb830f02739817916dd5010372f139ee27620fdd2", kill_on_drop: false }` [INFO] [stdout] 094622ef169b37973a55704cb830f02739817916dd5010372f139ee27620fdd2