[INFO] cloning repository https://github.com/BaiqingL/aggressive_work_request [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/BaiqingL/aggressive_work_request" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FBaiqingL%2Faggressive_work_request", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FBaiqingL%2Faggressive_work_request'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 6c4e2da4253a529844d069bb3bbb7444f636d67d [INFO] linting BaiqingL/aggressive_work_request against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FBaiqingL%2Faggressive_work_request" "/workspace/builds/worker-6-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-6-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/BaiqingL/aggressive_work_request [INFO] finished tweaking git repo https://github.com/BaiqingL/aggressive_work_request [INFO] tweaked toml for git repo https://github.com/BaiqingL/aggressive_work_request written to /workspace/builds/worker-6-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/BaiqingL/aggressive_work_request 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/BaiqingL/aggressive_work_request 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] Blocking waiting for file lock on package cache [INFO] [stderr] Updating crates.io index [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded ordered-multimap v0.2.4 [INFO] [stderr] Downloaded rev_lines v0.2.1 [INFO] [stderr] Downloaded dlv-list v0.2.2 [INFO] [stderr] Downloaded const-random-macro v0.1.8 [INFO] [stderr] Downloaded proc-macro-hack v0.5.15 [INFO] [stderr] Downloaded const-random v0.1.8 [INFO] [stderr] Downloaded ahash v0.3.2 [INFO] [stderr] Downloaded hashbrown v0.7.1 [INFO] [stderr] Downloaded rust-ini v0.15.2 [INFO] [stderr] Downloaded chrono v0.4.11 [INFO] [stderr] Downloaded nix v0.17.0 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] da481cae5fbd1ab6409db30da1179927ef452ed46ad0e0a4c9a6acd1a05a1085 [INFO] running `Command { std: "docker" "start" "-a" "da481cae5fbd1ab6409db30da1179927ef452ed46ad0e0a4c9a6acd1a05a1085", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "da481cae5fbd1ab6409db30da1179927ef452ed46ad0e0a4c9a6acd1a05a1085", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "da481cae5fbd1ab6409db30da1179927ef452ed46ad0e0a4c9a6acd1a05a1085", kill_on_drop: false }` [INFO] [stdout] da481cae5fbd1ab6409db30da1179927ef452ed46ad0e0a4c9a6acd1a05a1085 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "clippy" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] a942c760395d688cd87d5cc64e90ad248ad348d94fe1475c44d649618e6dc430 [INFO] running `Command { std: "docker" "start" "-a" "a942c760395d688cd87d5cc64e90ad248ad348d94fe1475c44d649618e6dc430", kill_on_drop: false }` [INFO] [stderr] Compiling libc v0.2.69 [INFO] [stderr] Compiling getrandom v0.1.14 [INFO] [stderr] Compiling proc-macro-hack v0.5.15 [INFO] [stderr] Checking ppv-lite86 v0.2.6 [INFO] [stderr] Compiling hashbrown v0.7.1 [INFO] [stderr] Compiling nix v0.17.0 [INFO] [stderr] Checking rev_lines v0.2.1 [INFO] [stderr] Compiling const-random-macro v0.1.8 [INFO] [stderr] Checking time v0.1.42 [INFO] [stderr] Checking const-random v0.1.8 [INFO] [stderr] Checking rand_core v0.5.1 [INFO] [stderr] Checking ahash v0.3.2 [INFO] [stderr] Checking chrono v0.4.11 [INFO] [stderr] Checking rand_chacha v0.2.2 [INFO] [stderr] Checking rand v0.7.3 [INFO] [stderr] Checking dlv-list v0.2.2 [INFO] [stderr] Checking ordered-multimap v0.2.4 [INFO] [stderr] Checking rust-ini v0.15.2 [INFO] [stderr] Checking aggressive_work_request v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:65:41 [INFO] [stdout] | [INFO] [stdout] 65 | let state = find_slot_state(&slot, &log_location); [INFO] [stdout] | ^^^^^ help: change this to: `slot` [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/main.rs:65:48 [INFO] [stdout] | [INFO] [stdout] 65 | let state = find_slot_state(&slot, &log_location); [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `log_location` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:68:75 [INFO] [stdout] | [INFO] [stdout] 68 | if determine_download_exceed_limit(&download_timeout, &slot, &log_location) { [INFO] [stdout] | ^^^^^ help: change this to: `slot` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:68:82 [INFO] [stdout] | [INFO] [stdout] 68 | if determine_download_exceed_limit(&download_timeout, &slot, &log_location) { [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `log_location` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:72:67 [INFO] [stdout] | [INFO] [stdout] 72 | if determine_idle_exceed_limit(&idle_timeout, &slot, &log_location) { [INFO] [stdout] | ^^^^^ help: change this to: `slot` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:72:74 [INFO] [stdout] | [INFO] [stdout] 72 | if determine_idle_exceed_limit(&idle_timeout, &slot, &log_location) { [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `log_location` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:76:71 [INFO] [stdout] | [INFO] [stdout] 76 | if determine_upload_exceed_limit(&upload_timeout, &slot, &log_location) { [INFO] [stdout] | ^^^^^ help: change this to: `slot` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:76:78 [INFO] [stdout] | [INFO] [stdout] 76 | if determine_upload_exceed_limit(&upload_timeout, &slot, &log_location) { [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `log_location` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `ok().expect()` on a `Result` value [INFO] [stdout] --> src/main.rs:84:17 [INFO] [stdout] | [INFO] [stdout] 84 | / process::Command::new(&control_location) [INFO] [stdout] 85 | | .arg("reload") [INFO] [stdout] 86 | | .output() [INFO] [stdout] 87 | | .ok() [INFO] [stdout] 88 | | .expect("出错!"); [INFO] [stdout] | |____________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stdout] = note: `#[warn(clippy::ok_expect)]` on by default [INFO] [stdout] help: call `expect()` directly on the `Result` [INFO] [stdout] | [INFO] [stdout] 86 - .output() [INFO] [stdout] 87 - .ok() [INFO] [stdout] 88 - .expect("出错!"); [INFO] [stdout] 86 + .output().expect("出错!"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/main.rs:84:39 [INFO] [stdout] | [INFO] [stdout] 84 | process::Command::new(&control_location) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: change this to: `control_location` [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: this boolean expression can be simplified [INFO] [stdout] --> src/main.rs:187:16 [INFO] [stdout] | [INFO] [stdout] 187 | if line.contains(second_pattern) && !found_current_state [INFO] [stdout] | ________________^ [INFO] [stdout] 188 | | || line.contains(first_pattern) && !found_current_state [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] 187 - if line.contains(second_pattern) && !found_current_state [INFO] [stdout] 188 - || line.contains(first_pattern) && !found_current_state [INFO] [stdout] 187 + if !(found_current_state || !line.contains(second_pattern) && !line.contains(first_pattern)) [INFO] [stdout] | [INFO] [stdout] 187 - if line.contains(second_pattern) && !found_current_state [INFO] [stdout] 188 - || line.contains(first_pattern) && !found_current_state [INFO] [stdout] 187 + if (line.contains(first_pattern) || line.contains(second_pattern)) && !found_current_state [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/main.rs:186:9 [INFO] [stdout] | [INFO] [stdout] 186 | / if line.contains(slot_id) { [INFO] [stdout] 187 | | if line.contains(second_pattern) && !found_current_state [INFO] [stdout] 188 | | || line.contains(first_pattern) && !found_current_state [INFO] [stdout] ... | [INFO] [stdout] 202 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 186 ~ if line.contains(slot_id) [INFO] [stdout] 187 ~ && (line.contains(second_pattern) && !found_current_state [INFO] [stdout] 188 ~ || line.contains(first_pattern) && !found_current_state) [INFO] [stdout] 189 | { [INFO] [stdout] ... [INFO] [stdout] 200 | latest_action_time += hour_time * 3600 + minute_time * 60 + second_time; [INFO] [stdout] 201 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/main.rs:191:17 [INFO] [stdout] | [INFO] [stdout] 191 | let unparsed_time; [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] = note: `#[warn(clippy::needless_late_init)]` on by default [INFO] [stdout] help: move the declaration `unparsed_time` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 191 ~ [INFO] [stdout] 192 ~ let unparsed_time = if idle_check { [INFO] [stdout] 193 ~ line.to_string()[6..14].replace(":", "") [INFO] [stdout] 194 | } else { [INFO] [stdout] 195 ~ line.to_string()[..8].replace(":", "") [INFO] [stdout] 196 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:65:41 [INFO] [stdout] | [INFO] [stdout] 65 | let state = find_slot_state(&slot, &log_location); [INFO] [stdout] | ^^^^^ help: change this to: `slot` [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/main.rs:65:48 [INFO] [stdout] | [INFO] [stdout] 65 | let state = find_slot_state(&slot, &log_location); [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `log_location` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:68:75 [INFO] [stdout] | [INFO] [stdout] 68 | if determine_download_exceed_limit(&download_timeout, &slot, &log_location) { [INFO] [stdout] | ^^^^^ help: change this to: `slot` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:68:82 [INFO] [stdout] | [INFO] [stdout] 68 | if determine_download_exceed_limit(&download_timeout, &slot, &log_location) { [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `log_location` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:72:67 [INFO] [stdout] | [INFO] [stdout] 72 | if determine_idle_exceed_limit(&idle_timeout, &slot, &log_location) { [INFO] [stdout] | ^^^^^ help: change this to: `slot` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:72:74 [INFO] [stdout] | [INFO] [stdout] 72 | if determine_idle_exceed_limit(&idle_timeout, &slot, &log_location) { [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `log_location` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:76:71 [INFO] [stdout] | [INFO] [stdout] 76 | if determine_upload_exceed_limit(&upload_timeout, &slot, &log_location) { [INFO] [stdout] | ^^^^^ help: change this to: `slot` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:76:78 [INFO] [stdout] | [INFO] [stdout] 76 | if determine_upload_exceed_limit(&upload_timeout, &slot, &log_location) { [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `log_location` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `ok().expect()` on a `Result` value [INFO] [stdout] --> src/main.rs:84:17 [INFO] [stdout] | [INFO] [stdout] 84 | / process::Command::new(&control_location) [INFO] [stdout] 85 | | .arg("reload") [INFO] [stdout] 86 | | .output() [INFO] [stdout] 87 | | .ok() [INFO] [stdout] 88 | | .expect("出错!"); [INFO] [stdout] | |____________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ok_expect [INFO] [stdout] = note: `#[warn(clippy::ok_expect)]` on by default [INFO] [stdout] help: call `expect()` directly on the `Result` [INFO] [stdout] | [INFO] [stdout] 86 - .output() [INFO] [stdout] 87 - .ok() [INFO] [stdout] 88 - .expect("出错!"); [INFO] [stdout] 86 + .output().expect("出错!"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/main.rs:84:39 [INFO] [stdout] | [INFO] [stdout] 84 | process::Command::new(&control_location) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: change this to: `control_location` [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: this boolean expression can be simplified [INFO] [stdout] --> src/main.rs:187:16 [INFO] [stdout] | [INFO] [stdout] 187 | if line.contains(second_pattern) && !found_current_state [INFO] [stdout] | ________________^ [INFO] [stdout] 188 | | || line.contains(first_pattern) && !found_current_state [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] 187 - if line.contains(second_pattern) && !found_current_state [INFO] [stdout] 188 - || line.contains(first_pattern) && !found_current_state [INFO] [stdout] 187 + if !(found_current_state || !line.contains(second_pattern) && !line.contains(first_pattern)) [INFO] [stdout] | [INFO] [stdout] 187 - if line.contains(second_pattern) && !found_current_state [INFO] [stdout] 188 - || line.contains(first_pattern) && !found_current_state [INFO] [stdout] 187 + if (line.contains(first_pattern) || line.contains(second_pattern)) && !found_current_state [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/main.rs:186:9 [INFO] [stdout] | [INFO] [stdout] 186 | / if line.contains(slot_id) { [INFO] [stdout] 187 | | if line.contains(second_pattern) && !found_current_state [INFO] [stdout] 188 | | || line.contains(first_pattern) && !found_current_state [INFO] [stdout] ... | [INFO] [stdout] 202 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 186 ~ if line.contains(slot_id) [INFO] [stdout] 187 ~ && (line.contains(second_pattern) && !found_current_state [INFO] [stdout] 188 ~ || line.contains(first_pattern) && !found_current_state) [INFO] [stdout] 189 | { [INFO] [stdout] ... [INFO] [stdout] 200 | latest_action_time += hour_time * 3600 + minute_time * 60 + second_time; [INFO] [stdout] 201 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/main.rs:191:17 [INFO] [stdout] | [INFO] [stdout] 191 | let unparsed_time; [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] = note: `#[warn(clippy::needless_late_init)]` on by default [INFO] [stdout] help: move the declaration `unparsed_time` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 191 ~ [INFO] [stdout] 192 ~ let unparsed_time = if idle_check { [INFO] [stdout] 193 ~ line.to_string()[6..14].replace(":", "") [INFO] [stdout] 194 | } else { [INFO] [stdout] 195 ~ line.to_string()[..8].replace(":", "") [INFO] [stdout] 196 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 4.98s [INFO] running `Command { std: "docker" "inspect" "a942c760395d688cd87d5cc64e90ad248ad348d94fe1475c44d649618e6dc430", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "a942c760395d688cd87d5cc64e90ad248ad348d94fe1475c44d649618e6dc430", kill_on_drop: false }` [INFO] [stdout] a942c760395d688cd87d5cc64e90ad248ad348d94fe1475c44d649618e6dc430