[INFO] cloning repository https://github.com/Simenf05/compiler [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/Simenf05/compiler" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FSimenf05%2Fcompiler", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FSimenf05%2Fcompiler'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 7139a5fe825cf5b7cd832898547632b61622a006 [INFO] linting Simenf05/compiler against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FSimenf05%2Fcompiler" "/workspace/builds/worker-0-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-0-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/Simenf05/compiler [INFO] finished tweaking git repo https://github.com/Simenf05/compiler [INFO] tweaked toml for git repo https://github.com/Simenf05/compiler written to /workspace/builds/worker-0-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/Simenf05/compiler 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/Simenf05/compiler already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Blocking waiting for file lock on package cache [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] 04efe276fcb4891a35f549aa30dd3964f1d70d850b896cacd527b2f5daefce1d [INFO] running `Command { std: "docker" "start" "-a" "04efe276fcb4891a35f549aa30dd3964f1d70d850b896cacd527b2f5daefce1d", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "04efe276fcb4891a35f549aa30dd3964f1d70d850b896cacd527b2f5daefce1d", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "04efe276fcb4891a35f549aa30dd3964f1d70d850b896cacd527b2f5daefce1d", kill_on_drop: false }` [INFO] [stdout] 04efe276fcb4891a35f549aa30dd3964f1d70d850b896cacd527b2f5daefce1d [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "clippy" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 10579d2bf65ad92bf1d66be2af12c715481b94827b373685465255e955935cf8 [INFO] running `Command { std: "docker" "start" "-a" "10579d2bf65ad92bf1d66be2af12c715481b94827b373685465255e955935cf8", kill_on_drop: false }` [INFO] [stderr] Checking compiler v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/build_ast.rs:28:41 [INFO] [stdout] | [INFO] [stdout] 28 | fn make_conditional(tokens: Vec, mut index: usize) -> Conditional { [INFO] [stdout] | ----^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `index` [INFO] [stdout] --> src/build_ast.rs:28:41 [INFO] [stdout] | [INFO] [stdout] 28 | fn make_conditional(tokens: Vec, mut index: usize) -> Conditional { [INFO] [stdout] | ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_index` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `token_to_asm` is never used [INFO] [stdout] --> src/main.rs:21:4 [INFO] [stdout] | [INFO] [stdout] 21 | fn token_to_asm(tokens: Vec) -> String { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `write_file` is never used [INFO] [stdout] --> src/main.rs:61:4 [INFO] [stdout] | [INFO] [stdout] 61 | fn write_file(path: &str, asm: String) -> io::Result<()> { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `AsmWithPlacement` is never constructed [INFO] [stdout] --> src/asm_generation.rs:4:12 [INFO] [stdout] | [INFO] [stdout] 4 | pub struct AsmWithPlacement { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `AsmPlacement` is never used [INFO] [stdout] --> src/asm_generation.rs:9:10 [INFO] [stdout] | [INFO] [stdout] 9 | pub enum AsmPlacement { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `print_asm` is never used [INFO] [stdout] --> src/asm_generation.rs:15:4 [INFO] [stdout] | [INFO] [stdout] 15 | fn print_asm(statement: &Vec) -> AsmWithPlacement { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `return_asm` is never used [INFO] [stdout] --> src/asm_generation.rs:32:4 [INFO] [stdout] | [INFO] [stdout] 32 | fn return_asm(statement: &Vec) -> AsmWithPlacement { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `const_declaration` is never used [INFO] [stdout] --> src/asm_generation.rs:51:4 [INFO] [stdout] | [INFO] [stdout] 51 | fn const_declaration(statement: &Vec) -> AsmWithPlacement { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `let_declaration` is never used [INFO] [stdout] --> src/asm_generation.rs:70:4 [INFO] [stdout] | [INFO] [stdout] 70 | fn let_declaration(statement: &Vec) -> AsmWithPlacement { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `statement_to_asm` is never used [INFO] [stdout] --> src/asm_generation.rs:81:8 [INFO] [stdout] | [INFO] [stdout] 81 | pub fn statement_to_asm(statement: &Vec) -> Option { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `value` is never read [INFO] [stdout] --> src/tokenaize.rs:5:9 [INFO] [stdout] | [INFO] [stdout] 3 | pub struct Token { [INFO] [stdout] | ----- field in this struct [INFO] [stdout] 4 | pub token_type: TokenType, [INFO] [stdout] 5 | pub value: Option, [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Token` has derived impls for the traits `Debug` and `Clone`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Constant` is never constructed [INFO] [stdout] --> src/build_ast.rs:6:8 [INFO] [stdout] | [INFO] [stdout] 6 | struct Constant {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `tokens` and `conditional` are never read [INFO] [stdout] --> src/build_ast.rs:11:5 [INFO] [stdout] | [INFO] [stdout] 10 | struct Statement { [INFO] [stdout] | --------- fields in this struct [INFO] [stdout] 11 | tokens: Option>, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] 12 | conditional: Option, [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Statement` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `statments` is never read [INFO] [stdout] --> src/build_ast.rs:18:5 [INFO] [stdout] | [INFO] [stdout] 17 | pub struct Scope { [INFO] [stdout] | ----- field in this struct [INFO] [stdout] 18 | statments: Vec, [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Scope` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `condition` and `scope` are never read [INFO] [stdout] --> src/build_ast.rs:23:5 [INFO] [stdout] | [INFO] [stdout] 22 | pub struct Conditional { [INFO] [stdout] | ----------- fields in this struct [INFO] [stdout] 23 | condition: Vec, [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] 24 | scope: Scope, [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Conditional` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/asm_generation.rs:15:25 [INFO] [stdout] | [INFO] [stdout] 15 | fn print_asm(statement: &Vec) -> AsmWithPlacement { [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] 15 - fn print_asm(statement: &Vec) -> AsmWithPlacement { [INFO] [stdout] 15 + fn print_asm(statement: &[Token]) -> AsmWithPlacement { [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/asm_generation.rs:32:26 [INFO] [stdout] | [INFO] [stdout] 32 | fn return_asm(statement: &Vec) -> AsmWithPlacement { [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] 32 - fn return_asm(statement: &Vec) -> AsmWithPlacement { [INFO] [stdout] 32 + fn return_asm(statement: &[Token]) -> AsmWithPlacement { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/asm_generation.rs:39:82 [INFO] [stdout] | [INFO] [stdout] 39 | TokenType::Variable => format!(" movzx rdi, byte [{}]\n", string_value.to_string()), [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] = note: `#[warn(clippy::to_string_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/asm_generation.rs:51:33 [INFO] [stdout] | [INFO] [stdout] 51 | fn const_declaration(statement: &Vec) -> AsmWithPlacement { [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] 51 - fn const_declaration(statement: &Vec) -> AsmWithPlacement { [INFO] [stdout] 51 + fn const_declaration(statement: &[Token]) -> AsmWithPlacement { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/tokenaize.rs:72:8 [INFO] [stdout] | [INFO] [stdout] 72 | if !special.is_none() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `special.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/tokenaize.rs:94:8 [INFO] [stdout] | [INFO] [stdout] 94 | if !first_char.is_none() && first_char == Some('"') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `first_char.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/tokenaize.rs:95:12 [INFO] [stdout] | [INFO] [stdout] 95 | if !last_char.is_none() && last_char == Some('"') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try: `last_char.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/tokenaize.rs:78:5 [INFO] [stdout] | [INFO] [stdout] 78 | / match is_numeric { [INFO] [stdout] 79 | | Ok(_) => { [INFO] [stdout] 80 | | return Some(Token { [INFO] [stdout] 81 | | token_type: TokenType::Number, [INFO] [stdout] ... | [INFO] [stdout] 85 | | _ => (), [INFO] [stdout] 86 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 78 ~ if let Ok(_) = is_numeric { [INFO] [stdout] 79 + return Some(Token { [INFO] [stdout] 80 + token_type: TokenType::Number, [INFO] [stdout] 81 + value: Some(buffer.to_string()), [INFO] [stdout] 82 + }) [INFO] [stdout] 83 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/tokenaize.rs:89:22 [INFO] [stdout] | [INFO] [stdout] 89 | let first_char = buffer.chars().nth(0); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `buffer.chars().next()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] = note: `#[warn(clippy::iter_nth_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/tokenaize.rs:94:5 [INFO] [stdout] | [INFO] [stdout] 94 | / if !first_char.is_none() && first_char == Some('"') { [INFO] [stdout] 95 | | if !last_char.is_none() && last_char == Some('"') { [INFO] [stdout] 96 | | return Some(Token { [INFO] [stdout] 97 | | token_type: TokenType::String, [INFO] [stdout] ... | [INFO] [stdout] 101 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 94 ~ if !first_char.is_none() && first_char == Some('"') [INFO] [stdout] 95 ~ && !last_char.is_none() && last_char == Some('"') { [INFO] [stdout] 96 | return Some(Token { [INFO] [stdout] ... [INFO] [stdout] 99 | }); [INFO] [stdout] 100 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should use the `ends_with` method [INFO] [stdout] --> src/tokenaize.rs:130:33 [INFO] [stdout] | [INFO] [stdout] 130 | if buffer.len() == 1 && buffer.chars().last() == Some('"') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `buffer.ends_with('"')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#chars_last_cmp [INFO] [stdout] = note: `#[warn(clippy::chars_last_cmp)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should use the `ends_with` method [INFO] [stdout] --> src/tokenaize.rs:132:29 [INFO] [stdout] | [INFO] [stdout] 132 | } else if in_lit && buffer.chars().last() == Some('"') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `buffer.ends_with('"')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#chars_last_cmp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should use the `ends_with` method [INFO] [stdout] --> src/tokenaize.rs:136:13 [INFO] [stdout] | [INFO] [stdout] 136 | if (buffer.chars().last() == Some(' ') [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `buffer.ends_with(' ')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#chars_last_cmp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should use the `ends_with` method [INFO] [stdout] --> src/tokenaize.rs:137:16 [INFO] [stdout] | [INFO] [stdout] 137 | || buffer.chars().last() == Some('\n') [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `buffer.ends_with('\n')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#chars_last_cmp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should use the `ends_with` method [INFO] [stdout] --> src/tokenaize.rs:138:16 [INFO] [stdout] | [INFO] [stdout] 138 | || buffer.chars().last() == Some(';') [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `buffer.ends_with(';')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#chars_last_cmp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should use the `ends_with` method [INFO] [stdout] --> src/tokenaize.rs:139:16 [INFO] [stdout] | [INFO] [stdout] 139 | || buffer.chars().last() == Some('{') [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `buffer.ends_with('{')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#chars_last_cmp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should use the `ends_with` method [INFO] [stdout] --> src/tokenaize.rs:140:16 [INFO] [stdout] | [INFO] [stdout] 140 | || buffer.chars().last() == Some('}') [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `buffer.ends_with('}')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#chars_last_cmp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/tokenaize.rs:148:13 [INFO] [stdout] | [INFO] [stdout] 148 | / match first_part { [INFO] [stdout] 149 | | Some(token) => tokens.push(token), [INFO] [stdout] 150 | | _ => (), [INFO] [stdout] 151 | | } [INFO] [stdout] | |_____________^ help: try: `if let Some(token) = first_part { tokens.push(token) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/tokenaize.rs:152:13 [INFO] [stdout] | [INFO] [stdout] 152 | / match last_char { [INFO] [stdout] 153 | | Some(token) => tokens.push(token), [INFO] [stdout] 154 | | _ => (), [INFO] [stdout] 155 | | } [INFO] [stdout] | |_____________^ help: try: `if let Some(token) = last_char { tokens.push(token) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for an equality check. Consider using `if` [INFO] [stdout] --> src/build_ast.rs:47:9 [INFO] [stdout] | [INFO] [stdout] 47 | / match token.token_type { [INFO] [stdout] 48 | | TokenType::If => statments.push(Statement { [INFO] [stdout] 49 | | tokens: None, [INFO] [stdout] 50 | | conditional: Some(make_conditional(tokens.clone(), index)), [INFO] [stdout] 51 | | }), [INFO] [stdout] 52 | | _ => (), [INFO] [stdout] 53 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 47 ~ if token.token_type == TokenType::If { statments.push(Statement { [INFO] [stdout] 48 + tokens: None, [INFO] [stdout] 49 + conditional: Some(make_conditional(tokens.clone(), index)), [INFO] [stdout] 50 + }) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/main.rs:40:16 [INFO] [stdout] | [INFO] [stdout] 40 | if !statement_asm_opt.is_none() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `statement_asm_opt.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `statement_asm_opt` after checking its variant with `is_none` [INFO] [stdout] --> src/main.rs:41:37 [INFO] [stdout] | [INFO] [stdout] 40 | if !statement_asm_opt.is_none() { [INFO] [stdout] | --------------------------- the check is happening here [INFO] [stdout] 41 | let statement_asm = statement_asm_opt.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/main.rs:68:33 [INFO] [stdout] | [INFO] [stdout] 68 | let mut file = File::create(&path)?; [INFO] [stdout] | ^^^^^ help: change this to: `path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/build_ast.rs:28:41 [INFO] [stdout] | [INFO] [stdout] 28 | fn make_conditional(tokens: Vec, mut index: usize) -> Conditional { [INFO] [stdout] | ----^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `index` [INFO] [stdout] --> src/build_ast.rs:28:41 [INFO] [stdout] | [INFO] [stdout] 28 | fn make_conditional(tokens: Vec, mut index: usize) -> Conditional { [INFO] [stdout] | ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_index` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `token_to_asm` is never used [INFO] [stdout] --> src/main.rs:21:4 [INFO] [stdout] | [INFO] [stdout] 21 | fn token_to_asm(tokens: Vec) -> String { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `write_file` is never used [INFO] [stdout] --> src/main.rs:61:4 [INFO] [stdout] | [INFO] [stdout] 61 | fn write_file(path: &str, asm: String) -> io::Result<()> { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `AsmWithPlacement` is never constructed [INFO] [stdout] --> src/asm_generation.rs:4:12 [INFO] [stdout] | [INFO] [stdout] 4 | pub struct AsmWithPlacement { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `AsmPlacement` is never used [INFO] [stdout] --> src/asm_generation.rs:9:10 [INFO] [stdout] | [INFO] [stdout] 9 | pub enum AsmPlacement { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `print_asm` is never used [INFO] [stdout] --> src/asm_generation.rs:15:4 [INFO] [stdout] | [INFO] [stdout] 15 | fn print_asm(statement: &Vec) -> AsmWithPlacement { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `return_asm` is never used [INFO] [stdout] --> src/asm_generation.rs:32:4 [INFO] [stdout] | [INFO] [stdout] 32 | fn return_asm(statement: &Vec) -> AsmWithPlacement { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `const_declaration` is never used [INFO] [stdout] --> src/asm_generation.rs:51:4 [INFO] [stdout] | [INFO] [stdout] 51 | fn const_declaration(statement: &Vec) -> AsmWithPlacement { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `let_declaration` is never used [INFO] [stdout] --> src/asm_generation.rs:70:4 [INFO] [stdout] | [INFO] [stdout] 70 | fn let_declaration(statement: &Vec) -> AsmWithPlacement { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `statement_to_asm` is never used [INFO] [stdout] --> src/asm_generation.rs:81:8 [INFO] [stdout] | [INFO] [stdout] 81 | pub fn statement_to_asm(statement: &Vec) -> Option { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `value` is never read [INFO] [stdout] --> src/tokenaize.rs:5:9 [INFO] [stdout] | [INFO] [stdout] 3 | pub struct Token { [INFO] [stdout] | ----- field in this struct [INFO] [stdout] 4 | pub token_type: TokenType, [INFO] [stdout] 5 | pub value: Option, [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Token` has derived impls for the traits `Debug` and `Clone`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Constant` is never constructed [INFO] [stdout] --> src/build_ast.rs:6:8 [INFO] [stdout] | [INFO] [stdout] 6 | struct Constant {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `tokens` and `conditional` are never read [INFO] [stdout] --> src/build_ast.rs:11:5 [INFO] [stdout] | [INFO] [stdout] 10 | struct Statement { [INFO] [stdout] | --------- fields in this struct [INFO] [stdout] 11 | tokens: Option>, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] 12 | conditional: Option, [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Statement` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `statments` is never read [INFO] [stdout] --> src/build_ast.rs:18:5 [INFO] [stdout] | [INFO] [stdout] 17 | pub struct Scope { [INFO] [stdout] | ----- field in this struct [INFO] [stdout] 18 | statments: Vec, [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Scope` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `condition` and `scope` are never read [INFO] [stdout] --> src/build_ast.rs:23:5 [INFO] [stdout] | [INFO] [stdout] 22 | pub struct Conditional { [INFO] [stdout] | ----------- fields in this struct [INFO] [stdout] 23 | condition: Vec, [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] 24 | scope: Scope, [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Conditional` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/asm_generation.rs:15:25 [INFO] [stdout] | [INFO] [stdout] 15 | fn print_asm(statement: &Vec) -> AsmWithPlacement { [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] 15 - fn print_asm(statement: &Vec) -> AsmWithPlacement { [INFO] [stdout] 15 + fn print_asm(statement: &[Token]) -> AsmWithPlacement { [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/asm_generation.rs:32:26 [INFO] [stdout] | [INFO] [stdout] 32 | fn return_asm(statement: &Vec) -> AsmWithPlacement { [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] 32 - fn return_asm(statement: &Vec) -> AsmWithPlacement { [INFO] [stdout] 32 + fn return_asm(statement: &[Token]) -> AsmWithPlacement { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/asm_generation.rs:39:82 [INFO] [stdout] | [INFO] [stdout] 39 | TokenType::Variable => format!(" movzx rdi, byte [{}]\n", string_value.to_string()), [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] = note: `#[warn(clippy::to_string_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/asm_generation.rs:51:33 [INFO] [stdout] | [INFO] [stdout] 51 | fn const_declaration(statement: &Vec) -> AsmWithPlacement { [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] 51 - fn const_declaration(statement: &Vec) -> AsmWithPlacement { [INFO] [stdout] 51 + fn const_declaration(statement: &[Token]) -> AsmWithPlacement { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/tokenaize.rs:72:8 [INFO] [stdout] | [INFO] [stdout] 72 | if !special.is_none() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `special.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/tokenaize.rs:94:8 [INFO] [stdout] | [INFO] [stdout] 94 | if !first_char.is_none() && first_char == Some('"') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `first_char.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/tokenaize.rs:95:12 [INFO] [stdout] | [INFO] [stdout] 95 | if !last_char.is_none() && last_char == Some('"') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try: `last_char.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/tokenaize.rs:78:5 [INFO] [stdout] | [INFO] [stdout] 78 | / match is_numeric { [INFO] [stdout] 79 | | Ok(_) => { [INFO] [stdout] 80 | | return Some(Token { [INFO] [stdout] 81 | | token_type: TokenType::Number, [INFO] [stdout] ... | [INFO] [stdout] 85 | | _ => (), [INFO] [stdout] 86 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 78 ~ if let Ok(_) = is_numeric { [INFO] [stdout] 79 + return Some(Token { [INFO] [stdout] 80 + token_type: TokenType::Number, [INFO] [stdout] 81 + value: Some(buffer.to_string()), [INFO] [stdout] 82 + }) [INFO] [stdout] 83 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/tokenaize.rs:89:22 [INFO] [stdout] | [INFO] [stdout] 89 | let first_char = buffer.chars().nth(0); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `buffer.chars().next()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] = note: `#[warn(clippy::iter_nth_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/tokenaize.rs:94:5 [INFO] [stdout] | [INFO] [stdout] 94 | / if !first_char.is_none() && first_char == Some('"') { [INFO] [stdout] 95 | | if !last_char.is_none() && last_char == Some('"') { [INFO] [stdout] 96 | | return Some(Token { [INFO] [stdout] 97 | | token_type: TokenType::String, [INFO] [stdout] ... | [INFO] [stdout] 101 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 94 ~ if !first_char.is_none() && first_char == Some('"') [INFO] [stdout] 95 ~ && !last_char.is_none() && last_char == Some('"') { [INFO] [stdout] 96 | return Some(Token { [INFO] [stdout] ... [INFO] [stdout] 99 | }); [INFO] [stdout] 100 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should use the `ends_with` method [INFO] [stdout] --> src/tokenaize.rs:130:33 [INFO] [stdout] | [INFO] [stdout] 130 | if buffer.len() == 1 && buffer.chars().last() == Some('"') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `buffer.ends_with('"')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#chars_last_cmp [INFO] [stdout] = note: `#[warn(clippy::chars_last_cmp)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should use the `ends_with` method [INFO] [stdout] --> src/tokenaize.rs:132:29 [INFO] [stdout] | [INFO] [stdout] 132 | } else if in_lit && buffer.chars().last() == Some('"') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `buffer.ends_with('"')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#chars_last_cmp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should use the `ends_with` method [INFO] [stdout] --> src/tokenaize.rs:136:13 [INFO] [stdout] | [INFO] [stdout] 136 | if (buffer.chars().last() == Some(' ') [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `buffer.ends_with(' ')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#chars_last_cmp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should use the `ends_with` method [INFO] [stdout] --> src/tokenaize.rs:137:16 [INFO] [stdout] | [INFO] [stdout] 137 | || buffer.chars().last() == Some('\n') [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `buffer.ends_with('\n')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#chars_last_cmp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should use the `ends_with` method [INFO] [stdout] --> src/tokenaize.rs:138:16 [INFO] [stdout] | [INFO] [stdout] 138 | || buffer.chars().last() == Some(';') [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `buffer.ends_with(';')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#chars_last_cmp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should use the `ends_with` method [INFO] [stdout] --> src/tokenaize.rs:139:16 [INFO] [stdout] | [INFO] [stdout] 139 | || buffer.chars().last() == Some('{') [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `buffer.ends_with('{')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#chars_last_cmp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should use the `ends_with` method [INFO] [stdout] --> src/tokenaize.rs:140:16 [INFO] [stdout] | [INFO] [stdout] 140 | || buffer.chars().last() == Some('}') [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `buffer.ends_with('}')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#chars_last_cmp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/tokenaize.rs:148:13 [INFO] [stdout] | [INFO] [stdout] 148 | / match first_part { [INFO] [stdout] 149 | | Some(token) => tokens.push(token), [INFO] [stdout] 150 | | _ => (), [INFO] [stdout] 151 | | } [INFO] [stdout] | |_____________^ help: try: `if let Some(token) = first_part { tokens.push(token) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/tokenaize.rs:152:13 [INFO] [stdout] | [INFO] [stdout] 152 | / match last_char { [INFO] [stdout] 153 | | Some(token) => tokens.push(token), [INFO] [stdout] 154 | | _ => (), [INFO] [stdout] 155 | | } [INFO] [stdout] | |_____________^ help: try: `if let Some(token) = last_char { tokens.push(token) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for an equality check. Consider using `if` [INFO] [stdout] --> src/build_ast.rs:47:9 [INFO] [stdout] | [INFO] [stdout] 47 | / match token.token_type { [INFO] [stdout] 48 | | TokenType::If => statments.push(Statement { [INFO] [stdout] 49 | | tokens: None, [INFO] [stdout] 50 | | conditional: Some(make_conditional(tokens.clone(), index)), [INFO] [stdout] 51 | | }), [INFO] [stdout] 52 | | _ => (), [INFO] [stdout] 53 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 47 ~ if token.token_type == TokenType::If { statments.push(Statement { [INFO] [stdout] 48 + tokens: None, [INFO] [stdout] 49 + conditional: Some(make_conditional(tokens.clone(), index)), [INFO] [stdout] 50 + }) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/main.rs:40:16 [INFO] [stdout] | [INFO] [stdout] 40 | if !statement_asm_opt.is_none() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `statement_asm_opt.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `statement_asm_opt` after checking its variant with `is_none` [INFO] [stdout] --> src/main.rs:41:37 [INFO] [stdout] | [INFO] [stdout] 40 | if !statement_asm_opt.is_none() { [INFO] [stdout] | --------------------------- the check is happening here [INFO] [stdout] 41 | let statement_asm = statement_asm_opt.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/main.rs:68:33 [INFO] [stdout] | [INFO] [stdout] 68 | let mut file = File::create(&path)?; [INFO] [stdout] | ^^^^^ help: change this to: `path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.17s [INFO] running `Command { std: "docker" "inspect" "10579d2bf65ad92bf1d66be2af12c715481b94827b373685465255e955935cf8", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "10579d2bf65ad92bf1d66be2af12c715481b94827b373685465255e955935cf8", kill_on_drop: false }` [INFO] [stdout] 10579d2bf65ad92bf1d66be2af12c715481b94827b373685465255e955935cf8