[INFO] cloning repository https://github.com/kyazdani42/computor_v1 [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/kyazdani42/computor_v1" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fkyazdani42%2Fcomputor_v1", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fkyazdani42%2Fcomputor_v1'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] def59cd8287110d2b70c325ece80d6022478fa57 [INFO] linting kyazdani42/computor_v1 against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fkyazdani42%2Fcomputor_v1" "/workspace/builds/worker-2-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-2-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/kyazdani42/computor_v1 [INFO] finished tweaking git repo https://github.com/kyazdani42/computor_v1 [INFO] tweaked toml for git repo https://github.com/kyazdani42/computor_v1 written to /workspace/builds/worker-2-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/kyazdani42/computor_v1 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/kyazdani42/computor_v1 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] warning: `package.edition` is unspecified, defaulting to `2015` while the latest is `2024` [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-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] 074ebf8893a6a623b017c6bc362d269b7f04fc3aa08ddd81c1e1649293a37288 [INFO] running `Command { std: "docker" "start" "-a" "074ebf8893a6a623b017c6bc362d269b7f04fc3aa08ddd81c1e1649293a37288", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "074ebf8893a6a623b017c6bc362d269b7f04fc3aa08ddd81c1e1649293a37288", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "074ebf8893a6a623b017c6bc362d269b7f04fc3aa08ddd81c1e1649293a37288", kill_on_drop: false }` [INFO] [stdout] 074ebf8893a6a623b017c6bc362d269b7f04fc3aa08ddd81c1e1649293a37288 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-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] 7488c67c0de88c5ceb86e852179d525ea65c7526f37b50a2cfb4baa29f5493dc [INFO] running `Command { std: "docker" "start" "-a" "7488c67c0de88c5ceb86e852179d525ea65c7526f37b50a2cfb4baa29f5493dc", kill_on_drop: false }` [INFO] [stderr] warning: `package.edition` is unspecified, defaulting to `2015` while the latest is `2024` [INFO] [stderr] Checking computor_v1 v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: `...` range patterns are deprecated [INFO] [stdout] --> src/parse.rs:137:17 [INFO] [stdout] | [INFO] [stdout] 137 | b'0'...b'9' | b'.' | b'-' | b'+' => prev_str.push(*byte as char), [INFO] [stdout] | ^^^ help: use `..=` for an inclusive range [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: `#[warn(ellipsis_inclusive_range_patterns)]` (part of `#[warn(rust_2021_compatibility)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `...` range patterns are deprecated [INFO] [stdout] --> src/parse.rs:159:13 [INFO] [stdout] | [INFO] [stdout] 159 | b'0'...b'9' | b'.' => true, [INFO] [stdout] | ^^^ help: use `..=` for an inclusive range [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! [INFO] [stdout] = note: for more information, see [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `...` range patterns are deprecated [INFO] [stdout] --> src/parse.rs:137:17 [INFO] [stdout] | [INFO] [stdout] 137 | b'0'...b'9' | b'.' | b'-' | b'+' => prev_str.push(*byte as char), [INFO] [stdout] | ^^^ help: use `..=` for an inclusive range [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: `#[warn(ellipsis_inclusive_range_patterns)]` (part of `#[warn(rust_2021_compatibility)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `...` range patterns are deprecated [INFO] [stdout] --> src/parse.rs:159:13 [INFO] [stdout] | [INFO] [stdout] 159 | b'0'...b'9' | b'.' => true, [INFO] [stdout] | ^^^ help: use `..=` for an inclusive range [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! [INFO] [stdout] = note: for more information, see [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/compute.rs:27:17 [INFO] [stdout] | [INFO] [stdout] 27 | new.value = orig.value + new.value; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `new.value += orig.value` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against true are unnecessary [INFO] [stdout] --> src/compute.rs:30:12 [INFO] [stdout] | [INFO] [stdout] 30 | if should_push == true { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try: `should_push` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_comparison)]` 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/compute.rs:58:34 [INFO] [stdout] | [INFO] [stdout] 58 | if find_floating_coefficient(&operation) { [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `operation` [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/compute.rs:62:45 [INFO] [stdout] | [INFO] [stdout] 62 | let pow2 = get_operation_value_from_pow(&operation, 2.0); [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `operation` [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/compute.rs:63:45 [INFO] [stdout] | [INFO] [stdout] 63 | let pow1 = get_operation_value_from_pow(&operation, 1.0); [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `operation` [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/compute.rs:64:49 [INFO] [stdout] | [INFO] [stdout] 64 | let constant = get_operation_value_from_pow(&operation, 0.0); [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `operation` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/compute.rs:78:41 [INFO] [stdout] | [INFO] [stdout] 78 | fn find_floating_coefficient(operation: &Vec) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 78 - fn find_floating_coefficient(operation: &Vec) -> bool { [INFO] [stdout] 78 + fn find_floating_coefficient(operation: &[Operation]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/compute.rs:91:9 [INFO] [stdout] | [INFO] [stdout] 91 | format!("The solution is 0") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"The solution is 0".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/compute.rs:137:44 [INFO] [stdout] | [INFO] [stdout] 137 | fn get_operation_value_from_pow(operation: &Vec, pow: f32) -> f32 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 137 - fn get_operation_value_from_pow(operation: &Vec, pow: f32) -> f32 { [INFO] [stdout] 137 + fn get_operation_value_from_pow(operation: &[Operation], pow: f32) -> f32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/equation.rs:55:30 [INFO] [stdout] | [INFO] [stdout] 55 | pub fn get_str_from_vec(vec: &Vec) -> String { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 55 - pub fn get_str_from_vec(vec: &Vec) -> String { [INFO] [stdout] 55 + pub fn get_str_from_vec(vec: &[Operation]) -> String { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/equation.rs:71:8 [INFO] [stdout] | [INFO] [stdout] 71 | if s.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `s.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/parse.rs:12:57 [INFO] [stdout] | [INFO] [stdout] 12 | let operations: Vec<&str> = s.split('=').filter(|v| v.len() != 0).collect(); [INFO] [stdout] | ^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!v.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/parse.rs:62:24 [INFO] [stdout] | [INFO] [stdout] 62 | if !value.is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try: `value.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/parse.rs:81:31 [INFO] [stdout] | [INFO] [stdout] 81 | fn get_token_from_vec(tokens: &Vec, i: i16) -> Token { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 81 - fn get_token_from_vec(tokens: &Vec, i: i16) -> Token { [INFO] [stdout] 81 + fn get_token_from_vec(tokens: &[Token], i: i16) -> Token { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `NUM` contains a capitalized acronym [INFO] [stdout] --> src/parse.rs:93:5 [INFO] [stdout] | [INFO] [stdout] 93 | NUM(f32), [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Num` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] = note: `#[warn(clippy::upper_case_acronyms)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `HAT` contains a capitalized acronym [INFO] [stdout] --> src/parse.rs:95:5 [INFO] [stdout] | [INFO] [stdout] 95 | HAT, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Hat` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `MULT` contains a capitalized acronym [INFO] [stdout] --> src/parse.rs:96:5 [INFO] [stdout] | [INFO] [stdout] 96 | MULT, [INFO] [stdout] | ^^^^ help: consider making the acronym lowercase, except the initial letter: `Mult` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `NONE` contains a capitalized acronym [INFO] [stdout] --> src/parse.rs:97:5 [INFO] [stdout] | [INFO] [stdout] 97 | NONE, [INFO] [stdout] | ^^^^ help: consider making the acronym lowercase, except the initial letter: `None` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/parse.rs:108:16 [INFO] [stdout] | [INFO] [stdout] 108 | ... if prev_str.len() != 0 && i != byte_vector.len() - 1 && is_byte_num(&byte_vector[i + 1]) && prev_str != "-" && prev_str != "+" { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!prev_str.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/parse.rs:129:35 [INFO] [stdout] | [INFO] [stdout] 129 | if should_be_tokenized && prev_str.len() != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!prev_str.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/parse.rs:142:35 [INFO] [stdout] | [INFO] [stdout] 142 | let must_parse_last_element = prev_str.len() != 0; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!prev_str.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the function `handle_number_lexing` doesn't need a mutable reference [INFO] [stdout] --> src/parse.rs:144:42 [INFO] [stdout] | [INFO] [stdout] 144 | handle_number_lexing(&mut lexer, &mut prev_str)?; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed [INFO] [stdout] = note: `#[warn(clippy::unnecessary_mut_passed)]` on by default [INFO] [stdout] help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] 144 - handle_number_lexing(&mut lexer, &mut prev_str)?; [INFO] [stdout] 144 + handle_number_lexing(&mut lexer, &prev_str)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/parse.rs:158:5 [INFO] [stdout] | [INFO] [stdout] 158 | / match byte { [INFO] [stdout] 159 | | b'0'...b'9' | b'.' => true, [INFO] [stdout] 160 | | _ => false, [INFO] [stdout] 161 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] = note: `#[warn(clippy::match_like_matches_macro)]` on by default [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 158 - match byte { [INFO] [stdout] 159 - b'0'...b'9' | b'.' => true, [INFO] [stdout] 160 - _ => false, [INFO] [stdout] 161 - } [INFO] [stdout] 158 + matches!(byte, b'0'...b'9' | b'.') [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/parse.rs:172:55 [INFO] [stdout] | [INFO] [stdout] 172 | let parsed_number: f32 = handle_float_parse_error(&value)?; [INFO] [stdout] | ^^^^^^ help: change this to: `value` [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: manual implementation of an assign operation [INFO] [stdout] --> src/compute.rs:27:17 [INFO] [stdout] | [INFO] [stdout] 27 | new.value = orig.value + new.value; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `new.value += orig.value` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against true are unnecessary [INFO] [stdout] --> src/compute.rs:30:12 [INFO] [stdout] | [INFO] [stdout] 30 | if should_push == true { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try: `should_push` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_comparison)]` 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/compute.rs:58:34 [INFO] [stdout] | [INFO] [stdout] 58 | if find_floating_coefficient(&operation) { [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `operation` [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/compute.rs:62:45 [INFO] [stdout] | [INFO] [stdout] 62 | let pow2 = get_operation_value_from_pow(&operation, 2.0); [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `operation` [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/compute.rs:63:45 [INFO] [stdout] | [INFO] [stdout] 63 | let pow1 = get_operation_value_from_pow(&operation, 1.0); [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `operation` [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/compute.rs:64:49 [INFO] [stdout] | [INFO] [stdout] 64 | let constant = get_operation_value_from_pow(&operation, 0.0); [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `operation` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/compute.rs:78:41 [INFO] [stdout] | [INFO] [stdout] 78 | fn find_floating_coefficient(operation: &Vec) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 78 - fn find_floating_coefficient(operation: &Vec) -> bool { [INFO] [stdout] 78 + fn find_floating_coefficient(operation: &[Operation]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/compute.rs:91:9 [INFO] [stdout] | [INFO] [stdout] 91 | format!("The solution is 0") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"The solution is 0".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/compute.rs:137:44 [INFO] [stdout] | [INFO] [stdout] 137 | fn get_operation_value_from_pow(operation: &Vec, pow: f32) -> f32 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 137 - fn get_operation_value_from_pow(operation: &Vec, pow: f32) -> f32 { [INFO] [stdout] 137 + fn get_operation_value_from_pow(operation: &[Operation], pow: f32) -> f32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/equation.rs:55:30 [INFO] [stdout] | [INFO] [stdout] 55 | pub fn get_str_from_vec(vec: &Vec) -> String { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 55 - pub fn get_str_from_vec(vec: &Vec) -> String { [INFO] [stdout] 55 + pub fn get_str_from_vec(vec: &[Operation]) -> String { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/equation.rs:71:8 [INFO] [stdout] | [INFO] [stdout] 71 | if s.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `s.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/parse.rs:12:57 [INFO] [stdout] | [INFO] [stdout] 12 | let operations: Vec<&str> = s.split('=').filter(|v| v.len() != 0).collect(); [INFO] [stdout] | ^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!v.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/parse.rs:62:24 [INFO] [stdout] | [INFO] [stdout] 62 | if !value.is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try: `value.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/parse.rs:81:31 [INFO] [stdout] | [INFO] [stdout] 81 | fn get_token_from_vec(tokens: &Vec, i: i16) -> Token { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 81 - fn get_token_from_vec(tokens: &Vec, i: i16) -> Token { [INFO] [stdout] 81 + fn get_token_from_vec(tokens: &[Token], i: i16) -> Token { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `NUM` contains a capitalized acronym [INFO] [stdout] --> src/parse.rs:93:5 [INFO] [stdout] | [INFO] [stdout] 93 | NUM(f32), [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Num` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] = note: `#[warn(clippy::upper_case_acronyms)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `HAT` contains a capitalized acronym [INFO] [stdout] --> src/parse.rs:95:5 [INFO] [stdout] | [INFO] [stdout] 95 | HAT, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Hat` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `MULT` contains a capitalized acronym [INFO] [stdout] --> src/parse.rs:96:5 [INFO] [stdout] | [INFO] [stdout] 96 | MULT, [INFO] [stdout] | ^^^^ help: consider making the acronym lowercase, except the initial letter: `Mult` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `NONE` contains a capitalized acronym [INFO] [stdout] --> src/parse.rs:97:5 [INFO] [stdout] | [INFO] [stdout] 97 | NONE, [INFO] [stdout] | ^^^^ help: consider making the acronym lowercase, except the initial letter: `None` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/parse.rs:108:16 [INFO] [stdout] | [INFO] [stdout] 108 | ... if prev_str.len() != 0 && i != byte_vector.len() - 1 && is_byte_num(&byte_vector[i + 1]) && prev_str != "-" && prev_str != "+" { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!prev_str.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/parse.rs:129:35 [INFO] [stdout] | [INFO] [stdout] 129 | if should_be_tokenized && prev_str.len() != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!prev_str.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/parse.rs:142:35 [INFO] [stdout] | [INFO] [stdout] 142 | let must_parse_last_element = prev_str.len() != 0; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!prev_str.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the function `handle_number_lexing` doesn't need a mutable reference [INFO] [stdout] --> src/parse.rs:144:42 [INFO] [stdout] | [INFO] [stdout] 144 | handle_number_lexing(&mut lexer, &mut prev_str)?; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed [INFO] [stdout] = note: `#[warn(clippy::unnecessary_mut_passed)]` on by default [INFO] [stdout] help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] 144 - handle_number_lexing(&mut lexer, &mut prev_str)?; [INFO] [stdout] 144 + handle_number_lexing(&mut lexer, &prev_str)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/parse.rs:158:5 [INFO] [stdout] | [INFO] [stdout] 158 | / match byte { [INFO] [stdout] 159 | | b'0'...b'9' | b'.' => true, [INFO] [stdout] 160 | | _ => false, [INFO] [stdout] 161 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] = note: `#[warn(clippy::match_like_matches_macro)]` on by default [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 158 - match byte { [INFO] [stdout] 159 - b'0'...b'9' | b'.' => true, [INFO] [stdout] 160 - _ => false, [INFO] [stdout] 161 - } [INFO] [stdout] 158 + matches!(byte, b'0'...b'9' | b'.') [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/parse.rs:172:55 [INFO] [stdout] | [INFO] [stdout] 172 | let parsed_number: f32 = handle_float_parse_error(&value)?; [INFO] [stdout] | ^^^^^^ help: change this to: `value` [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] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.31s [INFO] running `Command { std: "docker" "inspect" "7488c67c0de88c5ceb86e852179d525ea65c7526f37b50a2cfb4baa29f5493dc", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "7488c67c0de88c5ceb86e852179d525ea65c7526f37b50a2cfb4baa29f5493dc", kill_on_drop: false }` [INFO] [stdout] 7488c67c0de88c5ceb86e852179d525ea65c7526f37b50a2cfb4baa29f5493dc