[INFO] cloning repository https://github.com/sejr/core-interpreter [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/sejr/core-interpreter" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fsejr%2Fcore-interpreter", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fsejr%2Fcore-interpreter'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 64c00c6dba34face0a27e389ac2cd2e2b4bc4976 [INFO] linting sejr/core-interpreter against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fsejr%2Fcore-interpreter" "/workspace/builds/worker-5-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-5-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/sejr/core-interpreter [INFO] finished tweaking git repo https://github.com/sejr/core-interpreter [INFO] tweaked toml for git repo https://github.com/sejr/core-interpreter written to /workspace/builds/worker-5-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/sejr/core-interpreter 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/sejr/core-interpreter 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-5-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-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] 9c39d3461dff027d1f4c410b6fdf5f5fac0c06c350b03faf2bfe3276fa48193e [INFO] running `Command { std: "docker" "start" "-a" "9c39d3461dff027d1f4c410b6fdf5f5fac0c06c350b03faf2bfe3276fa48193e", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "9c39d3461dff027d1f4c410b6fdf5f5fac0c06c350b03faf2bfe3276fa48193e", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "9c39d3461dff027d1f4c410b6fdf5f5fac0c06c350b03faf2bfe3276fa48193e", kill_on_drop: false }` [INFO] [stdout] 9c39d3461dff027d1f4c410b6fdf5f5fac0c06c350b03faf2bfe3276fa48193e [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-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] c0a20b0fe600d2c356a7954679d60be60e01213569328c1dcda0d279e65dcfc2 [INFO] running `Command { std: "docker" "start" "-a" "c0a20b0fe600d2c356a7954679d60be60e01213569328c1dcda0d279e65dcfc2", kill_on_drop: false }` [INFO] [stderr] warning: `package.edition` is unspecified, defaulting to `2015` while the latest is `2024` [INFO] [stderr] Checking core v0.4.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: `...` range patterns are deprecated [INFO] [stdout] --> src/tokenizer.rs:188:16 [INFO] [stdout] | [INFO] [stdout] 188 | '0'...'9' => next_token = tokenize_integer(&buf, &mut i), [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/tokenizer.rs:189:16 [INFO] [stdout] | [INFO] [stdout] 189 | 'a'...'z' => next_token = tokenize_keyword(&buf, &mut i), [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/tokenizer.rs:190:16 [INFO] [stdout] | [INFO] [stdout] 190 | 'A'...'Z' => next_token = tokenize_identifier(&buf, &mut i), [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/tokenizer.rs:188:16 [INFO] [stdout] | [INFO] [stdout] 188 | '0'...'9' => next_token = tokenize_integer(&buf, &mut i), [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/tokenizer.rs:189:16 [INFO] [stdout] | [INFO] [stdout] 189 | 'a'...'z' => next_token = tokenize_keyword(&buf, &mut i), [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/tokenizer.rs:190:16 [INFO] [stdout] | [INFO] [stdout] 190 | 'A'...'Z' => next_token = tokenize_identifier(&buf, &mut i), [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: name `EOF` contains a capitalized acronym [INFO] [stdout] --> src/tokenizer.rs:61:5 [INFO] [stdout] | [INFO] [stdout] 61 | EOF, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter (notice the capitalization): `Eof` [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: unneeded late initialization [INFO] [stdout] --> src/tokenizer.rs:155:9 [INFO] [stdout] | [INFO] [stdout] 155 | let next_token: Token; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] = note: `#[warn(clippy::needless_late_init)]` on by default [INFO] [stdout] help: move the declaration `next_token` here and remove the assignments from the `match` arms [INFO] [stdout] | [INFO] [stdout] 155 ~ [INFO] [stdout] 156 | [INFO] [stdout] 157 ~ let next_token: Token = match buf[i] as char { [INFO] [stdout] 158 | [INFO] [stdout] 159 | // Whitespace characters as defined by Rust language [INFO] [stdout] 160 ~ ' ' => Token::Whitespace, [INFO] [stdout] 161 ~ '\n' => Token::Whitespace, [INFO] [stdout] 162 ~ '\r' => Token::Whitespace, [INFO] [stdout] 163 ~ '\t' => Token::Whitespace, [INFO] [stdout] 164 | [INFO] [stdout] 165 | // Special tokens for parsing statements [INFO] [stdout] 166 ~ ';' => Token::Semicolon, [INFO] [stdout] 167 ~ ',' => Token::Comma, [INFO] [stdout] 168 ~ '[' => Token::LeftSquare, [INFO] [stdout] 169 ~ ']' => Token::RightSquare, [INFO] [stdout] 170 ~ '(' => Token::LeftParen, [INFO] [stdout] 171 ~ ')' => Token::RightParen, [INFO] [stdout] 172 | [INFO] [stdout] 173 | // Mathematical operators [INFO] [stdout] 174 ~ '+' => Token::Addition, [INFO] [stdout] 175 ~ '-' => tokenize_subtraction(&buf, &mut i), [INFO] [stdout] 176 ~ '/' => tokenize_division(&buf, &mut i), [INFO] [stdout] 177 ~ '*' => Token::Multiplication, [INFO] [stdout] 178 | [INFO] [stdout] 179 | // Logical operators [INFO] [stdout] 180 ~ '=' => tokenize_equal(&buf, &mut i), [INFO] [stdout] 181 ~ '!' => tokenize_inequal(&buf, &mut i), [INFO] [stdout] 182 ~ '<' => tokenize_lt_lte(&buf, &mut i), [INFO] [stdout] 183 ~ '>' => tokenize_gt_gte(&buf, &mut i), [INFO] [stdout] 184 ~ '|' => tokenize_logical_or(&buf, &mut i), [INFO] [stdout] 185 ~ '&' => tokenize_logical_and(&buf, &mut i), [INFO] [stdout] 186 | [INFO] [stdout] 187 | // User-defined values [INFO] [stdout] 188 ~ '0'...'9' => tokenize_integer(&buf, &mut i), [INFO] [stdout] 189 ~ 'a'...'z' => tokenize_keyword(&buf, &mut i), [INFO] [stdout] 190 ~ 'A'...'Z' => tokenize_identifier(&buf, &mut i), [INFO] [stdout] 191 ~ _ => Token::Error, [INFO] [stdout] 192 ~ }; [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/tokenizer.rs:220:24 [INFO] [stdout] | [INFO] [stdout] 220 | fn tokenize_equal(buf: &Vec, state: &mut usize) -> 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] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 220 - fn tokenize_equal(buf: &Vec, state: &mut usize) -> Token { [INFO] [stdout] 220 + fn tokenize_equal(buf: &[u8], state: &mut usize) -> Token { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/tokenizer.rs:221:20 [INFO] [stdout] | [INFO] [stdout] 221 | let i: usize = *state as usize; [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `*state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` 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/tokenizer.rs:233:29 [INFO] [stdout] | [INFO] [stdout] 233 | fn tokenize_logical_or(buf: &Vec, state: &mut usize) -> 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] 233 - fn tokenize_logical_or(buf: &Vec, state: &mut usize) -> Token { [INFO] [stdout] 233 + fn tokenize_logical_or(buf: &[u8], state: &mut usize) -> Token { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/tokenizer.rs:235:20 [INFO] [stdout] | [INFO] [stdout] 235 | let i: usize = *state as usize; [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `*state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/tokenizer.rs:245:30 [INFO] [stdout] | [INFO] [stdout] 245 | fn tokenize_logical_and(buf: &Vec, state: &mut usize) -> 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] 245 - fn tokenize_logical_and(buf: &Vec, state: &mut usize) -> Token { [INFO] [stdout] 245 + fn tokenize_logical_and(buf: &[u8], state: &mut usize) -> Token { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/tokenizer.rs:246:20 [INFO] [stdout] | [INFO] [stdout] 246 | let i: usize = *state as usize; [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `*state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/tokenizer.rs:255:26 [INFO] [stdout] | [INFO] [stdout] 255 | fn tokenize_inequal(buf: &Vec, state: &mut usize) -> 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] 255 - fn tokenize_inequal(buf: &Vec, state: &mut usize) -> Token { [INFO] [stdout] 255 + fn tokenize_inequal(buf: &[u8], state: &mut usize) -> Token { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/tokenizer.rs:256:20 [INFO] [stdout] | [INFO] [stdout] 256 | let i: usize = *state as usize; [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `*state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/tokenizer.rs:265:25 [INFO] [stdout] | [INFO] [stdout] 265 | fn tokenize_lt_lte(buf: &Vec, state: &mut usize) -> 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] 265 - fn tokenize_lt_lte(buf: &Vec, state: &mut usize) -> Token { [INFO] [stdout] 265 + fn tokenize_lt_lte(buf: &[u8], state: &mut usize) -> Token { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/tokenizer.rs:266:20 [INFO] [stdout] | [INFO] [stdout] 266 | let i: usize = *state as usize; [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `*state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/tokenizer.rs:275:25 [INFO] [stdout] | [INFO] [stdout] 275 | fn tokenize_gt_gte(buf: &Vec, state: &mut usize) -> 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] 275 - fn tokenize_gt_gte(buf: &Vec, state: &mut usize) -> Token { [INFO] [stdout] 275 + fn tokenize_gt_gte(buf: &[u8], state: &mut usize) -> Token { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/tokenizer.rs:276:20 [INFO] [stdout] | [INFO] [stdout] 276 | let i: usize = *state as usize; [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `*state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/tokenizer.rs:315:23 [INFO] [stdout] | [INFO] [stdout] 315 | } else if (buf[i] as char >= 'a' && buf[i] as char <= 'z') || [INFO] [stdout] | _______________________^ [INFO] [stdout] 316 | | (buf[i] as char >= 'A' && buf[i] as char <= 'z') { [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] 315 - } else if (buf[i] as char >= 'a' && buf[i] as char <= 'z') || [INFO] [stdout] 316 - (buf[i] as char >= 'A' && buf[i] as char <= 'z') { [INFO] [stdout] 315 + } else if !(buf[i] as char > 'z' || (buf[i] as char) < 'a' && (buf[i] as char) < 'A') { [INFO] [stdout] | [INFO] [stdout] 315 - } else if (buf[i] as char >= 'a' && buf[i] as char <= 'z') || [INFO] [stdout] 316 - (buf[i] as char >= 'A' && buf[i] as char <= 'z') { [INFO] [stdout] 315 + } else if (buf[i] as char >= 'A' || buf[i] as char >= 'a') && buf[i] as char <= 'z' { [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/tokenizer.rs:292:30 [INFO] [stdout] | [INFO] [stdout] 292 | fn tokenize_subtraction(buf: &Vec, state: &mut usize) -> 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] 292 - fn tokenize_subtraction(buf: &Vec, state: &mut usize) -> Token { [INFO] [stdout] 292 + fn tokenize_subtraction(buf: &[u8], state: &mut usize) -> Token { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/tokenizer.rs:293:24 [INFO] [stdout] | [INFO] [stdout] 293 | let mut i: usize = *state as usize; [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `*state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: statement with no effect [INFO] [stdout] --> src/tokenizer.rs:309:9 [INFO] [stdout] | [INFO] [stdout] 309 | i + 1; [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#no_effect [INFO] [stdout] = note: `#[warn(clippy::no_effect)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character converted to string [INFO] [stdout] --> src/tokenizer.rs:314:17 [INFO] [stdout] | [INFO] [stdout] 314 | integer.push_str(&new_digit.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` without `to_string()`: `integer.push(new_digit)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] = note: `#[warn(clippy::single_char_add_str)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/tokenizer.rs:347:9 [INFO] [stdout] | [INFO] [stdout] 347 | return Token::LineComment; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 347 - return Token::LineComment; [INFO] [stdout] 347 + Token::LineComment [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/tokenizer.rs:365:9 [INFO] [stdout] | [INFO] [stdout] 365 | return Token::BlockComment; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 365 - return Token::BlockComment; [INFO] [stdout] 365 + Token::BlockComment [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/tokenizer.rs:367:9 [INFO] [stdout] | [INFO] [stdout] 367 | return Token::Divison; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 367 - return Token::Divison; [INFO] [stdout] 367 + Token::Divison [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/tokenizer.rs:336:27 [INFO] [stdout] | [INFO] [stdout] 336 | fn tokenize_division(buf: &Vec, state: &mut usize) -> 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] 336 - fn tokenize_division(buf: &Vec, state: &mut usize) -> Token { [INFO] [stdout] 336 + fn tokenize_division(buf: &[u8], state: &mut usize) -> Token { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/tokenizer.rs:337:24 [INFO] [stdout] | [INFO] [stdout] 337 | let mut i: usize = *state as usize; [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `*state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/tokenizer.rs:341:13 [INFO] [stdout] | [INFO] [stdout] 341 | i = i + 1; [INFO] [stdout] | ^^^^^^^^^ help: replace it with: `i += 1` [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: manual implementation of an assign operation [INFO] [stdout] --> src/tokenizer.rs:352:13 [INFO] [stdout] | [INFO] [stdout] 352 | i = i+1; [INFO] [stdout] | ^^^^^^^ help: replace it with: `i += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/tokenizer.rs:356:21 [INFO] [stdout] | [INFO] [stdout] 356 | i = i + 2; [INFO] [stdout] | ^^^^^^^^^ help: replace it with: `i += 2` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/tokenizer.rs:388:19 [INFO] [stdout] | [INFO] [stdout] 388 | } else if (buf[i] as char >= 'a' && buf[i] as char <= 'z') || [INFO] [stdout] | ___________________^ [INFO] [stdout] 389 | | (buf[i] as char >= 'A' && buf[i] as char <= 'z') { [INFO] [stdout] | |__________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 388 - } else if (buf[i] as char >= 'a' && buf[i] as char <= 'z') || [INFO] [stdout] 389 - (buf[i] as char >= 'A' && buf[i] as char <= 'z') { [INFO] [stdout] 388 + } else if !(buf[i] as char > 'z' || (buf[i] as char) < 'a' && (buf[i] as char) < 'A') { [INFO] [stdout] | [INFO] [stdout] 388 - } else if (buf[i] as char >= 'a' && buf[i] as char <= 'z') || [INFO] [stdout] 389 - (buf[i] as char >= 'A' && buf[i] as char <= 'z') { [INFO] [stdout] 388 + } else if (buf[i] as char >= 'A' || buf[i] as char >= 'a') && buf[i] as char <= 'z' { [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/tokenizer.rs:371:26 [INFO] [stdout] | [INFO] [stdout] 371 | fn tokenize_integer(buf: &Vec, state: &mut usize) -> 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] 371 - fn tokenize_integer(buf: &Vec, state: &mut usize) -> Token { [INFO] [stdout] 371 + fn tokenize_integer(buf: &[u8], state: &mut usize) -> Token { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/tokenizer.rs:372:24 [INFO] [stdout] | [INFO] [stdout] 372 | let mut i: usize = *state as usize; [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `*state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character converted to string [INFO] [stdout] --> src/tokenizer.rs:387:13 [INFO] [stdout] | [INFO] [stdout] 387 | integer.push_str(&new_digit.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` without `to_string()`: `integer.push(new_digit)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/tokenizer.rs:439:22 [INFO] [stdout] | [INFO] [stdout] 439 | "program" => return Token::Program, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 439 - "program" => return Token::Program, [INFO] [stdout] 439 + "program" => Token::Program, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/tokenizer.rs:440:20 [INFO] [stdout] | [INFO] [stdout] 440 | "begin" => return Token::Begin, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 440 - "begin" => return Token::Begin, [INFO] [stdout] 440 + "begin" => Token::Begin, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/tokenizer.rs:441:18 [INFO] [stdout] | [INFO] [stdout] 441 | "end" => return Token::End, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 441 - "end" => return Token::End, [INFO] [stdout] 441 + "end" => Token::End, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/tokenizer.rs:442:18 [INFO] [stdout] | [INFO] [stdout] 442 | "int" => return Token::Int, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 442 - "int" => return Token::Int, [INFO] [stdout] 442 + "int" => Token::Int, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/tokenizer.rs:443:17 [INFO] [stdout] | [INFO] [stdout] 443 | "if" => return Token::If, [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 443 - "if" => return Token::If, [INFO] [stdout] 443 + "if" => Token::If, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/tokenizer.rs:444:19 [INFO] [stdout] | [INFO] [stdout] 444 | "then" => return Token::Then, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 444 - "then" => return Token::Then, [INFO] [stdout] 444 + "then" => Token::Then, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/tokenizer.rs:445:19 [INFO] [stdout] | [INFO] [stdout] 445 | "else" => return Token::Else, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 445 - "else" => return Token::Else, [INFO] [stdout] 445 + "else" => Token::Else, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/tokenizer.rs:446:20 [INFO] [stdout] | [INFO] [stdout] 446 | "while" => return Token::While, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 446 - "while" => return Token::While, [INFO] [stdout] 446 + "while" => Token::While, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/tokenizer.rs:447:19 [INFO] [stdout] | [INFO] [stdout] 447 | "loop" => return Token::Loop, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 447 - "loop" => return Token::Loop, [INFO] [stdout] 447 + "loop" => Token::Loop, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/tokenizer.rs:448:19 [INFO] [stdout] | [INFO] [stdout] 448 | "read" => return Token::Read, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 448 - "read" => return Token::Read, [INFO] [stdout] 448 + "read" => Token::Read, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/tokenizer.rs:449:20 [INFO] [stdout] | [INFO] [stdout] 449 | "write" => return Token::Write, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 449 - "write" => return Token::Write, [INFO] [stdout] 449 + "write" => Token::Write, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/tokenizer.rs:450:14 [INFO] [stdout] | [INFO] [stdout] 450 | _ => return Token::Error, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 450 - _ => return Token::Error, [INFO] [stdout] 450 + _ => Token::Error, [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/tokenizer.rs:406:26 [INFO] [stdout] | [INFO] [stdout] 406 | fn tokenize_keyword(buf: &Vec, state: &mut usize) -> 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] 406 - fn tokenize_keyword(buf: &Vec, state: &mut usize) -> Token { [INFO] [stdout] 406 + fn tokenize_keyword(buf: &[u8], state: &mut usize) -> Token { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/tokenizer.rs:407:24 [INFO] [stdout] | [INFO] [stdout] 407 | let mut i: usize = *state as usize; [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `*state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character converted to string [INFO] [stdout] --> src/tokenizer.rs:425:13 [INFO] [stdout] | [INFO] [stdout] 425 | keyword.push_str(&new_char.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` without `to_string()`: `keyword.push(new_char)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/tokenizer.rs:485:19 [INFO] [stdout] | [INFO] [stdout] 485 | } else if (buf[i] as char >= 'a' && buf[i] as char <= 'z') || [INFO] [stdout] | ___________________^ [INFO] [stdout] 486 | | (buf[i] as char >= 'A' && buf[i] as char <= 'z') { [INFO] [stdout] | |__________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 485 - } else if (buf[i] as char >= 'a' && buf[i] as char <= 'z') || [INFO] [stdout] 486 - (buf[i] as char >= 'A' && buf[i] as char <= 'z') { [INFO] [stdout] 485 + } else if !(buf[i] as char > 'z' || (buf[i] as char) < 'a' && (buf[i] as char) < 'A') { [INFO] [stdout] | [INFO] [stdout] 485 - } else if (buf[i] as char >= 'a' && buf[i] as char <= 'z') || [INFO] [stdout] 486 - (buf[i] as char >= 'A' && buf[i] as char <= 'z') { [INFO] [stdout] 485 + } else if (buf[i] as char >= 'A' || buf[i] as char >= 'a') && buf[i] as char <= 'z' { [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/tokenizer.rs:454:29 [INFO] [stdout] | [INFO] [stdout] 454 | fn tokenize_identifier(buf: &Vec, state: &mut usize) -> 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] 454 - fn tokenize_identifier(buf: &Vec, state: &mut usize) -> Token { [INFO] [stdout] 454 + fn tokenize_identifier(buf: &[u8], state: &mut usize) -> Token { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/tokenizer.rs:455:24 [INFO] [stdout] | [INFO] [stdout] 455 | let mut i: usize = *state as usize; [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `*state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character converted to string [INFO] [stdout] --> src/tokenizer.rs:471:13 [INFO] [stdout] | [INFO] [stdout] 471 | identifier.push_str(&new_char.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` without `to_string()`: `identifier.push(new_char)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character converted to string [INFO] [stdout] --> src/tokenizer.rs:484:13 [INFO] [stdout] | [INFO] [stdout] 484 | identifier.push_str(&new_digit.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` without `to_string()`: `identifier.push(new_digit)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/executor.rs:44:26 [INFO] [stdout] | [INFO] [stdout] 44 | execute_decl_seq(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:49:30 [INFO] [stdout] | [INFO] [stdout] 49 | execute_stmt_seq(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:71:18 [INFO] [stdout] | [INFO] [stdout] 71 | execute_decl(&mut tree); // parses declaration and moves on [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:74:26 [INFO] [stdout] | [INFO] [stdout] 74 | execute_decl_seq(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:84:25 [INFO] [stdout] | [INFO] [stdout] 84 | execute_id_list(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/executor.rs:104:9 [INFO] [stdout] | [INFO] [stdout] 104 | &Token::Identifier(ref i) => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] = note: `#[warn(clippy::needless_borrowed_reference)]` on by default [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 104 - &Token::Identifier(ref i) => { [INFO] [stdout] 104 + Token::Identifier(i) => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/executor.rs:113:20 [INFO] [stdout] | [INFO] [stdout] 113 | execute_in(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:116:21 [INFO] [stdout] | [INFO] [stdout] 116 | execute_out(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:119:20 [INFO] [stdout] | [INFO] [stdout] 119 | execute_if(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:122:22 [INFO] [stdout] | [INFO] [stdout] 122 | execute_loop(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:126:24 [INFO] [stdout] | [INFO] [stdout] 126 | execute_assign(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:130:26 [INFO] [stdout] | [INFO] [stdout] 130 | execute_stmt_seq(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:141:16 [INFO] [stdout] | [INFO] [stdout] 141 | execute_id(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:145:25 [INFO] [stdout] | [INFO] [stdout] 145 | execute_id_list(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:157:16 [INFO] [stdout] | [INFO] [stdout] 157 | execute_id(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:160:39 [INFO] [stdout] | [INFO] [stdout] 160 | let result: i32 = execute_exp(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `i32` which implements the `Copy` trait [INFO] [stdout] --> src/executor.rs:161:50 [INFO] [stdout] | [INFO] [stdout] 161 | tree.insert_variable(current_id.clone(), result.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try removing the `clone` call: `result` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` 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/executor.rs:178:41 [INFO] [stdout] | [INFO] [stdout] 178 | let mut result: bool = execute_cond(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:184:30 [INFO] [stdout] | [INFO] [stdout] 184 | execute_stmt_seq(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:224:30 [INFO] [stdout] | [INFO] [stdout] 224 | execute_stmt_seq(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `u32` which implements the `Copy` trait [INFO] [stdout] --> src/executor.rs:248:31 [INFO] [stdout] | [INFO] [stdout] 248 | let mut start_state:u32 = tree.state.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `tree.state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/executor.rs:251:41 [INFO] [stdout] | [INFO] [stdout] 251 | let mut result: bool = execute_cond(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:257:30 [INFO] [stdout] | [INFO] [stdout] 257 | execute_stmt_seq(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:259:26 [INFO] [stdout] | [INFO] [stdout] 259 | execute_loop(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:297:21 [INFO] [stdout] | [INFO] [stdout] 297 | execute_id_list(&mut tree); // Filling context [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:338:21 [INFO] [stdout] | [INFO] [stdout] 338 | execute_id_list(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:362:31 [INFO] [stdout] | [INFO] [stdout] 362 | result = execute_cond(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:365:49 [INFO] [stdout] | [INFO] [stdout] 365 | let result_and: bool = execute_cond(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:374:48 [INFO] [stdout] | [INFO] [stdout] 374 | let result_or: bool = execute_cond(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:385:32 [INFO] [stdout] | [INFO] [stdout] 385 | result = !execute_comp(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:387:31 [INFO] [stdout] | [INFO] [stdout] 387 | result = execute_comp(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:404:27 [INFO] [stdout] | [INFO] [stdout] 404 | op_a = execute_op(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:405:31 [INFO] [stdout] | [INFO] [stdout] 405 | cmp = execute_comp_op(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:406:27 [INFO] [stdout] | [INFO] [stdout] 406 | op_b = execute_op(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:435:26 [INFO] [stdout] | [INFO] [stdout] 435 | result = execute_trm(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:440:31 [INFO] [stdout] | [INFO] [stdout] 440 | result += execute_exp(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:444:31 [INFO] [stdout] | [INFO] [stdout] 444 | result -= execute_exp(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:455:38 [INFO] [stdout] | [INFO] [stdout] 455 | let mut result: i32 = execute_op(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:460:31 [INFO] [stdout] | [INFO] [stdout] 460 | result *= execute_trm(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:479:30 [INFO] [stdout] | [INFO] [stdout] 479 | result = execute_exp(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you don't need to add `&` to all patterns [INFO] [stdout] --> src/executor.rs:486:9 [INFO] [stdout] | [INFO] [stdout] 486 | / match tree.get_token() { [INFO] [stdout] 487 | | &Token::Identifier(ref id) => id_flag = true, [INFO] [stdout] 488 | | &Token::Integer(ref i) => int_flag = true, [INFO] [stdout] 489 | | _ => panic!("execute_op: token is not identifier") [INFO] [stdout] 490 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stdout] = note: `#[warn(clippy::match_ref_pats)]` on by default [INFO] [stdout] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stdout] | [INFO] [stdout] 486 ~ match *tree.get_token() { [INFO] [stdout] 487 ~ Token::Identifier(ref id) => id_flag = true, [INFO] [stdout] 488 ~ Token::Integer(ref i) => int_flag = true, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/executor.rs:487:13 [INFO] [stdout] | [INFO] [stdout] 487 | &Token::Identifier(ref id) => id_flag = true, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 487 - &Token::Identifier(ref id) => id_flag = true, [INFO] [stdout] 487 + Token::Identifier(id) => id_flag = true, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/executor.rs:488:13 [INFO] [stdout] | [INFO] [stdout] 488 | &Token::Integer(ref i) => int_flag = true, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 488 - &Token::Integer(ref i) => int_flag = true, [INFO] [stdout] 488 + Token::Integer(i) => int_flag = true, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/executor.rs:496:24 [INFO] [stdout] | [INFO] [stdout] 496 | execute_id(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:500:25 [INFO] [stdout] | [INFO] [stdout] 500 | execute_int(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you don't need to add `&` to all patterns [INFO] [stdout] --> src/executor.rs:515:5 [INFO] [stdout] | [INFO] [stdout] 515 | / match tree.get_token() { [INFO] [stdout] 516 | | &Token::LogicalEquality => { [INFO] [stdout] 517 | | result = 0; [INFO] [stdout] 518 | | }, [INFO] [stdout] ... | [INFO] [stdout] 534 | | _ => panic!("execute_comp_op: unexpected comp op") [INFO] [stdout] 535 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stdout] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stdout] | [INFO] [stdout] 515 ~ match *tree.get_token() { [INFO] [stdout] 516 ~ Token::LogicalEquality => { [INFO] [stdout] 517 | result = 0; [INFO] [stdout] 518 | }, [INFO] [stdout] 519 ~ Token::LogicalInequality => { [INFO] [stdout] 520 | result = 1; [INFO] [stdout] 521 | }, [INFO] [stdout] 522 ~ Token::LessThan => { [INFO] [stdout] 523 | result = 2; [INFO] [stdout] 524 | }, [INFO] [stdout] 525 ~ Token::LessThanEqual => { [INFO] [stdout] 526 | result = 3; [INFO] [stdout] 527 | }, [INFO] [stdout] 528 ~ Token::GreaterThan => { [INFO] [stdout] 529 | result = 4; [INFO] [stdout] 530 | }, [INFO] [stdout] 531 ~ Token::GreaterThanEqual => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/parser.rs:27:9 [INFO] [stdout] | [INFO] [stdout] 27 | return &self.tokens.index(self.state as usize); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 27 - return &self.tokens.index(self.state as usize); [INFO] [stdout] 27 + &self.tokens.index(self.state as usize) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/parser.rs:27:16 [INFO] [stdout] | [INFO] [stdout] 27 | return &self.tokens.index(self.state as usize); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `self.tokens.index(self.state as usize)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/parser.rs:32:42 [INFO] [stdout] | [INFO] [stdout] 32 | Token::Identifier(ref id) => return id.to_string(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 32 - Token::Identifier(ref id) => return id.to_string(), [INFO] [stdout] 32 + Token::Identifier(ref id) => id.to_string(), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/parser.rs:45:42 [INFO] [stdout] | [INFO] [stdout] 45 | Token::Integer(ref value) => return value, [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 45 - Token::Integer(ref value) => return value, [INFO] [stdout] 45 + Token::Integer(ref value) => value, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/parser.rs:73:29 [INFO] [stdout] | [INFO] [stdout] 73 | Some(&value) => return value, [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 73 - Some(&value) => return value, [INFO] [stdout] 73 + Some(&value) => value, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> src/parser.rs:83:9 [INFO] [stdout] | [INFO] [stdout] 83 | println!(""); [INFO] [stdout] | ^^^^^^^^^--^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [INFO] [stdout] = note: `#[warn(clippy::println_empty_string)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/parser.rs:135:24 [INFO] [stdout] | [INFO] [stdout] 135 | parse_decl_seq(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:141:28 [INFO] [stdout] | [INFO] [stdout] 141 | parse_stmt_seq(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:161:16 [INFO] [stdout] | [INFO] [stdout] 161 | parse_decl(&mut tree); // parses declaration and moves on [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:164:24 [INFO] [stdout] | [INFO] [stdout] 164 | parse_decl_seq(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:175:23 [INFO] [stdout] | [INFO] [stdout] 175 | parse_id_list(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/parser.rs:197:9 [INFO] [stdout] | [INFO] [stdout] 197 | &Token::Identifier(ref i) => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 197 - &Token::Identifier(ref i) => { [INFO] [stdout] 197 + Token::Identifier(i) => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/parser.rs:206:18 [INFO] [stdout] | [INFO] [stdout] 206 | parse_in(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:209:19 [INFO] [stdout] | [INFO] [stdout] 209 | parse_out(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:212:18 [INFO] [stdout] | [INFO] [stdout] 212 | parse_if(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:215:20 [INFO] [stdout] | [INFO] [stdout] 215 | parse_loop(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:219:22 [INFO] [stdout] | [INFO] [stdout] 219 | parse_assign(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:223:24 [INFO] [stdout] | [INFO] [stdout] 223 | parse_stmt_seq(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:234:14 [INFO] [stdout] | [INFO] [stdout] 234 | parse_id(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:239:23 [INFO] [stdout] | [INFO] [stdout] 239 | parse_id_list(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:251:14 [INFO] [stdout] | [INFO] [stdout] 251 | parse_id(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:255:37 [INFO] [stdout] | [INFO] [stdout] 255 | let result: i32 = parse_exp(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `i32` which implements the `Copy` trait [INFO] [stdout] --> src/parser.rs:256:50 [INFO] [stdout] | [INFO] [stdout] 256 | tree.insert_variable(current_id.clone(), result.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try removing the `clone` call: `result` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/parser.rs:277:16 [INFO] [stdout] | [INFO] [stdout] 277 | parse_cond(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:283:24 [INFO] [stdout] | [INFO] [stdout] 283 | parse_stmt_seq(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/parser.rs:289:17 [INFO] [stdout] | [INFO] [stdout] 289 | tree.current_statement.push_str(";"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `tree.current_statement.push(';')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/parser.rs:300:28 [INFO] [stdout] | [INFO] [stdout] 300 | parse_stmt_seq(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/parser.rs:306:21 [INFO] [stdout] | [INFO] [stdout] 306 | tree.current_statement.push_str(";"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `tree.current_statement.push(';')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/parser.rs:329:35 [INFO] [stdout] | [INFO] [stdout] 329 | let result: bool = parse_cond(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:335:24 [INFO] [stdout] | [INFO] [stdout] 335 | parse_stmt_seq(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/parser.rs:341:17 [INFO] [stdout] | [INFO] [stdout] 341 | tree.current_statement.push_str(";"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `tree.current_statement.push(';')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/parser.rs:363:19 [INFO] [stdout] | [INFO] [stdout] 363 | parse_id_list(&mut tree); // Filling context [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:389:19 [INFO] [stdout] | [INFO] [stdout] 389 | parse_id_list(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:416:29 [INFO] [stdout] | [INFO] [stdout] 416 | result = parse_cond(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:420:47 [INFO] [stdout] | [INFO] [stdout] 420 | let result_and: bool = parse_cond(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:431:46 [INFO] [stdout] | [INFO] [stdout] 431 | let result_or: bool = parse_cond(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/parser.rs:443:9 [INFO] [stdout] | [INFO] [stdout] 443 | tree.current_statement.push_str("!"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `tree.current_statement.push('!')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/parser.rs:444:30 [INFO] [stdout] | [INFO] [stdout] 444 | result = !parse_comp(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:446:29 [INFO] [stdout] | [INFO] [stdout] 446 | result = parse_comp(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:464:25 [INFO] [stdout] | [INFO] [stdout] 464 | op_a = parse_op(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:465:29 [INFO] [stdout] | [INFO] [stdout] 465 | cmp = parse_comp_op(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:466:25 [INFO] [stdout] | [INFO] [stdout] 466 | op_b = parse_op(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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: name `EOF` contains a capitalized acronym [INFO] [stdout] --> src/tokenizer.rs:61:5 [INFO] [stdout] | [INFO] [stdout] 61 | EOF, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter (notice the capitalization): `Eof` [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/parser.rs:496:24 [INFO] [stdout] | [INFO] [stdout] 496 | result = parse_trm(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:502:29 [INFO] [stdout] | [INFO] [stdout] 502 | result += parse_exp(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:507:29 [INFO] [stdout] | [INFO] [stdout] 507 | result -= parse_exp(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:518:36 [INFO] [stdout] | [INFO] [stdout] 518 | let mut result: i32 = parse_op(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:524:29 [INFO] [stdout] | [INFO] [stdout] 524 | result *= parse_trm(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:544:28 [INFO] [stdout] | [INFO] [stdout] 544 | result = parse_exp(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you don't need to add `&` to all patterns [INFO] [stdout] --> src/parser.rs:552:9 [INFO] [stdout] | [INFO] [stdout] 552 | / match tree.get_token() { [INFO] [stdout] 553 | | &Token::Identifier(ref id) => id_flag = true, [INFO] [stdout] 554 | | &Token::Integer(ref i) => int_flag = true, [INFO] [stdout] 555 | | _ => panic!("parse_op: token is not identifier") [INFO] [stdout] 556 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stdout] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stdout] | [INFO] [stdout] 552 ~ match *tree.get_token() { [INFO] [stdout] 553 ~ Token::Identifier(ref id) => id_flag = true, [INFO] [stdout] 554 ~ Token::Integer(ref i) => int_flag = true, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/parser.rs:553:13 [INFO] [stdout] | [INFO] [stdout] 553 | &Token::Identifier(ref id) => id_flag = true, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 553 - &Token::Identifier(ref id) => id_flag = true, [INFO] [stdout] 553 + Token::Identifier(id) => id_flag = true, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/parser.rs:554:13 [INFO] [stdout] | [INFO] [stdout] 554 | &Token::Integer(ref i) => int_flag = true, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 554 - &Token::Integer(ref i) => int_flag = true, [INFO] [stdout] 554 + Token::Integer(i) => int_flag = true, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/parser.rs:562:22 [INFO] [stdout] | [INFO] [stdout] 562 | parse_id(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:566:23 [INFO] [stdout] | [INFO] [stdout] 566 | parse_int(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you don't need to add `&` to all patterns [INFO] [stdout] --> src/parser.rs:581:5 [INFO] [stdout] | [INFO] [stdout] 581 | / match tree.get_token() { [INFO] [stdout] 582 | | &Token::LogicalEquality => { [INFO] [stdout] 583 | | tree.current_statement.push_str(" == "); [INFO] [stdout] 584 | | result = 0; [INFO] [stdout] ... | [INFO] [stdout] 606 | | _ => panic!("parse_comp_op: unexpected comp op") [INFO] [stdout] 607 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stdout] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stdout] | [INFO] [stdout] 581 ~ match *tree.get_token() { [INFO] [stdout] 582 ~ Token::LogicalEquality => { [INFO] [stdout] 583 | tree.current_statement.push_str(" == "); [INFO] [stdout] 584 | result = 0; [INFO] [stdout] 585 | }, [INFO] [stdout] 586 ~ Token::LogicalInequality => { [INFO] [stdout] 587 | tree.current_statement.push_str(" != "); [INFO] [stdout] 588 | result = 1; [INFO] [stdout] 589 | }, [INFO] [stdout] 590 ~ Token::LessThan => { [INFO] [stdout] 591 | tree.current_statement.push_str(" < "); [INFO] [stdout] 592 | result = 2; [INFO] [stdout] 593 | }, [INFO] [stdout] 594 ~ Token::LessThanEqual => { [INFO] [stdout] 595 | tree.current_statement.push_str(" <= "); [INFO] [stdout] 596 | result = 3; [INFO] [stdout] 597 | }, [INFO] [stdout] 598 ~ Token::GreaterThan => { [INFO] [stdout] 599 | tree.current_statement.push_str(" > "); [INFO] [stdout] 600 | result = 4; [INFO] [stdout] 601 | }, [INFO] [stdout] 602 ~ Token::GreaterThanEqual => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/tokenizer.rs:155:9 [INFO] [stdout] | [INFO] [stdout] 155 | let next_token: Token; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] = note: `#[warn(clippy::needless_late_init)]` on by default [INFO] [stdout] help: move the declaration `next_token` here and remove the assignments from the `match` arms [INFO] [stdout] | [INFO] [stdout] 155 ~ [INFO] [stdout] 156 | [INFO] [stdout] 157 ~ let next_token: Token = match buf[i] as char { [INFO] [stdout] 158 | [INFO] [stdout] 159 | // Whitespace characters as defined by Rust language [INFO] [stdout] 160 ~ ' ' => Token::Whitespace, [INFO] [stdout] 161 ~ '\n' => Token::Whitespace, [INFO] [stdout] 162 ~ '\r' => Token::Whitespace, [INFO] [stdout] 163 ~ '\t' => Token::Whitespace, [INFO] [stdout] 164 | [INFO] [stdout] 165 | // Special tokens for parsing statements [INFO] [stdout] 166 ~ ';' => Token::Semicolon, [INFO] [stdout] 167 ~ ',' => Token::Comma, [INFO] [stdout] 168 ~ '[' => Token::LeftSquare, [INFO] [stdout] 169 ~ ']' => Token::RightSquare, [INFO] [stdout] 170 ~ '(' => Token::LeftParen, [INFO] [stdout] 171 ~ ')' => Token::RightParen, [INFO] [stdout] 172 | [INFO] [stdout] 173 | // Mathematical operators [INFO] [stdout] 174 ~ '+' => Token::Addition, [INFO] [stdout] 175 ~ '-' => tokenize_subtraction(&buf, &mut i), [INFO] [stdout] 176 ~ '/' => tokenize_division(&buf, &mut i), [INFO] [stdout] 177 ~ '*' => Token::Multiplication, [INFO] [stdout] 178 | [INFO] [stdout] 179 | // Logical operators [INFO] [stdout] 180 ~ '=' => tokenize_equal(&buf, &mut i), [INFO] [stdout] 181 ~ '!' => tokenize_inequal(&buf, &mut i), [INFO] [stdout] 182 ~ '<' => tokenize_lt_lte(&buf, &mut i), [INFO] [stdout] 183 ~ '>' => tokenize_gt_gte(&buf, &mut i), [INFO] [stdout] 184 ~ '|' => tokenize_logical_or(&buf, &mut i), [INFO] [stdout] 185 ~ '&' => tokenize_logical_and(&buf, &mut i), [INFO] [stdout] 186 | [INFO] [stdout] 187 | // User-defined values [INFO] [stdout] 188 ~ '0'...'9' => tokenize_integer(&buf, &mut i), [INFO] [stdout] 189 ~ 'a'...'z' => tokenize_keyword(&buf, &mut i), [INFO] [stdout] 190 ~ 'A'...'Z' => tokenize_identifier(&buf, &mut i), [INFO] [stdout] 191 ~ _ => Token::Error, [INFO] [stdout] 192 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `ref` on an entire `let` pattern is discouraged, take a reference with `&` instead [INFO] [stdout] --> src/main.rs:15:13 [INFO] [stdout] | [INFO] [stdout] 15 | let ref file: String = args[1]; [INFO] [stdout] | ----^^^^^^^^------------------- help: try: `let file: &String = &args[1];` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#toplevel_ref_arg [INFO] [stdout] = note: `#[warn(clippy::toplevel_ref_arg)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused arithmetic operation that must be used [INFO] [stdout] --> src/tokenizer.rs:309:9 [INFO] [stdout] | [INFO] [stdout] 309 | i + 1; [INFO] [stdout] | ^^^^^ the arithmetic operation produces a value [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_must_use)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: use `let _ = ...` to ignore the resulting value [INFO] [stdout] | [INFO] [stdout] 309 | let _ = i + 1; [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/tokenizer.rs:220:24 [INFO] [stdout] | [INFO] [stdout] 220 | fn tokenize_equal(buf: &Vec, state: &mut usize) -> 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] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 220 - fn tokenize_equal(buf: &Vec, state: &mut usize) -> Token { [INFO] [stdout] 220 + fn tokenize_equal(buf: &[u8], state: &mut usize) -> Token { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/tokenizer.rs:221:20 [INFO] [stdout] | [INFO] [stdout] 221 | let i: usize = *state as usize; [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `*state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` 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/tokenizer.rs:233:29 [INFO] [stdout] | [INFO] [stdout] 233 | fn tokenize_logical_or(buf: &Vec, state: &mut usize) -> 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] 233 - fn tokenize_logical_or(buf: &Vec, state: &mut usize) -> Token { [INFO] [stdout] 233 + fn tokenize_logical_or(buf: &[u8], state: &mut usize) -> Token { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/tokenizer.rs:235:20 [INFO] [stdout] | [INFO] [stdout] 235 | let i: usize = *state as usize; [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `*state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/tokenizer.rs:245:30 [INFO] [stdout] | [INFO] [stdout] 245 | fn tokenize_logical_and(buf: &Vec, state: &mut usize) -> 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] 245 - fn tokenize_logical_and(buf: &Vec, state: &mut usize) -> Token { [INFO] [stdout] 245 + fn tokenize_logical_and(buf: &[u8], state: &mut usize) -> Token { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/tokenizer.rs:246:20 [INFO] [stdout] | [INFO] [stdout] 246 | let i: usize = *state as usize; [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `*state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/tokenizer.rs:255:26 [INFO] [stdout] | [INFO] [stdout] 255 | fn tokenize_inequal(buf: &Vec, state: &mut usize) -> 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] 255 - fn tokenize_inequal(buf: &Vec, state: &mut usize) -> Token { [INFO] [stdout] 255 + fn tokenize_inequal(buf: &[u8], state: &mut usize) -> Token { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/tokenizer.rs:256:20 [INFO] [stdout] | [INFO] [stdout] 256 | let i: usize = *state as usize; [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `*state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/tokenizer.rs:265:25 [INFO] [stdout] | [INFO] [stdout] 265 | fn tokenize_lt_lte(buf: &Vec, state: &mut usize) -> 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] 265 - fn tokenize_lt_lte(buf: &Vec, state: &mut usize) -> Token { [INFO] [stdout] 265 + fn tokenize_lt_lte(buf: &[u8], state: &mut usize) -> Token { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/tokenizer.rs:266:20 [INFO] [stdout] | [INFO] [stdout] 266 | let i: usize = *state as usize; [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `*state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/tokenizer.rs:275:25 [INFO] [stdout] | [INFO] [stdout] 275 | fn tokenize_gt_gte(buf: &Vec, state: &mut usize) -> 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] 275 - fn tokenize_gt_gte(buf: &Vec, state: &mut usize) -> Token { [INFO] [stdout] 275 + fn tokenize_gt_gte(buf: &[u8], state: &mut usize) -> Token { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/tokenizer.rs:276:20 [INFO] [stdout] | [INFO] [stdout] 276 | let i: usize = *state as usize; [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `*state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/tokenizer.rs:315:23 [INFO] [stdout] | [INFO] [stdout] 315 | } else if (buf[i] as char >= 'a' && buf[i] as char <= 'z') || [INFO] [stdout] | _______________________^ [INFO] [stdout] 316 | | (buf[i] as char >= 'A' && buf[i] as char <= 'z') { [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] 315 - } else if (buf[i] as char >= 'a' && buf[i] as char <= 'z') || [INFO] [stdout] 316 - (buf[i] as char >= 'A' && buf[i] as char <= 'z') { [INFO] [stdout] 315 + } else if !(buf[i] as char > 'z' || (buf[i] as char) < 'a' && (buf[i] as char) < 'A') { [INFO] [stdout] | [INFO] [stdout] 315 - } else if (buf[i] as char >= 'a' && buf[i] as char <= 'z') || [INFO] [stdout] 316 - (buf[i] as char >= 'A' && buf[i] as char <= 'z') { [INFO] [stdout] 315 + } else if (buf[i] as char >= 'A' || buf[i] as char >= 'a') && buf[i] as char <= 'z' { [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/tokenizer.rs:292:30 [INFO] [stdout] | [INFO] [stdout] 292 | fn tokenize_subtraction(buf: &Vec, state: &mut usize) -> 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] 292 - fn tokenize_subtraction(buf: &Vec, state: &mut usize) -> Token { [INFO] [stdout] 292 + fn tokenize_subtraction(buf: &[u8], state: &mut usize) -> Token { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/tokenizer.rs:293:24 [INFO] [stdout] | [INFO] [stdout] 293 | let mut i: usize = *state as usize; [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `*state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: statement with no effect [INFO] [stdout] --> src/tokenizer.rs:309:9 [INFO] [stdout] | [INFO] [stdout] 309 | i + 1; [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#no_effect [INFO] [stdout] = note: `#[warn(clippy::no_effect)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character converted to string [INFO] [stdout] --> src/tokenizer.rs:314:17 [INFO] [stdout] | [INFO] [stdout] 314 | integer.push_str(&new_digit.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` without `to_string()`: `integer.push(new_digit)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] = note: `#[warn(clippy::single_char_add_str)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/tokenizer.rs:347:9 [INFO] [stdout] | [INFO] [stdout] 347 | return Token::LineComment; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 347 - return Token::LineComment; [INFO] [stdout] 347 + Token::LineComment [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/tokenizer.rs:365:9 [INFO] [stdout] | [INFO] [stdout] 365 | return Token::BlockComment; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 365 - return Token::BlockComment; [INFO] [stdout] 365 + Token::BlockComment [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/tokenizer.rs:367:9 [INFO] [stdout] | [INFO] [stdout] 367 | return Token::Divison; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 367 - return Token::Divison; [INFO] [stdout] 367 + Token::Divison [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/tokenizer.rs:336:27 [INFO] [stdout] | [INFO] [stdout] 336 | fn tokenize_division(buf: &Vec, state: &mut usize) -> 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] 336 - fn tokenize_division(buf: &Vec, state: &mut usize) -> Token { [INFO] [stdout] 336 + fn tokenize_division(buf: &[u8], state: &mut usize) -> Token { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/tokenizer.rs:337:24 [INFO] [stdout] | [INFO] [stdout] 337 | let mut i: usize = *state as usize; [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `*state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/tokenizer.rs:341:13 [INFO] [stdout] | [INFO] [stdout] 341 | i = i + 1; [INFO] [stdout] | ^^^^^^^^^ help: replace it with: `i += 1` [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: manual implementation of an assign operation [INFO] [stdout] --> src/tokenizer.rs:352:13 [INFO] [stdout] | [INFO] [stdout] 352 | i = i+1; [INFO] [stdout] | ^^^^^^^ help: replace it with: `i += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/tokenizer.rs:356:21 [INFO] [stdout] | [INFO] [stdout] 356 | i = i + 2; [INFO] [stdout] | ^^^^^^^^^ help: replace it with: `i += 2` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/tokenizer.rs:388:19 [INFO] [stdout] | [INFO] [stdout] 388 | } else if (buf[i] as char >= 'a' && buf[i] as char <= 'z') || [INFO] [stdout] | ___________________^ [INFO] [stdout] 389 | | (buf[i] as char >= 'A' && buf[i] as char <= 'z') { [INFO] [stdout] | |__________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 388 - } else if (buf[i] as char >= 'a' && buf[i] as char <= 'z') || [INFO] [stdout] 389 - (buf[i] as char >= 'A' && buf[i] as char <= 'z') { [INFO] [stdout] 388 + } else if !(buf[i] as char > 'z' || (buf[i] as char) < 'a' && (buf[i] as char) < 'A') { [INFO] [stdout] | [INFO] [stdout] 388 - } else if (buf[i] as char >= 'a' && buf[i] as char <= 'z') || [INFO] [stdout] 389 - (buf[i] as char >= 'A' && buf[i] as char <= 'z') { [INFO] [stdout] 388 + } else if (buf[i] as char >= 'A' || buf[i] as char >= 'a') && buf[i] as char <= 'z' { [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/tokenizer.rs:371:26 [INFO] [stdout] | [INFO] [stdout] 371 | fn tokenize_integer(buf: &Vec, state: &mut usize) -> 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] 371 - fn tokenize_integer(buf: &Vec, state: &mut usize) -> Token { [INFO] [stdout] 371 + fn tokenize_integer(buf: &[u8], state: &mut usize) -> Token { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/tokenizer.rs:372:24 [INFO] [stdout] | [INFO] [stdout] 372 | let mut i: usize = *state as usize; [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `*state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character converted to string [INFO] [stdout] --> src/tokenizer.rs:387:13 [INFO] [stdout] | [INFO] [stdout] 387 | integer.push_str(&new_digit.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` without `to_string()`: `integer.push(new_digit)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/tokenizer.rs:439:22 [INFO] [stdout] | [INFO] [stdout] 439 | "program" => return Token::Program, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 439 - "program" => return Token::Program, [INFO] [stdout] 439 + "program" => Token::Program, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/tokenizer.rs:440:20 [INFO] [stdout] | [INFO] [stdout] 440 | "begin" => return Token::Begin, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 440 - "begin" => return Token::Begin, [INFO] [stdout] 440 + "begin" => Token::Begin, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/tokenizer.rs:441:18 [INFO] [stdout] | [INFO] [stdout] 441 | "end" => return Token::End, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 441 - "end" => return Token::End, [INFO] [stdout] 441 + "end" => Token::End, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/tokenizer.rs:442:18 [INFO] [stdout] | [INFO] [stdout] 442 | "int" => return Token::Int, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 442 - "int" => return Token::Int, [INFO] [stdout] 442 + "int" => Token::Int, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/tokenizer.rs:443:17 [INFO] [stdout] | [INFO] [stdout] 443 | "if" => return Token::If, [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 443 - "if" => return Token::If, [INFO] [stdout] 443 + "if" => Token::If, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/tokenizer.rs:444:19 [INFO] [stdout] | [INFO] [stdout] 444 | "then" => return Token::Then, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 444 - "then" => return Token::Then, [INFO] [stdout] 444 + "then" => Token::Then, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/tokenizer.rs:445:19 [INFO] [stdout] | [INFO] [stdout] 445 | "else" => return Token::Else, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 445 - "else" => return Token::Else, [INFO] [stdout] 445 + "else" => Token::Else, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/tokenizer.rs:446:20 [INFO] [stdout] | [INFO] [stdout] 446 | "while" => return Token::While, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 446 - "while" => return Token::While, [INFO] [stdout] 446 + "while" => Token::While, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/tokenizer.rs:447:19 [INFO] [stdout] | [INFO] [stdout] 447 | "loop" => return Token::Loop, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 447 - "loop" => return Token::Loop, [INFO] [stdout] 447 + "loop" => Token::Loop, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/tokenizer.rs:448:19 [INFO] [stdout] | [INFO] [stdout] 448 | "read" => return Token::Read, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 448 - "read" => return Token::Read, [INFO] [stdout] 448 + "read" => Token::Read, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/tokenizer.rs:449:20 [INFO] [stdout] | [INFO] [stdout] 449 | "write" => return Token::Write, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 449 - "write" => return Token::Write, [INFO] [stdout] 449 + "write" => Token::Write, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/tokenizer.rs:450:14 [INFO] [stdout] | [INFO] [stdout] 450 | _ => return Token::Error, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 450 - _ => return Token::Error, [INFO] [stdout] 450 + _ => Token::Error, [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/tokenizer.rs:406:26 [INFO] [stdout] | [INFO] [stdout] 406 | fn tokenize_keyword(buf: &Vec, state: &mut usize) -> 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] 406 - fn tokenize_keyword(buf: &Vec, state: &mut usize) -> Token { [INFO] [stdout] 406 + fn tokenize_keyword(buf: &[u8], state: &mut usize) -> Token { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/tokenizer.rs:407:24 [INFO] [stdout] | [INFO] [stdout] 407 | let mut i: usize = *state as usize; [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `*state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character converted to string [INFO] [stdout] --> src/tokenizer.rs:425:13 [INFO] [stdout] | [INFO] [stdout] 425 | keyword.push_str(&new_char.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` without `to_string()`: `keyword.push(new_char)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/tokenizer.rs:485:19 [INFO] [stdout] | [INFO] [stdout] 485 | } else if (buf[i] as char >= 'a' && buf[i] as char <= 'z') || [INFO] [stdout] | ___________________^ [INFO] [stdout] 486 | | (buf[i] as char >= 'A' && buf[i] as char <= 'z') { [INFO] [stdout] | |__________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 485 - } else if (buf[i] as char >= 'a' && buf[i] as char <= 'z') || [INFO] [stdout] 486 - (buf[i] as char >= 'A' && buf[i] as char <= 'z') { [INFO] [stdout] 485 + } else if !(buf[i] as char > 'z' || (buf[i] as char) < 'a' && (buf[i] as char) < 'A') { [INFO] [stdout] | [INFO] [stdout] 485 - } else if (buf[i] as char >= 'a' && buf[i] as char <= 'z') || [INFO] [stdout] 486 - (buf[i] as char >= 'A' && buf[i] as char <= 'z') { [INFO] [stdout] 485 + } else if (buf[i] as char >= 'A' || buf[i] as char >= 'a') && buf[i] as char <= 'z' { [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/tokenizer.rs:454:29 [INFO] [stdout] | [INFO] [stdout] 454 | fn tokenize_identifier(buf: &Vec, state: &mut usize) -> 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] 454 - fn tokenize_identifier(buf: &Vec, state: &mut usize) -> Token { [INFO] [stdout] 454 + fn tokenize_identifier(buf: &[u8], state: &mut usize) -> Token { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/tokenizer.rs:455:24 [INFO] [stdout] | [INFO] [stdout] 455 | let mut i: usize = *state as usize; [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `*state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character converted to string [INFO] [stdout] --> src/tokenizer.rs:471:13 [INFO] [stdout] | [INFO] [stdout] 471 | identifier.push_str(&new_char.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` without `to_string()`: `identifier.push(new_char)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character converted to string [INFO] [stdout] --> src/tokenizer.rs:484:13 [INFO] [stdout] | [INFO] [stdout] 484 | identifier.push_str(&new_digit.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` without `to_string()`: `identifier.push(new_digit)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/tokenizer.rs:509:9 [INFO] [stdout] | [INFO] [stdout] 509 | / assert_eq!(super::is_valid_input(case_a.len()), [INFO] [stdout] 510 | | true, [INFO] [stdout] 511 | | "Case A should be valid, but wasn't."); [INFO] [stdout] | |_________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_assert_comparison)]` on by default [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 509 - assert_eq!(super::is_valid_input(case_a.len()), [INFO] [stdout] 510 - true, [INFO] [stdout] 509 + assert!(super::is_valid_input(case_a.len()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/tokenizer.rs:512:9 [INFO] [stdout] | [INFO] [stdout] 512 | / assert_eq!(super::is_valid_input(case_b.len()), [INFO] [stdout] 513 | | false, [INFO] [stdout] 514 | | "Case B should be invalid, but wasn't."); [INFO] [stdout] | |___________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 512 - assert_eq!(super::is_valid_input(case_b.len()), [INFO] [stdout] 513 - false, [INFO] [stdout] 512 + assert!(!super::is_valid_input(case_b.len()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/tokenizer.rs:515:9 [INFO] [stdout] | [INFO] [stdout] 515 | / assert_eq!(super::is_valid_input(case_c.len()), [INFO] [stdout] 516 | | false, [INFO] [stdout] 517 | | "Case C should be invalid, but wasn't."); [INFO] [stdout] | |___________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 515 - assert_eq!(super::is_valid_input(case_c.len()), [INFO] [stdout] 516 - false, [INFO] [stdout] 515 + assert!(!super::is_valid_input(case_c.len()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/executor.rs:44:26 [INFO] [stdout] | [INFO] [stdout] 44 | execute_decl_seq(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:49:30 [INFO] [stdout] | [INFO] [stdout] 49 | execute_stmt_seq(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:71:18 [INFO] [stdout] | [INFO] [stdout] 71 | execute_decl(&mut tree); // parses declaration and moves on [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:74:26 [INFO] [stdout] | [INFO] [stdout] 74 | execute_decl_seq(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:84:25 [INFO] [stdout] | [INFO] [stdout] 84 | execute_id_list(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/executor.rs:104:9 [INFO] [stdout] | [INFO] [stdout] 104 | &Token::Identifier(ref i) => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] = note: `#[warn(clippy::needless_borrowed_reference)]` on by default [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 104 - &Token::Identifier(ref i) => { [INFO] [stdout] 104 + Token::Identifier(i) => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/executor.rs:113:20 [INFO] [stdout] | [INFO] [stdout] 113 | execute_in(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:116:21 [INFO] [stdout] | [INFO] [stdout] 116 | execute_out(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:119:20 [INFO] [stdout] | [INFO] [stdout] 119 | execute_if(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:122:22 [INFO] [stdout] | [INFO] [stdout] 122 | execute_loop(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:126:24 [INFO] [stdout] | [INFO] [stdout] 126 | execute_assign(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:130:26 [INFO] [stdout] | [INFO] [stdout] 130 | execute_stmt_seq(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:141:16 [INFO] [stdout] | [INFO] [stdout] 141 | execute_id(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:145:25 [INFO] [stdout] | [INFO] [stdout] 145 | execute_id_list(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:157:16 [INFO] [stdout] | [INFO] [stdout] 157 | execute_id(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:160:39 [INFO] [stdout] | [INFO] [stdout] 160 | let result: i32 = execute_exp(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `i32` which implements the `Copy` trait [INFO] [stdout] --> src/executor.rs:161:50 [INFO] [stdout] | [INFO] [stdout] 161 | tree.insert_variable(current_id.clone(), result.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try removing the `clone` call: `result` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` 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/executor.rs:178:41 [INFO] [stdout] | [INFO] [stdout] 178 | let mut result: bool = execute_cond(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:184:30 [INFO] [stdout] | [INFO] [stdout] 184 | execute_stmt_seq(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:224:30 [INFO] [stdout] | [INFO] [stdout] 224 | execute_stmt_seq(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `u32` which implements the `Copy` trait [INFO] [stdout] --> src/executor.rs:248:31 [INFO] [stdout] | [INFO] [stdout] 248 | let mut start_state:u32 = tree.state.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `tree.state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/executor.rs:251:41 [INFO] [stdout] | [INFO] [stdout] 251 | let mut result: bool = execute_cond(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:257:30 [INFO] [stdout] | [INFO] [stdout] 257 | execute_stmt_seq(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:259:26 [INFO] [stdout] | [INFO] [stdout] 259 | execute_loop(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:297:21 [INFO] [stdout] | [INFO] [stdout] 297 | execute_id_list(&mut tree); // Filling context [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:338:21 [INFO] [stdout] | [INFO] [stdout] 338 | execute_id_list(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:362:31 [INFO] [stdout] | [INFO] [stdout] 362 | result = execute_cond(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:365:49 [INFO] [stdout] | [INFO] [stdout] 365 | let result_and: bool = execute_cond(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:374:48 [INFO] [stdout] | [INFO] [stdout] 374 | let result_or: bool = execute_cond(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:385:32 [INFO] [stdout] | [INFO] [stdout] 385 | result = !execute_comp(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:387:31 [INFO] [stdout] | [INFO] [stdout] 387 | result = execute_comp(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:404:27 [INFO] [stdout] | [INFO] [stdout] 404 | op_a = execute_op(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:405:31 [INFO] [stdout] | [INFO] [stdout] 405 | cmp = execute_comp_op(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:406:27 [INFO] [stdout] | [INFO] [stdout] 406 | op_b = execute_op(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:435:26 [INFO] [stdout] | [INFO] [stdout] 435 | result = execute_trm(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:440:31 [INFO] [stdout] | [INFO] [stdout] 440 | result += execute_exp(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:444:31 [INFO] [stdout] | [INFO] [stdout] 444 | result -= execute_exp(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:455:38 [INFO] [stdout] | [INFO] [stdout] 455 | let mut result: i32 = execute_op(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:460:31 [INFO] [stdout] | [INFO] [stdout] 460 | result *= execute_trm(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:479:30 [INFO] [stdout] | [INFO] [stdout] 479 | result = execute_exp(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you don't need to add `&` to all patterns [INFO] [stdout] --> src/executor.rs:486:9 [INFO] [stdout] | [INFO] [stdout] 486 | / match tree.get_token() { [INFO] [stdout] 487 | | &Token::Identifier(ref id) => id_flag = true, [INFO] [stdout] 488 | | &Token::Integer(ref i) => int_flag = true, [INFO] [stdout] 489 | | _ => panic!("execute_op: token is not identifier") [INFO] [stdout] 490 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stdout] = note: `#[warn(clippy::match_ref_pats)]` on by default [INFO] [stdout] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stdout] | [INFO] [stdout] 486 ~ match *tree.get_token() { [INFO] [stdout] 487 ~ Token::Identifier(ref id) => id_flag = true, [INFO] [stdout] 488 ~ Token::Integer(ref i) => int_flag = true, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/executor.rs:487:13 [INFO] [stdout] | [INFO] [stdout] 487 | &Token::Identifier(ref id) => id_flag = true, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 487 - &Token::Identifier(ref id) => id_flag = true, [INFO] [stdout] 487 + Token::Identifier(id) => id_flag = true, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/executor.rs:488:13 [INFO] [stdout] | [INFO] [stdout] 488 | &Token::Integer(ref i) => int_flag = true, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 488 - &Token::Integer(ref i) => int_flag = true, [INFO] [stdout] 488 + Token::Integer(i) => int_flag = true, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/executor.rs:496:24 [INFO] [stdout] | [INFO] [stdout] 496 | execute_id(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/executor.rs:500:25 [INFO] [stdout] | [INFO] [stdout] 500 | execute_int(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you don't need to add `&` to all patterns [INFO] [stdout] --> src/executor.rs:515:5 [INFO] [stdout] | [INFO] [stdout] 515 | / match tree.get_token() { [INFO] [stdout] 516 | | &Token::LogicalEquality => { [INFO] [stdout] 517 | | result = 0; [INFO] [stdout] 518 | | }, [INFO] [stdout] ... | [INFO] [stdout] 534 | | _ => panic!("execute_comp_op: unexpected comp op") [INFO] [stdout] 535 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stdout] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stdout] | [INFO] [stdout] 515 ~ match *tree.get_token() { [INFO] [stdout] 516 ~ Token::LogicalEquality => { [INFO] [stdout] 517 | result = 0; [INFO] [stdout] 518 | }, [INFO] [stdout] 519 ~ Token::LogicalInequality => { [INFO] [stdout] 520 | result = 1; [INFO] [stdout] 521 | }, [INFO] [stdout] 522 ~ Token::LessThan => { [INFO] [stdout] 523 | result = 2; [INFO] [stdout] 524 | }, [INFO] [stdout] 525 ~ Token::LessThanEqual => { [INFO] [stdout] 526 | result = 3; [INFO] [stdout] 527 | }, [INFO] [stdout] 528 ~ Token::GreaterThan => { [INFO] [stdout] 529 | result = 4; [INFO] [stdout] 530 | }, [INFO] [stdout] 531 ~ Token::GreaterThanEqual => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/parser.rs:27:9 [INFO] [stdout] | [INFO] [stdout] 27 | return &self.tokens.index(self.state as usize); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 27 - return &self.tokens.index(self.state as usize); [INFO] [stdout] 27 + &self.tokens.index(self.state as usize) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/parser.rs:27:16 [INFO] [stdout] | [INFO] [stdout] 27 | return &self.tokens.index(self.state as usize); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `self.tokens.index(self.state as usize)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/parser.rs:32:42 [INFO] [stdout] | [INFO] [stdout] 32 | Token::Identifier(ref id) => return id.to_string(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 32 - Token::Identifier(ref id) => return id.to_string(), [INFO] [stdout] 32 + Token::Identifier(ref id) => id.to_string(), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/parser.rs:45:42 [INFO] [stdout] | [INFO] [stdout] 45 | Token::Integer(ref value) => return value, [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 45 - Token::Integer(ref value) => return value, [INFO] [stdout] 45 + Token::Integer(ref value) => value, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/parser.rs:73:29 [INFO] [stdout] | [INFO] [stdout] 73 | Some(&value) => return value, [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 73 - Some(&value) => return value, [INFO] [stdout] 73 + Some(&value) => value, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> src/parser.rs:83:9 [INFO] [stdout] | [INFO] [stdout] 83 | println!(""); [INFO] [stdout] | ^^^^^^^^^--^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [INFO] [stdout] = note: `#[warn(clippy::println_empty_string)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/parser.rs:135:24 [INFO] [stdout] | [INFO] [stdout] 135 | parse_decl_seq(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:141:28 [INFO] [stdout] | [INFO] [stdout] 141 | parse_stmt_seq(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:161:16 [INFO] [stdout] | [INFO] [stdout] 161 | parse_decl(&mut tree); // parses declaration and moves on [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:164:24 [INFO] [stdout] | [INFO] [stdout] 164 | parse_decl_seq(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:175:23 [INFO] [stdout] | [INFO] [stdout] 175 | parse_id_list(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/parser.rs:197:9 [INFO] [stdout] | [INFO] [stdout] 197 | &Token::Identifier(ref i) => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 197 - &Token::Identifier(ref i) => { [INFO] [stdout] 197 + Token::Identifier(i) => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/parser.rs:206:18 [INFO] [stdout] | [INFO] [stdout] 206 | parse_in(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:209:19 [INFO] [stdout] | [INFO] [stdout] 209 | parse_out(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:212:18 [INFO] [stdout] | [INFO] [stdout] 212 | parse_if(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:215:20 [INFO] [stdout] | [INFO] [stdout] 215 | parse_loop(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:219:22 [INFO] [stdout] | [INFO] [stdout] 219 | parse_assign(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:223:24 [INFO] [stdout] | [INFO] [stdout] 223 | parse_stmt_seq(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:234:14 [INFO] [stdout] | [INFO] [stdout] 234 | parse_id(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:239:23 [INFO] [stdout] | [INFO] [stdout] 239 | parse_id_list(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:251:14 [INFO] [stdout] | [INFO] [stdout] 251 | parse_id(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:255:37 [INFO] [stdout] | [INFO] [stdout] 255 | let result: i32 = parse_exp(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `i32` which implements the `Copy` trait [INFO] [stdout] --> src/parser.rs:256:50 [INFO] [stdout] | [INFO] [stdout] 256 | tree.insert_variable(current_id.clone(), result.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try removing the `clone` call: `result` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/parser.rs:277:16 [INFO] [stdout] | [INFO] [stdout] 277 | parse_cond(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:283:24 [INFO] [stdout] | [INFO] [stdout] 283 | parse_stmt_seq(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/parser.rs:289:17 [INFO] [stdout] | [INFO] [stdout] 289 | tree.current_statement.push_str(";"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `tree.current_statement.push(';')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/parser.rs:300:28 [INFO] [stdout] | [INFO] [stdout] 300 | parse_stmt_seq(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/parser.rs:306:21 [INFO] [stdout] | [INFO] [stdout] 306 | tree.current_statement.push_str(";"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `tree.current_statement.push(';')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/parser.rs:329:35 [INFO] [stdout] | [INFO] [stdout] 329 | let result: bool = parse_cond(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:335:24 [INFO] [stdout] | [INFO] [stdout] 335 | parse_stmt_seq(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/parser.rs:341:17 [INFO] [stdout] | [INFO] [stdout] 341 | tree.current_statement.push_str(";"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `tree.current_statement.push(';')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/parser.rs:363:19 [INFO] [stdout] | [INFO] [stdout] 363 | parse_id_list(&mut tree); // Filling context [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:389:19 [INFO] [stdout] | [INFO] [stdout] 389 | parse_id_list(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:416:29 [INFO] [stdout] | [INFO] [stdout] 416 | result = parse_cond(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:420:47 [INFO] [stdout] | [INFO] [stdout] 420 | let result_and: bool = parse_cond(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:431:46 [INFO] [stdout] | [INFO] [stdout] 431 | let result_or: bool = parse_cond(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/parser.rs:443:9 [INFO] [stdout] | [INFO] [stdout] 443 | tree.current_statement.push_str("!"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `tree.current_statement.push('!')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/parser.rs:444:30 [INFO] [stdout] | [INFO] [stdout] 444 | result = !parse_comp(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:446:29 [INFO] [stdout] | [INFO] [stdout] 446 | result = parse_comp(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:464:25 [INFO] [stdout] | [INFO] [stdout] 464 | op_a = parse_op(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:465:29 [INFO] [stdout] | [INFO] [stdout] 465 | cmp = parse_comp_op(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:466:25 [INFO] [stdout] | [INFO] [stdout] 466 | op_b = parse_op(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:496:24 [INFO] [stdout] | [INFO] [stdout] 496 | result = parse_trm(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:502:29 [INFO] [stdout] | [INFO] [stdout] 502 | result += parse_exp(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:507:29 [INFO] [stdout] | [INFO] [stdout] 507 | result -= parse_exp(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:518:36 [INFO] [stdout] | [INFO] [stdout] 518 | let mut result: i32 = parse_op(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:524:29 [INFO] [stdout] | [INFO] [stdout] 524 | result *= parse_trm(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:544:28 [INFO] [stdout] | [INFO] [stdout] 544 | result = parse_exp(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you don't need to add `&` to all patterns [INFO] [stdout] --> src/parser.rs:552:9 [INFO] [stdout] | [INFO] [stdout] 552 | / match tree.get_token() { [INFO] [stdout] 553 | | &Token::Identifier(ref id) => id_flag = true, [INFO] [stdout] 554 | | &Token::Integer(ref i) => int_flag = true, [INFO] [stdout] 555 | | _ => panic!("parse_op: token is not identifier") [INFO] [stdout] 556 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stdout] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stdout] | [INFO] [stdout] 552 ~ match *tree.get_token() { [INFO] [stdout] 553 ~ Token::Identifier(ref id) => id_flag = true, [INFO] [stdout] 554 ~ Token::Integer(ref i) => int_flag = true, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/parser.rs:553:13 [INFO] [stdout] | [INFO] [stdout] 553 | &Token::Identifier(ref id) => id_flag = true, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 553 - &Token::Identifier(ref id) => id_flag = true, [INFO] [stdout] 553 + Token::Identifier(id) => id_flag = true, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/parser.rs:554:13 [INFO] [stdout] | [INFO] [stdout] 554 | &Token::Integer(ref i) => int_flag = true, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 554 - &Token::Integer(ref i) => int_flag = true, [INFO] [stdout] 554 + Token::Integer(i) => int_flag = true, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/parser.rs:562:22 [INFO] [stdout] | [INFO] [stdout] 562 | parse_id(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [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/parser.rs:566:23 [INFO] [stdout] | [INFO] [stdout] 566 | parse_int(&mut tree); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `tree` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you don't need to add `&` to all patterns [INFO] [stdout] --> src/parser.rs:581:5 [INFO] [stdout] | [INFO] [stdout] 581 | / match tree.get_token() { [INFO] [stdout] 582 | | &Token::LogicalEquality => { [INFO] [stdout] 583 | | tree.current_statement.push_str(" == "); [INFO] [stdout] 584 | | result = 0; [INFO] [stdout] ... | [INFO] [stdout] 606 | | _ => panic!("parse_comp_op: unexpected comp op") [INFO] [stdout] 607 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stdout] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stdout] | [INFO] [stdout] 581 ~ match *tree.get_token() { [INFO] [stdout] 582 ~ Token::LogicalEquality => { [INFO] [stdout] 583 | tree.current_statement.push_str(" == "); [INFO] [stdout] 584 | result = 0; [INFO] [stdout] 585 | }, [INFO] [stdout] 586 ~ Token::LogicalInequality => { [INFO] [stdout] 587 | tree.current_statement.push_str(" != "); [INFO] [stdout] 588 | result = 1; [INFO] [stdout] 589 | }, [INFO] [stdout] 590 ~ Token::LessThan => { [INFO] [stdout] 591 | tree.current_statement.push_str(" < "); [INFO] [stdout] 592 | result = 2; [INFO] [stdout] 593 | }, [INFO] [stdout] 594 ~ Token::LessThanEqual => { [INFO] [stdout] 595 | tree.current_statement.push_str(" <= "); [INFO] [stdout] 596 | result = 3; [INFO] [stdout] 597 | }, [INFO] [stdout] 598 ~ Token::GreaterThan => { [INFO] [stdout] 599 | tree.current_statement.push_str(" > "); [INFO] [stdout] 600 | result = 4; [INFO] [stdout] 601 | }, [INFO] [stdout] 602 ~ Token::GreaterThanEqual => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `ref` on an entire `let` pattern is discouraged, take a reference with `&` instead [INFO] [stdout] --> src/main.rs:15:13 [INFO] [stdout] | [INFO] [stdout] 15 | let ref file: String = args[1]; [INFO] [stdout] | ----^^^^^^^^------------------- help: try: `let file: &String = &args[1];` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#toplevel_ref_arg [INFO] [stdout] = note: `#[warn(clippy::toplevel_ref_arg)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused arithmetic operation that must be used [INFO] [stdout] --> src/tokenizer.rs:309:9 [INFO] [stdout] | [INFO] [stdout] 309 | i + 1; [INFO] [stdout] | ^^^^^ the arithmetic operation produces a value [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_must_use)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: use `let _ = ...` to ignore the resulting value [INFO] [stdout] | [INFO] [stdout] 309 | let _ = i + 1; [INFO] [stdout] | +++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.39s [INFO] running `Command { std: "docker" "inspect" "c0a20b0fe600d2c356a7954679d60be60e01213569328c1dcda0d279e65dcfc2", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "c0a20b0fe600d2c356a7954679d60be60e01213569328c1dcda0d279e65dcfc2", kill_on_drop: false }` [INFO] [stdout] c0a20b0fe600d2c356a7954679d60be60e01213569328c1dcda0d279e65dcfc2