[INFO] cloning repository https://github.com/markallenbattey/Newbie [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/markallenbattey/Newbie" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmarkallenbattey%2FNewbie", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmarkallenbattey%2FNewbie'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 73d2db1d73360edb6ed7aa7b53d56db0f9db2cf8 [INFO] linting markallenbattey/Newbie against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmarkallenbattey%2FNewbie" "/workspace/builds/worker-1-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-1-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/markallenbattey/Newbie [INFO] finished tweaking git repo https://github.com/markallenbattey/Newbie [INFO] tweaked toml for git repo https://github.com/markallenbattey/Newbie written to /workspace/builds/worker-1-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/markallenbattey/Newbie 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/markallenbattey/Newbie 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] Locking 5 packages to latest compatible versions [INFO] [stderr] Updating dirs v5.0.1 -> v6.0.0 [INFO] [stderr] Updating dirs-sys v0.4.1 -> v0.5.0 [INFO] [stderr] Updating redox_users v0.4.6 -> v0.5.2 [INFO] [stderr] Updating thiserror v1.0.69 -> v2.0.18 [INFO] [stderr] Updating thiserror-impl v1.0.69 -> v2.0.18 [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded ctrlc v3.5.0 [INFO] [stderr] Downloaded rustyline-derive v0.10.0 [INFO] [stderr] Downloaded rustyline v14.0.0 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-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] 1a2848eac0053854f73107e5e6d0999031dce36bd063bbe3e5133588fbeaad1a [INFO] running `Command { std: "docker" "start" "-a" "1a2848eac0053854f73107e5e6d0999031dce36bd063bbe3e5133588fbeaad1a", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "1a2848eac0053854f73107e5e6d0999031dce36bd063bbe3e5133588fbeaad1a", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "1a2848eac0053854f73107e5e6d0999031dce36bd063bbe3e5133588fbeaad1a", kill_on_drop: false }` [INFO] [stdout] 1a2848eac0053854f73107e5e6d0999031dce36bd063bbe3e5133588fbeaad1a [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-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] 5a1d5a32df2d719e0c06f683899080e4ca41ec85ab6d0031129143f0438fa60c [INFO] running `Command { std: "docker" "start" "-a" "5a1d5a32df2d719e0c06f683899080e4ca41ec85ab6d0031129143f0438fa60c", kill_on_drop: false }` [INFO] [stderr] Checking bitflags v2.9.4 [INFO] [stderr] Compiling hashbrown v0.16.0 [INFO] [stderr] Compiling rustix v1.1.2 [INFO] [stderr] Compiling proc-macro2 v1.0.101 [INFO] [stderr] Compiling toml_parser v1.0.4 [INFO] [stderr] Compiling toml_datetime v0.7.3 [INFO] [stderr] Checking unicode-ident v1.0.19 [INFO] [stderr] Compiling nix v0.30.1 [INFO] [stderr] Checking winnow v0.7.13 [INFO] [stderr] Compiling nix v0.28.0 [INFO] [stderr] Checking dirs-sys v0.5.0 [INFO] [stderr] Checking async-executor v1.13.3 [INFO] [stderr] Checking home v0.5.11 [INFO] [stderr] Checking dirs v6.0.0 [INFO] [stderr] Compiling indexmap v2.12.0 [INFO] [stderr] Compiling quote v1.0.40 [INFO] [stderr] Compiling syn v2.0.106 [INFO] [stderr] Compiling toml_edit v0.23.7 [INFO] [stderr] Checking ctrlc v3.5.0 [INFO] [stderr] Compiling proc-macro-crate v3.4.0 [INFO] [stderr] Checking polling v3.11.0 [INFO] [stderr] Checking fd-lock v4.0.4 [INFO] [stderr] Checking async-io v2.6.0 [INFO] [stderr] Compiling serde_derive v1.0.228 [INFO] [stderr] Compiling enumflags2_derive v0.7.12 [INFO] [stderr] Compiling tracing-attributes v0.1.30 [INFO] [stderr] Compiling serde_repr v0.1.20 [INFO] [stderr] Compiling async-trait v0.1.89 [INFO] [stderr] Compiling rustyline-derive v0.10.0 [INFO] [stderr] Checking async-signal v0.2.13 [INFO] [stderr] Checking async-process v2.5.0 [INFO] [stderr] Checking rustyline v14.0.0 [INFO] [stderr] Checking tracing v0.1.41 [INFO] [stderr] Compiling serde v1.0.228 [INFO] [stderr] Checking zvariant_utils v3.2.1 [INFO] [stderr] Checking enumflags2 v0.7.12 [INFO] [stderr] Checking uuid v1.18.1 [INFO] [stderr] Compiling zvariant_derive v5.8.0 [INFO] [stderr] Compiling zvariant v5.8.0 [INFO] [stderr] Checking zbus_names v4.2.0 [INFO] [stderr] Compiling zbus_macros v5.12.0 [INFO] [stderr] Checking zbus v5.12.0 [INFO] [stderr] Checking newbie v1.0.8 (/opt/rustwide/workdir) [INFO] [stdout] warning: initializer for `thread_local` value can be made `const` [INFO] [stdout] --> src/main.rs:200:46 [INFO] [stdout] | [INFO] [stdout] 200 | static RECURSION_DEPTH: RefCell = RefCell::new(0); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace with: `const { RefCell::new(0) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_thread_local [INFO] [stdout] = note: `#[warn(clippy::missing_const_for_thread_local)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: large size difference between variants [INFO] [stdout] --> src/main.rs:252:1 [INFO] [stdout] | [INFO] [stdout] 252 | / enum PatternComponent { [INFO] [stdout] 253 | | Literal([u8; MAX_COMPONENT_TEXT], usize), [INFO] [stdout] | | ---------------------------------------- the largest variant contains at least 264 bytes [INFO] [stdout] 254 | | Numbers(usize), [INFO] [stdout] 255 | | Letters(usize), [INFO] [stdout] ... | [INFO] [stdout] 258 | | Variable(String), [INFO] [stdout] | | ---------------- the second-largest variant contains at least 24 bytes [INFO] [stdout] 259 | | } [INFO] [stdout] | |_^ the entire enum is at least 272 bytes [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#large_enum_variant [INFO] [stdout] = note: `#[warn(clippy::large_enum_variant)]` on by default [INFO] [stdout] help: consider boxing the large fields or introducing indirection in some other way to reduce the total size of the enum [INFO] [stdout] | [INFO] [stdout] 253 - Literal([u8; MAX_COMPONENT_TEXT], usize), [INFO] [stdout] 253 + Literal(Box<[u8; MAX_COMPONENT_TEXT]>, usize), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods called `new` usually return `Self` [INFO] [stdout] --> src/main.rs:296:5 [INFO] [stdout] | [INFO] [stdout] 296 | / fn new(msg: &str) -> Box { [INFO] [stdout] 297 | | Box::new(NewbieError { [INFO] [stdout] 298 | | message: msg.to_string(), [INFO] [stdout] 299 | | }) [INFO] [stdout] 300 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_ret_no_self [INFO] [stdout] = note: `#[warn(clippy::new_ret_no_self)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/main.rs:443:12 [INFO] [stdout] | [INFO] [stdout] 443 | } else if let Some(rest) = var_ref.strip_prefix("&newbie.") { [INFO] [stdout] | ____________^ [INFO] [stdout] 444 | | Some((VariableNamespace::Newbie, rest.to_string())) [INFO] [stdout] 445 | | } else { [INFO] [stdout] 446 | | None [INFO] [stdout] 447 | | } [INFO] [stdout] | |_____^ help: try: `{ var_ref.strip_prefix("&newbie.").map(|rest| (VariableNamespace::Newbie, rest.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] = note: `#[warn(clippy::manual_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: initializer for `thread_local` value can be made `const` [INFO] [stdout] --> src/main.rs:200:46 [INFO] [stdout] | [INFO] [stdout] 200 | static RECURSION_DEPTH: RefCell = RefCell::new(0); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace with: `const { RefCell::new(0) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_thread_local [INFO] [stdout] = note: `#[warn(clippy::missing_const_for_thread_local)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/main.rs:748:21 [INFO] [stdout] | [INFO] [stdout] 748 | / if k.starts_with("newbie.") { [INFO] [stdout] 749 | | if index < 64 { [INFO] [stdout] 750 | | // Strip the "newbie." prefix for display [INFO] [stdout] 751 | | let name = k.strip_prefix("newbie.").unwrap_or(k); [INFO] [stdout] ... | [INFO] [stdout] 755 | | } [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] 748 ~ if k.starts_with("newbie.") [INFO] [stdout] 749 ~ && index < 64 { [INFO] [stdout] 750 | // Strip the "newbie." prefix for display [INFO] [stdout] ... [INFO] [stdout] 753 | index += 1; [INFO] [stdout] 754 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: large size difference between variants [INFO] [stdout] --> src/main.rs:252:1 [INFO] [stdout] | [INFO] [stdout] 252 | / enum PatternComponent { [INFO] [stdout] 253 | | Literal([u8; MAX_COMPONENT_TEXT], usize), [INFO] [stdout] | | ---------------------------------------- the largest variant contains at least 264 bytes [INFO] [stdout] 254 | | Numbers(usize), [INFO] [stdout] 255 | | Letters(usize), [INFO] [stdout] ... | [INFO] [stdout] 258 | | Variable(String), [INFO] [stdout] | | ---------------- the second-largest variant contains at least 24 bytes [INFO] [stdout] 259 | | } [INFO] [stdout] | |_^ the entire enum is at least 272 bytes [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#large_enum_variant [INFO] [stdout] = note: `#[warn(clippy::large_enum_variant)]` on by default [INFO] [stdout] help: consider boxing the large fields or introducing indirection in some other way to reduce the total size of the enum [INFO] [stdout] | [INFO] [stdout] 253 - Literal([u8; MAX_COMPONENT_TEXT], usize), [INFO] [stdout] 253 + Literal(Box<[u8; MAX_COMPONENT_TEXT]>, usize), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `pos` is used to index `line_bytes` [INFO] [stdout] --> src/main.rs:806:28 [INFO] [stdout] | [INFO] [stdout] 806 | for pos in search_start..line_bytes.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 806 - for pos in search_start..line_bytes.len() { [INFO] [stdout] 806 + for (pos, ) in line_bytes.iter().enumerate().skip(search_start) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods called `new` usually return `Self` [INFO] [stdout] --> src/main.rs:296:5 [INFO] [stdout] | [INFO] [stdout] 296 | / fn new(msg: &str) -> Box { [INFO] [stdout] 297 | | Box::new(NewbieError { [INFO] [stdout] 298 | | message: msg.to_string(), [INFO] [stdout] 299 | | }) [INFO] [stdout] 300 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_ret_no_self [INFO] [stdout] = note: `#[warn(clippy::new_ret_no_self)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `pos` is used to index `line_bytes` [INFO] [stdout] --> src/main.rs:836:28 [INFO] [stdout] | [INFO] [stdout] 836 | for pos in search_start..line_bytes.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 836 - for pos in search_start..line_bytes.len() { [INFO] [stdout] 836 + for (pos, ) in line_bytes.iter().enumerate().skip(search_start) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `pos` is used to index `line_bytes` [INFO] [stdout] --> src/main.rs:866:28 [INFO] [stdout] | [INFO] [stdout] 866 | for pos in search_start..line_bytes.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 866 - for pos in search_start..line_bytes.len() { [INFO] [stdout] 866 + for (pos, ) in line_bytes.iter().enumerate().skip(search_start) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `pos` is used to index `line_bytes` [INFO] [stdout] --> src/main.rs:896:28 [INFO] [stdout] | [INFO] [stdout] 896 | for pos in search_start..line_bytes.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 896 - for pos in search_start..line_bytes.len() { [INFO] [stdout] 896 + for (pos, ) in line_bytes.iter().enumerate().skip(search_start) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/main.rs:443:12 [INFO] [stdout] | [INFO] [stdout] 443 | } else if let Some(rest) = var_ref.strip_prefix("&newbie.") { [INFO] [stdout] | ____________^ [INFO] [stdout] 444 | | Some((VariableNamespace::Newbie, rest.to_string())) [INFO] [stdout] 445 | | } else { [INFO] [stdout] 446 | | None [INFO] [stdout] 447 | | } [INFO] [stdout] | |_____^ help: try: `{ var_ref.strip_prefix("&newbie.").map(|rest| (VariableNamespace::Newbie, rest.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] = note: `#[warn(clippy::manual_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `tokens` [INFO] [stdout] --> src/main.rs:1073:14 [INFO] [stdout] | [INFO] [stdout] 1073 | for i in 0..token_count { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 1073 - for i in 0..token_count { [INFO] [stdout] 1073 + for in tokens.iter().take(token_count) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `tokens` [INFO] [stdout] --> src/main.rs:1086:18 [INFO] [stdout] | [INFO] [stdout] 1086 | for i in 0..token_count { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 1086 - for i in 0..token_count { [INFO] [stdout] 1086 + for in tokens.iter().take(token_count) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `lines` [INFO] [stdout] --> src/main.rs:1145:14 [INFO] [stdout] | [INFO] [stdout] 1145 | for i in 0..line_count { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 1145 - for i in 0..line_count { [INFO] [stdout] 1145 + for in lines.iter().take(line_count) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/main.rs:748:21 [INFO] [stdout] | [INFO] [stdout] 748 | / if k.starts_with("newbie.") { [INFO] [stdout] 749 | | if index < 64 { [INFO] [stdout] 750 | | // Strip the "newbie." prefix for display [INFO] [stdout] 751 | | let name = k.strip_prefix("newbie.").unwrap_or(k); [INFO] [stdout] ... | [INFO] [stdout] 755 | | } [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] 748 ~ if k.starts_with("newbie.") [INFO] [stdout] 749 ~ && index < 64 { [INFO] [stdout] 750 | // Strip the "newbie." prefix for display [INFO] [stdout] ... [INFO] [stdout] 753 | index += 1; [INFO] [stdout] 754 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `pos` is used to index `line_bytes` [INFO] [stdout] --> src/main.rs:806:28 [INFO] [stdout] | [INFO] [stdout] 806 | for pos in search_start..line_bytes.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 806 - for pos in search_start..line_bytes.len() { [INFO] [stdout] 806 + for (pos, ) in line_bytes.iter().enumerate().skip(search_start) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `pos` is used to index `line_bytes` [INFO] [stdout] --> src/main.rs:836:28 [INFO] [stdout] | [INFO] [stdout] 836 | for pos in search_start..line_bytes.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 836 - for pos in search_start..line_bytes.len() { [INFO] [stdout] 836 + for (pos, ) in line_bytes.iter().enumerate().skip(search_start) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/main.rs:1300:21 [INFO] [stdout] | [INFO] [stdout] 1300 | / if mask_idx > 0 && pattern.adjacent_to_next[mask_idx - 1] { [INFO] [stdout] 1301 | | if match_pos != line_pos { [INFO] [stdout] 1302 | | return false; [INFO] [stdout] 1303 | | } [INFO] [stdout] 1304 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 1300 ~ if mask_idx > 0 && pattern.adjacent_to_next[mask_idx - 1] [INFO] [stdout] 1301 ~ && match_pos != line_pos { [INFO] [stdout] 1302 | return false; [INFO] [stdout] 1303 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `pos` is used to index `line_bytes` [INFO] [stdout] --> src/main.rs:866:28 [INFO] [stdout] | [INFO] [stdout] 866 | for pos in search_start..line_bytes.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 866 - for pos in search_start..line_bytes.len() { [INFO] [stdout] 866 + for (pos, ) in line_bytes.iter().enumerate().skip(search_start) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/main.rs:1352:5 [INFO] [stdout] | [INFO] [stdout] 1352 | / if pattern.end_anchor { [INFO] [stdout] 1353 | | if last_match_end != line_bytes.len() { [INFO] [stdout] 1354 | | return false; [INFO] [stdout] 1355 | | } [INFO] [stdout] 1356 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 1352 ~ if pattern.end_anchor [INFO] [stdout] 1353 ~ && last_match_end != line_bytes.len() { [INFO] [stdout] 1354 | return false; [INFO] [stdout] 1355 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `pos` is used to index `line_bytes` [INFO] [stdout] --> src/main.rs:896:28 [INFO] [stdout] | [INFO] [stdout] 896 | for pos in search_start..line_bytes.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 896 - for pos in search_start..line_bytes.len() { [INFO] [stdout] 896 + for (pos, ) in line_bytes.iter().enumerate().skip(search_start) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/main.rs:1434:29 [INFO] [stdout] | [INFO] [stdout] 1434 | / ... if mask_idx > 0 && pattern.adjacent_to_next[mask_idx - 1] { [INFO] [stdout] 1435 | | ... if match_pos != line_pos { [INFO] [stdout] 1436 | | ... return (false, captures); [INFO] [stdout] 1437 | | ... } [INFO] [stdout] 1438 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 1434 ~ if mask_idx > 0 && pattern.adjacent_to_next[mask_idx - 1] [INFO] [stdout] 1435 ~ && match_pos != line_pos { [INFO] [stdout] 1436 | return (false, captures); [INFO] [stdout] 1437 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/main.rs:1489:5 [INFO] [stdout] | [INFO] [stdout] 1489 | / if pattern.end_anchor { [INFO] [stdout] 1490 | | if last_match_end != line_bytes.len() { [INFO] [stdout] 1491 | | return (false, captures); [INFO] [stdout] 1492 | | } [INFO] [stdout] 1493 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 1489 ~ if pattern.end_anchor [INFO] [stdout] 1490 ~ && last_match_end != line_bytes.len() { [INFO] [stdout] 1491 | return (false, captures); [INFO] [stdout] 1492 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `tokens` [INFO] [stdout] --> src/main.rs:1073:14 [INFO] [stdout] | [INFO] [stdout] 1073 | for i in 0..token_count { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 1073 - for i in 0..token_count { [INFO] [stdout] 1073 + for in tokens.iter().take(token_count) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/main.rs:1543:5 [INFO] [stdout] | [INFO] [stdout] 1543 | / if line_matches_pattern(content.as_bytes(), pattern) { [INFO] [stdout] 1544 | | if command.display_output { [INFO] [stdout] 1545 | | println!("{}", content); [INFO] [stdout] 1546 | | } [INFO] [stdout] 1547 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 1543 ~ if line_matches_pattern(content.as_bytes(), pattern) [INFO] [stdout] 1544 ~ && command.display_output { [INFO] [stdout] 1545 | println!("{}", content); [INFO] [stdout] 1546 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `tokens` [INFO] [stdout] --> src/main.rs:1086:18 [INFO] [stdout] | [INFO] [stdout] 1086 | for i in 0..token_count { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 1086 - for i in 0..token_count { [INFO] [stdout] 1086 + for in tokens.iter().take(token_count) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually filling a slice [INFO] [stdout] --> src/main.rs:1566:13 [INFO] [stdout] | [INFO] [stdout] 1566 | / for item in &mut buf { [INFO] [stdout] 1567 | | *item = None; [INFO] [stdout] 1568 | | } [INFO] [stdout] | |_____________^ help: try: `buf.fill(None);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_slice_fill [INFO] [stdout] = note: `#[warn(clippy::manual_slice_fill)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `lines` [INFO] [stdout] --> src/main.rs:1145:14 [INFO] [stdout] | [INFO] [stdout] 1145 | for i in 0..line_count { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 1145 - for i in 0..line_count { [INFO] [stdout] 1145 + for in lines.iter().take(line_count) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual arithmetic check found [INFO] [stdout] --> src/main.rs:1621:13 [INFO] [stdout] | [INFO] [stdout] 1621 | if total_matches > last_n { total_matches - last_n } else { 0 } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `total_matches.saturating_sub(last_n)` [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: this `if` statement can be collapsed [INFO] [stdout] --> src/main.rs:1300:21 [INFO] [stdout] | [INFO] [stdout] 1300 | / if mask_idx > 0 && pattern.adjacent_to_next[mask_idx - 1] { [INFO] [stdout] 1301 | | if match_pos != line_pos { [INFO] [stdout] 1302 | | return false; [INFO] [stdout] 1303 | | } [INFO] [stdout] 1304 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 1300 ~ if mask_idx > 0 && pattern.adjacent_to_next[mask_idx - 1] [INFO] [stdout] 1301 ~ && match_pos != line_pos { [INFO] [stdout] 1302 | return false; [INFO] [stdout] 1303 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/main.rs:1352:5 [INFO] [stdout] | [INFO] [stdout] 1352 | / if pattern.end_anchor { [INFO] [stdout] 1353 | | if last_match_end != line_bytes.len() { [INFO] [stdout] 1354 | | return false; [INFO] [stdout] 1355 | | } [INFO] [stdout] 1356 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 1352 ~ if pattern.end_anchor [INFO] [stdout] 1353 ~ && last_match_end != line_bytes.len() { [INFO] [stdout] 1354 | return false; [INFO] [stdout] 1355 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/main.rs:1434:29 [INFO] [stdout] | [INFO] [stdout] 1434 | / ... if mask_idx > 0 && pattern.adjacent_to_next[mask_idx - 1] { [INFO] [stdout] 1435 | | ... if match_pos != line_pos { [INFO] [stdout] 1436 | | ... return (false, captures); [INFO] [stdout] 1437 | | ... } [INFO] [stdout] 1438 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 1434 ~ if mask_idx > 0 && pattern.adjacent_to_next[mask_idx - 1] [INFO] [stdout] 1435 ~ && match_pos != line_pos { [INFO] [stdout] 1436 | return (false, captures); [INFO] [stdout] 1437 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/main.rs:1489:5 [INFO] [stdout] | [INFO] [stdout] 1489 | / if pattern.end_anchor { [INFO] [stdout] 1490 | | if last_match_end != line_bytes.len() { [INFO] [stdout] 1491 | | return (false, captures); [INFO] [stdout] 1492 | | } [INFO] [stdout] 1493 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 1489 ~ if pattern.end_anchor [INFO] [stdout] 1490 ~ && last_match_end != line_bytes.len() { [INFO] [stdout] 1491 | return (false, captures); [INFO] [stdout] 1492 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/main.rs:1543:5 [INFO] [stdout] | [INFO] [stdout] 1543 | / if line_matches_pattern(content.as_bytes(), pattern) { [INFO] [stdout] 1544 | | if command.display_output { [INFO] [stdout] 1545 | | println!("{}", content); [INFO] [stdout] 1546 | | } [INFO] [stdout] 1547 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 1543 ~ if line_matches_pattern(content.as_bytes(), pattern) [INFO] [stdout] 1544 ~ && command.display_output { [INFO] [stdout] 1545 | println!("{}", content); [INFO] [stdout] 1546 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually filling a slice [INFO] [stdout] --> src/main.rs:1566:13 [INFO] [stdout] | [INFO] [stdout] 1566 | / for item in &mut buf { [INFO] [stdout] 1567 | | *item = None; [INFO] [stdout] 1568 | | } [INFO] [stdout] | |_____________^ help: try: `buf.fill(None);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_slice_fill [INFO] [stdout] = note: `#[warn(clippy::manual_slice_fill)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual arithmetic check found [INFO] [stdout] --> src/main.rs:1621:13 [INFO] [stdout] | [INFO] [stdout] 1621 | if total_matches > last_n { total_matches - last_n } else { 0 } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `total_matches.saturating_sub(last_n)` [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/main.rs:2122:43 [INFO] [stdout] | [INFO] [stdout] 2122 | fn find_all_keywords_fixed(line: &str) -> Result<([(&'static str, CommandHandler, usize); 64], usize), 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: this looks like you are swapping elements of `found` manually [INFO] [stdout] --> src/main.rs:2168:17 [INFO] [stdout] | [INFO] [stdout] 2168 | / let temp = found[j]; [INFO] [stdout] 2169 | | found[j] = found[j + 1]; [INFO] [stdout] 2170 | | found[j + 1] = temp; [INFO] [stdout] | |____________________________________^ help: try: `found.swap(j, j + 1);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_swap [INFO] [stdout] = note: `#[warn(clippy::manual_swap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/main.rs:2245:20 [INFO] [stdout] | [INFO] [stdout] 2245 | if next_token == "=" || (!next_token.starts_with('&') && next_token != "=") { [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] 2245 - if next_token == "=" || (!next_token.starts_with('&') && next_token != "=") { [INFO] [stdout] 2245 + if !(next_token != "=" && next_token.starts_with('&')) { [INFO] [stdout] | [INFO] [stdout] 2245 - if next_token == "=" || (!next_token.starts_with('&') && next_token != "=") { [INFO] [stdout] 2245 + if next_token == "=" || !next_token.starts_with('&') { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/main.rs:2242:5 [INFO] [stdout] | [INFO] [stdout] 2242 | / if var_index == 0 { [INFO] [stdout] 2243 | | if var_index + 1 < token_count { [INFO] [stdout] 2244 | | if let Some(next_token) = tokens[var_index + 1] { [INFO] [stdout] 2245 | | if next_token == "=" || (!next_token.starts_with('&') && next_token != "=") { [INFO] [stdout] ... | [INFO] [stdout] 2250 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 2242 ~ if var_index == 0 [INFO] [stdout] 2243 ~ && var_index + 1 < token_count { [INFO] [stdout] 2244 | if let Some(next_token) = tokens[var_index + 1] { [INFO] [stdout] ... [INFO] [stdout] 2248 | } [INFO] [stdout] 2249 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: it looks like you're manually copying between slices [INFO] [stdout] --> src/main.rs:2265:5 [INFO] [stdout] | [INFO] [stdout] 2265 | / for i in 0..copy_count { [INFO] [stdout] 2266 | | new_tokens[i + 1] = tokens[i]; [INFO] [stdout] 2267 | | } [INFO] [stdout] | |_____^ help: try replacing the loop by: `new_tokens[1..(copy_count + 1)].copy_from_slice(&tokens[..copy_count]);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_memcpy [INFO] [stdout] = note: `#[warn(clippy::manual_memcpy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: it looks like you're manually copying between slices [INFO] [stdout] --> src/main.rs:2282:5 [INFO] [stdout] | [INFO] [stdout] 2282 | / for i in 0..copy_count { [INFO] [stdout] 2283 | | new_tokens[i + 1] = tokens[i]; [INFO] [stdout] 2284 | | } [INFO] [stdout] | |_____^ help: try replacing the loop by: `new_tokens[1..(copy_count + 1)].copy_from_slice(&tokens[..copy_count]);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_memcpy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `tokens` [INFO] [stdout] --> src/main.rs:2299:14 [INFO] [stdout] | [INFO] [stdout] 2299 | for i in 0..token_count { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 2299 - for i in 0..token_count { [INFO] [stdout] 2299 + for in tokens.iter().take(token_count) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is only used to index `current_args` [INFO] [stdout] --> src/main.rs:2306:30 [INFO] [stdout] | [INFO] [stdout] 2306 | for j in 0..arg_count { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 2306 - for j in 0..arg_count { [INFO] [stdout] 2306 + for in current_args.iter().take(arg_count) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is only used to index `current_args` [INFO] [stdout] --> src/main.rs:2339:18 [INFO] [stdout] | [INFO] [stdout] 2339 | for j in 0..arg_count { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 2339 - for j in 0..arg_count { [INFO] [stdout] 2339 + for in current_args.iter().take(arg_count) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `u64` [INFO] [stdout] --> src/main.rs:2372:40 [INFO] [stdout] | [INFO] [stdout] 2372 | let res = unsafe { libc::ioctl(fd, libc::TIOCGWINSZ.into(), &mut ws) }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `libc::TIOCGWINSZ` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/main.rs:2122:43 [INFO] [stdout] | [INFO] [stdout] 2122 | fn find_all_keywords_fixed(line: &str) -> Result<([(&'static str, CommandHandler, usize); 64], usize), 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: this looks like you are swapping elements of `found` manually [INFO] [stdout] --> src/main.rs:2168:17 [INFO] [stdout] | [INFO] [stdout] 2168 | / let temp = found[j]; [INFO] [stdout] 2169 | | found[j] = found[j + 1]; [INFO] [stdout] 2170 | | found[j + 1] = temp; [INFO] [stdout] | |____________________________________^ help: try: `found.swap(j, j + 1);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_swap [INFO] [stdout] = note: `#[warn(clippy::manual_swap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/main.rs:2245:20 [INFO] [stdout] | [INFO] [stdout] 2245 | if next_token == "=" || (!next_token.starts_with('&') && next_token != "=") { [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] 2245 - if next_token == "=" || (!next_token.starts_with('&') && next_token != "=") { [INFO] [stdout] 2245 + if !(next_token != "=" && next_token.starts_with('&')) { [INFO] [stdout] | [INFO] [stdout] 2245 - if next_token == "=" || (!next_token.starts_with('&') && next_token != "=") { [INFO] [stdout] 2245 + if next_token == "=" || !next_token.starts_with('&') { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/main.rs:2242:5 [INFO] [stdout] | [INFO] [stdout] 2242 | / if var_index == 0 { [INFO] [stdout] 2243 | | if var_index + 1 < token_count { [INFO] [stdout] 2244 | | if let Some(next_token) = tokens[var_index + 1] { [INFO] [stdout] 2245 | | if next_token == "=" || (!next_token.starts_with('&') && next_token != "=") { [INFO] [stdout] ... | [INFO] [stdout] 2250 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 2242 ~ if var_index == 0 [INFO] [stdout] 2243 ~ && var_index + 1 < token_count { [INFO] [stdout] 2244 | if let Some(next_token) = tokens[var_index + 1] { [INFO] [stdout] ... [INFO] [stdout] 2248 | } [INFO] [stdout] 2249 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: it looks like you're manually copying between slices [INFO] [stdout] --> src/main.rs:2265:5 [INFO] [stdout] | [INFO] [stdout] 2265 | / for i in 0..copy_count { [INFO] [stdout] 2266 | | new_tokens[i + 1] = tokens[i]; [INFO] [stdout] 2267 | | } [INFO] [stdout] | |_____^ help: try replacing the loop by: `new_tokens[1..(copy_count + 1)].copy_from_slice(&tokens[..copy_count]);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_memcpy [INFO] [stdout] = note: `#[warn(clippy::manual_memcpy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: it looks like you're manually copying between slices [INFO] [stdout] --> src/main.rs:2282:5 [INFO] [stdout] | [INFO] [stdout] 2282 | / for i in 0..copy_count { [INFO] [stdout] 2283 | | new_tokens[i + 1] = tokens[i]; [INFO] [stdout] 2284 | | } [INFO] [stdout] | |_____^ help: try replacing the loop by: `new_tokens[1..(copy_count + 1)].copy_from_slice(&tokens[..copy_count]);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_memcpy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `tokens` [INFO] [stdout] --> src/main.rs:2299:14 [INFO] [stdout] | [INFO] [stdout] 2299 | for i in 0..token_count { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 2299 - for i in 0..token_count { [INFO] [stdout] 2299 + for in tokens.iter().take(token_count) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/main.rs:2582:39 [INFO] [stdout] | [INFO] [stdout] 2582 | let script_path = &bash_cmd[15..]; // Remove the marker prefix [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/main.rs:2581:17 [INFO] [stdout] | [INFO] [stdout] 2581 | if bash_cmd.starts_with("__BASH_SCRIPT__") { [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] 2581 ~ if let Some(script_path) = bash_cmd.strip_prefix("__BASH_SCRIPT__") { [INFO] [stdout] 2582 ~ // Remove the marker prefix [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is only used to index `current_args` [INFO] [stdout] --> src/main.rs:2306:30 [INFO] [stdout] | [INFO] [stdout] 2306 | for j in 0..arg_count { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 2306 - for j in 0..arg_count { [INFO] [stdout] 2306 + for in current_args.iter().take(arg_count) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is only used to index `current_args` [INFO] [stdout] --> src/main.rs:2339:18 [INFO] [stdout] | [INFO] [stdout] 2339 | for j in 0..arg_count { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 2339 - for j in 0..arg_count { [INFO] [stdout] 2339 + for in current_args.iter().take(arg_count) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `u64` [INFO] [stdout] --> src/main.rs:2372:40 [INFO] [stdout] | [INFO] [stdout] 2372 | let res = unsafe { libc::ioctl(fd, libc::TIOCGWINSZ.into(), &mut ws) }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `libc::TIOCGWINSZ` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/main.rs:2582:39 [INFO] [stdout] | [INFO] [stdout] 2582 | let script_path = &bash_cmd[15..]; // Remove the marker prefix [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/main.rs:2581:17 [INFO] [stdout] | [INFO] [stdout] 2581 | if bash_cmd.starts_with("__BASH_SCRIPT__") { [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] 2581 ~ if let Some(script_path) = bash_cmd.strip_prefix("__BASH_SCRIPT__") { [INFO] [stdout] 2582 ~ // Remove the marker prefix [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `count` is used as a loop counter [INFO] [stdout] --> src/main.rs:3167:9 [INFO] [stdout] | [INFO] [stdout] 3167 | for line_result in reader.lines() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (count, line_result) in reader.lines().enumerate()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] = note: `#[warn(clippy::explicit_counter_loop)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually filling a slice [INFO] [stdout] --> src/main.rs:3194:13 [INFO] [stdout] | [INFO] [stdout] 3194 | / for item in &mut buf { [INFO] [stdout] 3195 | | *item = None; [INFO] [stdout] 3196 | | } [INFO] [stdout] | |_____________^ help: try: `buf.fill(None);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_slice_fill [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual arithmetic check found [INFO] [stdout] --> src/main.rs:3219:13 [INFO] [stdout] | [INFO] [stdout] 3219 | if total_lines > last_n { total_lines - last_n } else { 0 } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `total_lines.saturating_sub(last_n)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_saturating_sub [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/main.rs:3404:5 [INFO] [stdout] | [INFO] [stdout] 3404 | entries[..entry_count].sort_by(|a, b| a.0.to_lowercase().cmp(&b.0.to_lowercase())); [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] 3404 - entries[..entry_count].sort_by(|a, b| a.0.to_lowercase().cmp(&b.0.to_lowercase())); [INFO] [stdout] 3404 + entries[..entry_count].sort_by_key(|a| a.0.to_lowercase()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `count` is used as a loop counter [INFO] [stdout] --> src/main.rs:3167:9 [INFO] [stdout] | [INFO] [stdout] 3167 | for line_result in reader.lines() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (count, line_result) in reader.lines().enumerate()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] = note: `#[warn(clippy::explicit_counter_loop)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually filling a slice [INFO] [stdout] --> src/main.rs:3194:13 [INFO] [stdout] | [INFO] [stdout] 3194 | / for item in &mut buf { [INFO] [stdout] 3195 | | *item = None; [INFO] [stdout] 3196 | | } [INFO] [stdout] | |_____________^ help: try: `buf.fill(None);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_slice_fill [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual arithmetic check found [INFO] [stdout] --> src/main.rs:3219:13 [INFO] [stdout] | [INFO] [stdout] 3219 | if total_lines > last_n { total_lines - last_n } else { 0 } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `total_lines.saturating_sub(last_n)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_saturating_sub [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/main.rs:3508:5 [INFO] [stdout] | [INFO] [stdout] 3508 | entries[..entry_count].sort_by(|a, b| a.0.to_lowercase().cmp(&b.0.to_lowercase())); [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] help: try [INFO] [stdout] | [INFO] [stdout] 3508 - entries[..entry_count].sort_by(|a, b| a.0.to_lowercase().cmp(&b.0.to_lowercase())); [INFO] [stdout] 3508 + entries[..entry_count].sort_by_key(|a| a.0.to_lowercase()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `entries` [INFO] [stdout] --> src/main.rs:3528:18 [INFO] [stdout] | [INFO] [stdout] 3528 | for i in 0..entry_count { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 3528 - for i in 0..entry_count { [INFO] [stdout] 3528 + for in entries.iter().take(entry_count) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `entries` [INFO] [stdout] --> src/main.rs:3541:14 [INFO] [stdout] | [INFO] [stdout] 3541 | for i in 0..entry_count { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 3541 - for i in 0..entry_count { [INFO] [stdout] 3541 + for in entries.iter().take(entry_count) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually reimplementing `div_ceil` [INFO] [stdout] --> src/main.rs:3555:20 [INFO] [stdout] | [INFO] [stdout] 3555 | let num_rows = (entry_count + num_cols - 1) / num_cols; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `entry_count.div_ceil(num_cols)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [INFO] [stdout] = note: `#[warn(clippy::manual_div_ceil)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/main.rs:3404:5 [INFO] [stdout] | [INFO] [stdout] 3404 | entries[..entry_count].sort_by(|a, b| a.0.to_lowercase().cmp(&b.0.to_lowercase())); [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] 3404 - entries[..entry_count].sort_by(|a, b| a.0.to_lowercase().cmp(&b.0.to_lowercase())); [INFO] [stdout] 3404 + entries[..entry_count].sort_by_key(|a| a.0.to_lowercase()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/main.rs:3508:5 [INFO] [stdout] | [INFO] [stdout] 3508 | entries[..entry_count].sort_by(|a, b| a.0.to_lowercase().cmp(&b.0.to_lowercase())); [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] help: try [INFO] [stdout] | [INFO] [stdout] 3508 - entries[..entry_count].sort_by(|a, b| a.0.to_lowercase().cmp(&b.0.to_lowercase())); [INFO] [stdout] 3508 + entries[..entry_count].sort_by_key(|a| a.0.to_lowercase()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `entries` [INFO] [stdout] --> src/main.rs:3528:18 [INFO] [stdout] | [INFO] [stdout] 3528 | for i in 0..entry_count { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 3528 - for i in 0..entry_count { [INFO] [stdout] 3528 + for in entries.iter().take(entry_count) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `lines_printed` is used as a loop counter [INFO] [stdout] --> src/main.rs:3882:5 [INFO] [stdout] | [INFO] [stdout] 3882 | for line_result in reader.lines() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (lines_printed, line_result) in reader.lines().enumerate()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `entries` [INFO] [stdout] --> src/main.rs:3541:14 [INFO] [stdout] | [INFO] [stdout] 3541 | for i in 0..entry_count { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 3541 - for i in 0..entry_count { [INFO] [stdout] 3541 + for in entries.iter().take(entry_count) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/main.rs:3893:29 [INFO] [stdout] | [INFO] [stdout] 3893 | if command.numbered { [INFO] [stdout] | _____________________________^ [INFO] [stdout] 3894 | | println!("{:6}: {}", lines_printed + 1, formatted_line); [INFO] [stdout] 3895 | | } else if command.original_numbers { [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/main.rs:3895:44 [INFO] [stdout] | [INFO] [stdout] 3895 | } else if command.original_numbers { [INFO] [stdout] | ____________________________________________^ [INFO] [stdout] 3896 | | println!("{:6}: {}", lines_printed + 1, formatted_line); [INFO] [stdout] 3897 | | } 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: manually reimplementing `div_ceil` [INFO] [stdout] --> src/main.rs:3555:20 [INFO] [stdout] | [INFO] [stdout] 3555 | let num_rows = (entry_count + num_cols - 1) / num_cols; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `entry_count.div_ceil(num_cols)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [INFO] [stdout] = note: `#[warn(clippy::manual_div_ceil)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually filling a slice [INFO] [stdout] --> src/main.rs:3914:9 [INFO] [stdout] | [INFO] [stdout] 3914 | / for item in &mut buf { [INFO] [stdout] 3915 | | *item = None; [INFO] [stdout] 3916 | | } [INFO] [stdout] | |_________^ help: try: `buf.fill(None);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_slice_fill [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual arithmetic check found [INFO] [stdout] --> src/main.rs:3938:12 [INFO] [stdout] | [INFO] [stdout] 3938 | } else if total_lines > last_n { [INFO] [stdout] | ____________^ [INFO] [stdout] 3939 | | total_lines - last_n [INFO] [stdout] 3940 | | } else { [INFO] [stdout] 3941 | | 0 [INFO] [stdout] 3942 | | }; [INFO] [stdout] | |_____^ help: replace it with: `{ total_lines.saturating_sub(last_n) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_saturating_sub [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `line_number` is used as a loop counter [INFO] [stdout] --> src/main.rs:3967:9 [INFO] [stdout] | [INFO] [stdout] 3967 | for line_result in reader.lines() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (line_number, line_result) in (1..).zip(reader.lines())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `lines_printed` is used as a loop counter [INFO] [stdout] --> src/main.rs:3882:5 [INFO] [stdout] | [INFO] [stdout] 3882 | for line_result in reader.lines() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (lines_printed, line_result) in reader.lines().enumerate()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/main.rs:3893:29 [INFO] [stdout] | [INFO] [stdout] 3893 | if command.numbered { [INFO] [stdout] | _____________________________^ [INFO] [stdout] 3894 | | println!("{:6}: {}", lines_printed + 1, formatted_line); [INFO] [stdout] 3895 | | } else if command.original_numbers { [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/main.rs:3895:44 [INFO] [stdout] | [INFO] [stdout] 3895 | } else if command.original_numbers { [INFO] [stdout] | ____________________________________________^ [INFO] [stdout] 3896 | | println!("{:6}: {}", lines_printed + 1, formatted_line); [INFO] [stdout] 3897 | | } 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: unnecessary `if let` since only the `Some` variant of the iterator element is used [INFO] [stdout] --> src/main.rs:4158:13 [INFO] [stdout] | [INFO] [stdout] 4158 | / for var_opt in &vars { [INFO] [stdout] 4159 | | if let Some((name, value)) = var_opt { [INFO] [stdout] 4160 | | if command.raw_mode { [INFO] [stdout] 4161 | | println!("{}={}", name, value); [INFO] [stdout] ... | [INFO] [stdout] 4166 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/main.rs:4159:17 [INFO] [stdout] | [INFO] [stdout] 4159 | / if let Some((name, value)) = var_opt { [INFO] [stdout] 4160 | | if command.raw_mode { [INFO] [stdout] 4161 | | println!("{}={}", name, value); [INFO] [stdout] 4162 | | } else { [INFO] [stdout] ... | [INFO] [stdout] 4165 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] = note: `#[warn(clippy::manual_flatten)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 4158 ~ for (name, value) in vars.iter().flatten() { [INFO] [stdout] 4159 + if command.raw_mode { [INFO] [stdout] 4160 + println!("{}={}", name, value); [INFO] [stdout] 4161 + } else { [INFO] [stdout] 4162 + println!(" {}: {}", name, value); [INFO] [stdout] 4163 + } [INFO] [stdout] 4164 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually filling a slice [INFO] [stdout] --> src/main.rs:3914:9 [INFO] [stdout] | [INFO] [stdout] 3914 | / for item in &mut buf { [INFO] [stdout] 3915 | | *item = None; [INFO] [stdout] 3916 | | } [INFO] [stdout] | |_________^ help: try: `buf.fill(None);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_slice_fill [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Some` variant of the iterator element is used [INFO] [stdout] --> src/main.rs:4203:9 [INFO] [stdout] | [INFO] [stdout] 4203 | / for var_opt in &vars { [INFO] [stdout] 4204 | | if let Some((name, value)) = var_opt { [INFO] [stdout] 4205 | | if command.raw_mode { [INFO] [stdout] 4206 | | println!("{}={}", name, value); [INFO] [stdout] ... | [INFO] [stdout] 4211 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/main.rs:4204:13 [INFO] [stdout] | [INFO] [stdout] 4204 | / if let Some((name, value)) = var_opt { [INFO] [stdout] 4205 | | if command.raw_mode { [INFO] [stdout] 4206 | | println!("{}={}", name, value); [INFO] [stdout] 4207 | | } else { [INFO] [stdout] ... | [INFO] [stdout] 4210 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 4203 ~ for (name, value) in vars.iter().flatten() { [INFO] [stdout] 4204 + if command.raw_mode { [INFO] [stdout] 4205 + println!("{}={}", name, value); [INFO] [stdout] 4206 + } else { [INFO] [stdout] 4207 + println!(" {}: {}", name, value); [INFO] [stdout] 4208 + } [INFO] [stdout] 4209 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual arithmetic check found [INFO] [stdout] --> src/main.rs:3938:12 [INFO] [stdout] | [INFO] [stdout] 3938 | } else if total_lines > last_n { [INFO] [stdout] | ____________^ [INFO] [stdout] 3939 | | total_lines - last_n [INFO] [stdout] 3940 | | } else { [INFO] [stdout] 3941 | | 0 [INFO] [stdout] 3942 | | }; [INFO] [stdout] | |_____^ help: replace it with: `{ total_lines.saturating_sub(last_n) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_saturating_sub [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Some` variant of the iterator element is used [INFO] [stdout] --> src/main.rs:4236:9 [INFO] [stdout] | [INFO] [stdout] 4236 | / for var_opt in &vars { [INFO] [stdout] 4237 | | if let Some((name, value)) = var_opt { [INFO] [stdout] 4238 | | if command.raw_mode { [INFO] [stdout] 4239 | | println!("{}={}", name, value); [INFO] [stdout] ... | [INFO] [stdout] 4244 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/main.rs:4237:13 [INFO] [stdout] | [INFO] [stdout] 4237 | / if let Some((name, value)) = var_opt { [INFO] [stdout] 4238 | | if command.raw_mode { [INFO] [stdout] 4239 | | println!("{}={}", name, value); [INFO] [stdout] 4240 | | } else { [INFO] [stdout] ... | [INFO] [stdout] 4243 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 4236 ~ for (name, value) in vars.iter().flatten() { [INFO] [stdout] 4237 + if command.raw_mode { [INFO] [stdout] 4238 + println!("{}={}", name, value); [INFO] [stdout] 4239 + } else { [INFO] [stdout] 4240 + println!(" {}: {}", name, value); [INFO] [stdout] 4241 + } [INFO] [stdout] 4242 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `line_number` is used as a loop counter [INFO] [stdout] --> src/main.rs:3967:9 [INFO] [stdout] | [INFO] [stdout] 3967 | for line_result in reader.lines() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (line_number, line_result) in (1..).zip(reader.lines())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `block_lines` [INFO] [stdout] --> src/main.rs:4381:34 [INFO] [stdout] | [INFO] [stdout] 4381 | for i in 0..block_line_count { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 4381 - for i in 0..block_line_count { [INFO] [stdout] 4381 + for (i, ) in block_lines.iter().enumerate().take(block_line_count) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Some` variant of the iterator element is used [INFO] [stdout] --> src/main.rs:4158:13 [INFO] [stdout] | [INFO] [stdout] 4158 | / for var_opt in &vars { [INFO] [stdout] 4159 | | if let Some((name, value)) = var_opt { [INFO] [stdout] 4160 | | if command.raw_mode { [INFO] [stdout] 4161 | | println!("{}={}", name, value); [INFO] [stdout] ... | [INFO] [stdout] 4166 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/main.rs:4159:17 [INFO] [stdout] | [INFO] [stdout] 4159 | / if let Some((name, value)) = var_opt { [INFO] [stdout] 4160 | | if command.raw_mode { [INFO] [stdout] 4161 | | println!("{}={}", name, value); [INFO] [stdout] 4162 | | } else { [INFO] [stdout] ... | [INFO] [stdout] 4165 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] = note: `#[warn(clippy::manual_flatten)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 4158 ~ for (name, value) in vars.iter().flatten() { [INFO] [stdout] 4159 + if command.raw_mode { [INFO] [stdout] 4160 + println!("{}={}", name, value); [INFO] [stdout] 4161 + } else { [INFO] [stdout] 4162 + println!(" {}: {}", name, value); [INFO] [stdout] 4163 + } [INFO] [stdout] 4164 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Some` variant of the iterator element is used [INFO] [stdout] --> src/main.rs:4203:9 [INFO] [stdout] | [INFO] [stdout] 4203 | / for var_opt in &vars { [INFO] [stdout] 4204 | | if let Some((name, value)) = var_opt { [INFO] [stdout] 4205 | | if command.raw_mode { [INFO] [stdout] 4206 | | println!("{}={}", name, value); [INFO] [stdout] ... | [INFO] [stdout] 4211 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/main.rs:4204:13 [INFO] [stdout] | [INFO] [stdout] 4204 | / if let Some((name, value)) = var_opt { [INFO] [stdout] 4205 | | if command.raw_mode { [INFO] [stdout] 4206 | | println!("{}={}", name, value); [INFO] [stdout] 4207 | | } else { [INFO] [stdout] ... | [INFO] [stdout] 4210 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 4203 ~ for (name, value) in vars.iter().flatten() { [INFO] [stdout] 4204 + if command.raw_mode { [INFO] [stdout] 4205 + println!("{}={}", name, value); [INFO] [stdout] 4206 + } else { [INFO] [stdout] 4207 + println!(" {}: {}", name, value); [INFO] [stdout] 4208 + } [INFO] [stdout] 4209 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Some` variant of the iterator element is used [INFO] [stdout] --> src/main.rs:4236:9 [INFO] [stdout] | [INFO] [stdout] 4236 | / for var_opt in &vars { [INFO] [stdout] 4237 | | if let Some((name, value)) = var_opt { [INFO] [stdout] 4238 | | if command.raw_mode { [INFO] [stdout] 4239 | | println!("{}={}", name, value); [INFO] [stdout] ... | [INFO] [stdout] 4244 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/main.rs:4237:13 [INFO] [stdout] | [INFO] [stdout] 4237 | / if let Some((name, value)) = var_opt { [INFO] [stdout] 4238 | | if command.raw_mode { [INFO] [stdout] 4239 | | println!("{}={}", name, value); [INFO] [stdout] 4240 | | } else { [INFO] [stdout] ... | [INFO] [stdout] 4243 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 4236 ~ for (name, value) in vars.iter().flatten() { [INFO] [stdout] 4237 + if command.raw_mode { [INFO] [stdout] 4238 + println!("{}={}", name, value); [INFO] [stdout] 4239 + } else { [INFO] [stdout] 4240 + println!(" {}: {}", name, value); [INFO] [stdout] 4241 + } [INFO] [stdout] 4242 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `block_lines` [INFO] [stdout] --> src/main.rs:4381:34 [INFO] [stdout] | [INFO] [stdout] 4381 | for i in 0..block_line_count { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 4381 - for i in 0..block_line_count { [INFO] [stdout] 4381 + for (i, ) in block_lines.iter().enumerate().take(block_line_count) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/main.rs:4898:23 [INFO] [stdout] | [INFO] [stdout] 4898 | let content = pattern_str[9..].trim(); // Everything after "&start &=" [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/main.rs:4896:5 [INFO] [stdout] | [INFO] [stdout] 4896 | if pattern_str.starts_with("&start &=") { [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] 4896 ~ if let Some() = pattern_str.strip_prefix("&start &=") { [INFO] [stdout] 4897 | pattern.start_anchor = true; [INFO] [stdout] 4898 ~ let content = .trim(); // Everything after "&start &=" [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/main.rs:4923:35 [INFO] [stdout] | [INFO] [stdout] 4923 | let end_content = end_part[7..].trim(); // After "&end &=" [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/main.rs:4921:13 [INFO] [stdout] | [INFO] [stdout] 4921 | if end_part.starts_with("&end &=") { [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] 4921 ~ if let Some() = end_part.strip_prefix("&end &=") { [INFO] [stdout] 4922 | pattern.end_anchor = true; [INFO] [stdout] 4923 ~ let end_content = .trim(); // After "&end &=" [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/main.rs:4949:23 [INFO] [stdout] | [INFO] [stdout] 4949 | let content = pattern_str[7..].trim(); // Everything after "&end &=" [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/main.rs:4947:12 [INFO] [stdout] | [INFO] [stdout] 4947 | } else if pattern_str.starts_with("&end &=") { [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] 4947 ~ } else if let Some() = pattern_str.strip_prefix("&end &=") { [INFO] [stdout] 4948 | pattern.end_anchor = true; [INFO] [stdout] 4949 ~ let content = .trim(); // Everything after "&end &=" [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to one [INFO] [stdout] --> src/main.rs:5234:8 [INFO] [stdout] | [INFO] [stdout] 5234 | if args.len() >= 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!args.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: stripping a prefix manually [INFO] [stdout] --> src/main.rs:4898:23 [INFO] [stdout] | [INFO] [stdout] 4898 | let content = pattern_str[9..].trim(); // Everything after "&start &=" [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/main.rs:4896:5 [INFO] [stdout] | [INFO] [stdout] 4896 | if pattern_str.starts_with("&start &=") { [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] 4896 ~ if let Some() = pattern_str.strip_prefix("&start &=") { [INFO] [stdout] 4897 | pattern.start_anchor = true; [INFO] [stdout] 4898 ~ let content = .trim(); // Everything after "&start &=" [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/main.rs:4923:35 [INFO] [stdout] | [INFO] [stdout] 4923 | let end_content = end_part[7..].trim(); // After "&end &=" [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/main.rs:4921:13 [INFO] [stdout] | [INFO] [stdout] 4921 | if end_part.starts_with("&end &=") { [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] 4921 ~ if let Some() = end_part.strip_prefix("&end &=") { [INFO] [stdout] 4922 | pattern.end_anchor = true; [INFO] [stdout] 4923 ~ let end_content = .trim(); // After "&end &=" [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `args.get(0)` [INFO] [stdout] --> src/main.rs:5418:24 [INFO] [stdout] | [INFO] [stdout] 5418 | if let Some(arg) = args.get(0) { [INFO] [stdout] | ^^^^^^^^^^^ help: try: `args.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/main.rs:4949:23 [INFO] [stdout] | [INFO] [stdout] 4949 | let content = pattern_str[7..].trim(); // Everything after "&end &=" [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/main.rs:4947:12 [INFO] [stdout] | [INFO] [stdout] 4947 | } else if pattern_str.starts_with("&end &=") { [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] 4947 ~ } else if let Some() = pattern_str.strip_prefix("&end &=") { [INFO] [stdout] 4948 | pattern.end_anchor = true; [INFO] [stdout] 4949 ~ let content = .trim(); // Everything after "&end &=" [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `args.get(0)` [INFO] [stdout] --> src/main.rs:5432:24 [INFO] [stdout] | [INFO] [stdout] 5432 | if let Some(arg) = args.get(0) { [INFO] [stdout] | ^^^^^^^^^^^ help: try: `args.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to one [INFO] [stdout] --> src/main.rs:5234:8 [INFO] [stdout] | [INFO] [stdout] 5234 | if args.len() >= 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!args.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: accessing first element with `args.get(0)` [INFO] [stdout] --> src/main.rs:5418:24 [INFO] [stdout] | [INFO] [stdout] 5418 | if let Some(arg) = args.get(0) { [INFO] [stdout] | ^^^^^^^^^^^ help: try: `args.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `args.get(0)` [INFO] [stdout] --> src/main.rs:5432:24 [INFO] [stdout] | [INFO] [stdout] 5432 | if let Some(arg) = args.get(0) { [INFO] [stdout] | ^^^^^^^^^^^ help: try: `args.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 25.37s [INFO] running `Command { std: "docker" "inspect" "5a1d5a32df2d719e0c06f683899080e4ca41ec85ab6d0031129143f0438fa60c", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "5a1d5a32df2d719e0c06f683899080e4ca41ec85ab6d0031129143f0438fa60c", kill_on_drop: false }` [INFO] [stdout] 5a1d5a32df2d719e0c06f683899080e4ca41ec85ab6d0031129143f0438fa60c