[INFO] cloning repository https://github.com/garebareDA/koto [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/garebareDA/koto" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FgarebareDA%2Fkoto", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FgarebareDA%2Fkoto'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 649771e21fbdd7c0c9a6f60a937235d899c452b2 [INFO] linting garebareDA/koto against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FgarebareDA%2Fkoto" "/workspace/builds/worker-6-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-6-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/garebareDA/koto [INFO] finished tweaking git repo https://github.com/garebareDA/koto [INFO] tweaked toml for git repo https://github.com/garebareDA/koto written to /workspace/builds/worker-6-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/garebareDA/koto 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/garebareDA/koto 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] Downloading crates ... [INFO] [stderr] Downloaded memchr v2.3.0 [INFO] [stderr] Downloaded aho-corasick v0.7.8 [INFO] [stderr] Downloaded regex-syntax v0.6.14 [INFO] [stderr] Downloaded regex v1.3.4 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] ed765f2748f841bf3ee12242b443d594032c532bc3e896e9b055899bc435769e [INFO] running `Command { std: "docker" "start" "-a" "ed765f2748f841bf3ee12242b443d594032c532bc3e896e9b055899bc435769e", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "ed765f2748f841bf3ee12242b443d594032c532bc3e896e9b055899bc435769e", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "ed765f2748f841bf3ee12242b443d594032c532bc3e896e9b055899bc435769e", kill_on_drop: false }` [INFO] [stdout] ed765f2748f841bf3ee12242b443d594032c532bc3e896e9b055899bc435769e [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "clippy" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 740e28409e5db65cd296eff7ca885c9304c062a40820e04fed8dbb94e52b1219 [INFO] running `Command { std: "docker" "start" "-a" "740e28409e5db65cd296eff7ca885c9304c062a40820e04fed8dbb94e52b1219", kill_on_drop: false }` [INFO] [stderr] Compiling memchr v2.3.0 [INFO] [stderr] Checking regex-syntax v0.6.14 [INFO] [stderr] Checking aho-corasick v0.7.8 [INFO] [stderr] Checking regex v1.3.4 [INFO] [stderr] Checking koto v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/lexer/lexers.rs:15:13 [INFO] [stdout] | [INFO] [stdout] 15 | string: string, [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace it with: `string` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/lexer/token.rs:53:13 [INFO] [stdout] | [INFO] [stdout] 53 | token:token, [INFO] [stdout] | ^^^^^^^^^^^ help: replace it with: `token` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/ast/asts.rs:55:13 [INFO] [stdout] | [INFO] [stdout] 55 | boolean:boolean, [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace it with: `boolean` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/ast/asts.rs:70:13 [INFO] [stdout] | [INFO] [stdout] 70 | val:val, [INFO] [stdout] | ^^^^^^^ help: replace it with: `val` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/ast/asts.rs:215:13 [INFO] [stdout] | [INFO] [stdout] 215 | judge: judge, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `judge` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/ast/asts.rs:262:13 [INFO] [stdout] | [INFO] [stdout] 262 | comma: comma [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `comma` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/ast/asts.rs:275:13 [INFO] [stdout] | [INFO] [stdout] 275 | parent: parent [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace it with: `parent` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/ast/asts.rs:288:13 [INFO] [stdout] | [INFO] [stdout] 288 | square:square [INFO] [stdout] | ^^^^^^^^^^^^^ help: replace it with: `square` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/ast/asts.rs:301:13 [INFO] [stdout] | [INFO] [stdout] 301 | scope:scope [INFO] [stdout] | ^^^^^^^^^^^ help: replace it with: `scope` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/ast/parsing.rs:12:19 [INFO] [stdout] | [INFO] [stdout] 12 | Parsing { tokens: tokens } [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace it with: `tokens` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/interpreter/arithmetic.rs:11:22 [INFO] [stdout] | [INFO] [stdout] 11 | Arithmetic { bin: bin } [INFO] [stdout] | ^^^^^^^^ help: replace it with: `bin` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/interpreter/fors.rs:17:13 [INFO] [stdout] | [INFO] [stdout] 17 | ast_for: ast_for, [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace it with: `ast_for` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/interpreter/fors.rs:18:13 [INFO] [stdout] | [INFO] [stdout] 18 | ast: ast, [INFO] [stdout] | ^^^^^^^^ help: replace it with: `ast` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/compiler/to_c.rs:26:7 [INFO] [stdout] | [INFO] [stdout] 26 | file: file, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `file` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/compiler/to_c.rs:28:7 [INFO] [stdout] | [INFO] [stdout] 28 | function: function, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace it with: `function` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/lexer/lexers.rs:15:13 [INFO] [stdout] | [INFO] [stdout] 15 | string: string, [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace it with: `string` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/lexer/token.rs:53:13 [INFO] [stdout] | [INFO] [stdout] 53 | token:token, [INFO] [stdout] | ^^^^^^^^^^^ help: replace it with: `token` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/ast/asts.rs:55:13 [INFO] [stdout] | [INFO] [stdout] 55 | boolean:boolean, [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace it with: `boolean` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/ast/asts.rs:70:13 [INFO] [stdout] | [INFO] [stdout] 70 | val:val, [INFO] [stdout] | ^^^^^^^ help: replace it with: `val` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/ast/asts.rs:215:13 [INFO] [stdout] | [INFO] [stdout] 215 | judge: judge, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `judge` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/ast/asts.rs:262:13 [INFO] [stdout] | [INFO] [stdout] 262 | comma: comma [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `comma` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/ast/asts.rs:275:13 [INFO] [stdout] | [INFO] [stdout] 275 | parent: parent [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace it with: `parent` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/ast/asts.rs:288:13 [INFO] [stdout] | [INFO] [stdout] 288 | square:square [INFO] [stdout] | ^^^^^^^^^^^^^ help: replace it with: `square` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/ast/asts.rs:301:13 [INFO] [stdout] | [INFO] [stdout] 301 | scope:scope [INFO] [stdout] | ^^^^^^^^^^^ help: replace it with: `scope` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/ast/parsing.rs:12:19 [INFO] [stdout] | [INFO] [stdout] 12 | Parsing { tokens: tokens } [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace it with: `tokens` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/interpreter/arithmetic.rs:11:22 [INFO] [stdout] | [INFO] [stdout] 11 | Arithmetic { bin: bin } [INFO] [stdout] | ^^^^^^^^ help: replace it with: `bin` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/interpreter/fors.rs:17:13 [INFO] [stdout] | [INFO] [stdout] 17 | ast_for: ast_for, [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace it with: `ast_for` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/interpreter/fors.rs:18:13 [INFO] [stdout] | [INFO] [stdout] 18 | ast: ast, [INFO] [stdout] | ^^^^^^^^ help: replace it with: `ast` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/compiler/to_c.rs:26:7 [INFO] [stdout] | [INFO] [stdout] 26 | file: file, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `file` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/compiler/to_c.rs:28:7 [INFO] [stdout] | [INFO] [stdout] 28 | function: function, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace it with: `function` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unreachable pattern [INFO] [stdout] --> src/compiler/function.rs:398:15 [INFO] [stdout] | [INFO] [stdout] 396 | _param_types => {} [INFO] [stdout] | ------------ matches any value [INFO] [stdout] 397 | [INFO] [stdout] 398 | _ => { [INFO] [stdout] | ^ no value can reach this [INFO] [stdout] | [INFO] [stdout] note: there is a binding of the same name; if you meant to pattern match against the value of that binding, that is a feature of constants that is not available for `let` bindings [INFO] [stdout] --> src/compiler/function.rs:391:11 [INFO] [stdout] | [INFO] [stdout] 391 | let _param_types = &type_array[i]; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] = note: `#[warn(unreachable_patterns)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `types` is never read [INFO] [stdout] --> src/compiler/function.rs:452:49 [INFO] [stdout] | [INFO] [stdout] 452 | let mut types:Option = None; [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] = note: `#[warn(unused_assignments)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `funs` [INFO] [stdout] --> src/compiler/arithmetic.rs:78:29 [INFO] [stdout] | [INFO] [stdout] 78 | asts::Types::Function(funs) => { [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_funs` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/lexer/lexers.rs:34:9 [INFO] [stdout] | [INFO] [stdout] 34 | return tokens; [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] 34 - return tokens; [INFO] [stdout] 34 + tokens [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/lexer/lexers.rs:28:55 [INFO] [stdout] | [INFO] [stdout] 28 | let (result, continue_index) = Lexer::get(&content, self.index); [INFO] [stdout] | ^^^^^^^^ help: change this to: `content` [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: unneeded `return` statement [INFO] [stdout] --> src/lexer/lexers.rs:184:9 [INFO] [stdout] | [INFO] [stdout] 184 | return (token_value, index + 1); [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] 184 - return (token_value, index + 1); [INFO] [stdout] 184 + (token_value, index + 1) [INFO] [stdout] | [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/lexer/lexers.rs:52:9 [INFO] [stdout] | [INFO] [stdout] 52 | / match reg.captures(&last_str) { [INFO] [stdout] 53 | | Some(_) => { [INFO] [stdout] 54 | | loop { [INFO] [stdout] 55 | | let text = &content.chars().nth(index).expect("Failed").to_string(); [INFO] [stdout] ... | [INFO] [stdout] 115 | | None => {} [INFO] [stdout] 116 | | }; [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] 52 ~ if let Some(_) = reg.captures(&last_str) { [INFO] [stdout] 53 + loop { [INFO] [stdout] 54 + let text = &content.chars().nth(index).expect("Failed").to_string(); [INFO] [stdout] 55 + let reg = Regex::new(r"(\d|[a-zA-Z])+").expect("Failed"); [INFO] [stdout] 56 + let res = match reg.captures(text) { [INFO] [stdout] 57 + Some(_) => true, [INFO] [stdout] 58 + None => false, [INFO] [stdout] 59 + }; [INFO] [stdout] 60 + if !res { [INFO] [stdout] 61 + break; [INFO] [stdout] 62 + } [INFO] [stdout] 63 + identifier_str += text; [INFO] [stdout] 64 + index += 1; [INFO] [stdout] 65 + } [INFO] [stdout] 66 + if identifier_str == "print" { [INFO] [stdout] 67 + let token_value = token::TokenValue::new(TOKEN._print, &identifier_str); [INFO] [stdout] 68 + return (token_value, index); [INFO] [stdout] 69 + } [INFO] [stdout] 70 + if identifier_str == "fn" { [INFO] [stdout] 71 + let token_value = token::TokenValue::new(TOKEN._fun, &identifier_str); [INFO] [stdout] 72 + return (token_value, index); [INFO] [stdout] 73 + } [INFO] [stdout] 74 + if identifier_str == "if" { [INFO] [stdout] 75 + let token_value = token::TokenValue::new(TOKEN._if, &identifier_str); [INFO] [stdout] 76 + return (token_value, index); [INFO] [stdout] 77 + } [INFO] [stdout] 78 + if identifier_str == "else" { [INFO] [stdout] 79 + let token_value = token::TokenValue::new(TOKEN._else, &identifier_str); [INFO] [stdout] 80 + return (token_value, index); [INFO] [stdout] 81 + } [INFO] [stdout] 82 + if identifier_str == "for" { [INFO] [stdout] 83 + let token_value = token::TokenValue::new(TOKEN._for, &identifier_str); [INFO] [stdout] 84 + return (token_value, index); [INFO] [stdout] 85 + } [INFO] [stdout] 86 + if identifier_str == "let" { [INFO] [stdout] 87 + let token_value = token::TokenValue::new(TOKEN._let, &identifier_str); [INFO] [stdout] 88 + return (token_value, index); [INFO] [stdout] 89 + } [INFO] [stdout] 90 + if identifier_str == "true" || identifier_str == "false" { [INFO] [stdout] 91 + let token_value = token::TokenValue::new(TOKEN._bool, &identifier_str); [INFO] [stdout] 92 + return (token_value, index); [INFO] [stdout] 93 + } [INFO] [stdout] 94 + if identifier_str == "return" { [INFO] [stdout] 95 + let token_value = token::TokenValue::new(TOKEN._return, &identifier_str); [INFO] [stdout] 96 + return (token_value, index); [INFO] [stdout] 97 + } [INFO] [stdout] 98 + if identifier_str == "vec" { [INFO] [stdout] 99 + let token_value = token::TokenValue::new(TOKEN._vec, &identifier_str); [INFO] [stdout] 100 + return (token_value, index); [INFO] [stdout] 101 + } [INFO] [stdout] 102 + if identifier_str == "import"{ [INFO] [stdout] 103 + let token_value = token::TokenValue::new(TOKEN._import, &identifier_str); [INFO] [stdout] 104 + return (token_value, index); [INFO] [stdout] 105 + } [INFO] [stdout] 106 + if identifier_str == "const" { [INFO] [stdout] 107 + let token_value = token::TokenValue::new(TOKEN._const, &identifier_str); [INFO] [stdout] 108 + return (token_value, index); [INFO] [stdout] 109 + } [INFO] [stdout] 110 + [INFO] [stdout] 111 + let token_value = token::TokenValue::new(TOKEN._identifier, &identifier_str); [INFO] [stdout] 112 + return (token_value, index); [INFO] [stdout] 113 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/lexer/lexers.rs:56:31 [INFO] [stdout] | [INFO] [stdout] 56 | let reg = Regex::new(r"(\d|[a-zA-Z])+").expect("Failed"); [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/lexer/lexers.rs:54:17 [INFO] [stdout] | [INFO] [stdout] 54 | loop { [INFO] [stdout] | ^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] = note: `#[warn(clippy::regex_creation_in_loops)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/lexer/lexers.rs:57:31 [INFO] [stdout] | [INFO] [stdout] 57 | let res = match reg.captures(text) { [INFO] [stdout] | _______________________________^ [INFO] [stdout] 58 | | Some(_) => true, [INFO] [stdout] 59 | | None => false, [INFO] [stdout] 60 | | }; [INFO] [stdout] | |_____________________^ help: try: `reg.captures(text).is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [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/lexer/lexers.rs:119:9 [INFO] [stdout] | [INFO] [stdout] 119 | / match reg.captures(&last_str) { [INFO] [stdout] 120 | | Some(_) => { [INFO] [stdout] 121 | | identifier_str = String::new(); [INFO] [stdout] 122 | | loop { [INFO] [stdout] ... | [INFO] [stdout] 135 | | None => {} [INFO] [stdout] 136 | | }; [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] 119 ~ if let Some(_) = reg.captures(&last_str) { [INFO] [stdout] 120 + identifier_str = String::new(); [INFO] [stdout] 121 + loop { [INFO] [stdout] 122 + index += 1; [INFO] [stdout] 123 + let text = &content.chars().nth(index).expect("Failed").to_string(); [INFO] [stdout] 124 + if text != "\"" { [INFO] [stdout] 125 + identifier_str += &text; [INFO] [stdout] 126 + } [INFO] [stdout] 127 + if text == "\"" { [INFO] [stdout] 128 + break; [INFO] [stdout] 129 + }; [INFO] [stdout] 130 + } [INFO] [stdout] 131 + let token_value = token::TokenValue::new(TOKEN._string, &identifier_str); [INFO] [stdout] 132 + return (token_value, index + 1); [INFO] [stdout] 133 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/lexer/lexers.rs:126:43 [INFO] [stdout] | [INFO] [stdout] 126 | identifier_str += &text; [INFO] [stdout] | ^^^^^ help: change this to: `text` [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 seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/lexer/lexers.rs:139:9 [INFO] [stdout] | [INFO] [stdout] 139 | / match reg.captures(&last_str) { [INFO] [stdout] 140 | | Some(_) => { [INFO] [stdout] 141 | | loop { [INFO] [stdout] 142 | | let text = &content.chars().nth(index).expect("Failed").to_string(); [INFO] [stdout] ... | [INFO] [stdout] 157 | | None => {} [INFO] [stdout] 158 | | }; [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] 139 ~ if let Some(_) = reg.captures(&last_str) { [INFO] [stdout] 140 + loop { [INFO] [stdout] 141 + let text = &content.chars().nth(index).expect("Failed").to_string(); [INFO] [stdout] 142 + let reg = Regex::new(r"[0-9.]+").expect("Faild"); [INFO] [stdout] 143 + let res = match reg.captures(text) { [INFO] [stdout] 144 + Some(_) => true, [INFO] [stdout] 145 + None => false, [INFO] [stdout] 146 + }; [INFO] [stdout] 147 + if !res { [INFO] [stdout] 148 + break; [INFO] [stdout] 149 + } [INFO] [stdout] 150 + identifier_str += text; [INFO] [stdout] 151 + index += 1; [INFO] [stdout] 152 + } [INFO] [stdout] 153 + let token_value = token::TokenValue::new(TOKEN._number, &identifier_str); [INFO] [stdout] 154 + return (token_value, index); [INFO] [stdout] 155 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/lexer/lexers.rs:143:31 [INFO] [stdout] | [INFO] [stdout] 143 | let reg = Regex::new(r"[0-9.]+").expect("Faild"); [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/lexer/lexers.rs:141:17 [INFO] [stdout] | [INFO] [stdout] 141 | loop { [INFO] [stdout] | ^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/lexer/lexers.rs:144:31 [INFO] [stdout] | [INFO] [stdout] 144 | let res = match reg.captures(text) { [INFO] [stdout] | _______________________________^ [INFO] [stdout] 145 | | Some(_) => true, [INFO] [stdout] 146 | | None => false, [INFO] [stdout] 147 | | }; [INFO] [stdout] | |_____________________^ help: try: `reg.captures(text).is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [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/lexer/lexers.rs:161:9 [INFO] [stdout] | [INFO] [stdout] 161 | / match reg.captures(&last_str) { [INFO] [stdout] 162 | | Some(_) => { [INFO] [stdout] 163 | | loop { [INFO] [stdout] 164 | | let text = &content.chars().nth(index).expect("Failed").to_string(); [INFO] [stdout] ... | [INFO] [stdout] 174 | | None => {} [INFO] [stdout] 175 | | } [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] 161 ~ if let Some(_) = reg.captures(&last_str) { [INFO] [stdout] 162 + loop { [INFO] [stdout] 163 + let text = &content.chars().nth(index).expect("Failed").to_string(); [INFO] [stdout] 164 + if text == "\n" { [INFO] [stdout] 165 + break; [INFO] [stdout] 166 + } [INFO] [stdout] 167 + identifier_str += text; [INFO] [stdout] 168 + index += 1; [INFO] [stdout] 169 + } [INFO] [stdout] 170 + let token_value = token::TokenValue::new(TOKEN._comment, &identifier_str); [INFO] [stdout] 171 + return (token_value, index); [INFO] [stdout] 172 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Token` [INFO] [stdout] --> src/lexer/token.rs:21:5 [INFO] [stdout] | [INFO] [stdout] 21 | / pub const fn new() -> Token { [INFO] [stdout] 22 | | Token { [INFO] [stdout] 23 | | _if: -1, [INFO] [stdout] 24 | | _then: -2, [INFO] [stdout] ... | [INFO] [stdout] 40 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 20 + impl Default for Token { [INFO] [stdout] 21 + fn default() -> Self { [INFO] [stdout] 22 + Self::new() [INFO] [stdout] 23 + } [INFO] [stdout] 24 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `ExprAST` [INFO] [stdout] --> src/ast/asts.rs:41:5 [INFO] [stdout] | [INFO] [stdout] 41 | / pub fn new() -> ExprAST { [INFO] [stdout] 42 | | ExprAST { node: Vec::new() } [INFO] [stdout] 43 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 40 + impl Default for ExprAST { [INFO] [stdout] 41 + fn default() -> Self { [INFO] [stdout] 42 + Self::new() [INFO] [stdout] 43 + } [INFO] [stdout] 44 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `VectorAST` [INFO] [stdout] --> src/ast/asts.rs:199:5 [INFO] [stdout] | [INFO] [stdout] 199 | / pub fn new() -> VectorAST { [INFO] [stdout] 200 | | VectorAST{ [INFO] [stdout] 201 | | node: Vec::new(), [INFO] [stdout] 202 | | } [INFO] [stdout] 203 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 198 + impl Default for VectorAST { [INFO] [stdout] 199 + fn default() -> Self { [INFO] [stdout] 200 + Self::new() [INFO] [stdout] 201 + } [INFO] [stdout] 202 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calls to `push` immediately after creation [INFO] [stdout] --> src/ast/asts.rs:229:9 [INFO] [stdout] | [INFO] [stdout] 229 | / let mut for_types = Vec::new(); [INFO] [stdout] 230 | | for_types.push(init); [INFO] [stdout] 231 | | for_types.push(cond); [INFO] [stdout] 232 | | for_types.push(inc); [INFO] [stdout] | |____________________________^ help: consider using the `vec![]` macro: `let for_types = vec![..];` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push [INFO] [stdout] = note: `#[warn(clippy::vec_init_then_push)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `RetrunAST` [INFO] [stdout] --> src/ast/asts.rs:247:5 [INFO] [stdout] | [INFO] [stdout] 247 | / pub fn new() -> RetrunAST { [INFO] [stdout] 248 | | RetrunAST{ [INFO] [stdout] 249 | | node:Vec::new(), [INFO] [stdout] 250 | | } [INFO] [stdout] 251 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 246 + impl Default for RetrunAST { [INFO] [stdout] 247 + fn default() -> Self { [INFO] [stdout] 248 + Self::new() [INFO] [stdout] 249 + } [INFO] [stdout] 250 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `ImportAST` [INFO] [stdout] --> src/ast/asts.rs:312:5 [INFO] [stdout] | [INFO] [stdout] 312 | / pub fn new() -> ImportAST { [INFO] [stdout] 313 | | ImportAST{ [INFO] [stdout] 314 | | path:Vec::new(), [INFO] [stdout] 315 | | } [INFO] [stdout] 316 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 311 + impl Default for ImportAST { [INFO] [stdout] 312 + fn default() -> Self { [INFO] [stdout] 313 + Self::new() [INFO] [stdout] 314 + } [INFO] [stdout] 315 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `EndAST` [INFO] [stdout] --> src/ast/asts.rs:325:5 [INFO] [stdout] | [INFO] [stdout] 325 | / pub fn new() -> Self { [INFO] [stdout] 326 | | EndAST { [INFO] [stdout] 327 | | end: "end".to_string(), [INFO] [stdout] 328 | | } [INFO] [stdout] 329 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 324 + impl Default for EndAST { [INFO] [stdout] 325 + fn default() -> Self { [INFO] [stdout] 326 + Self::new() [INFO] [stdout] 327 + } [INFO] [stdout] 328 + } [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/ast/parsing.rs:10:24 [INFO] [stdout] | [INFO] [stdout] 10 | pub fn new(tokens: &Vec) -> Parsing { [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] 10 ~ pub fn new(tokens: &[token::TokenValue]) -> Parsing { [INFO] [stdout] 11 ~ let tokens = tokens.to_owned(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ast/parsing.rs:19:9 [INFO] [stdout] | [INFO] [stdout] 19 | return root; [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] 19 - return root; [INFO] [stdout] 19 + root [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/ast/parsing.rs:81:16 [INFO] [stdout] | [INFO] [stdout] 81 | if self.tokens[2].token == 43 && is_token || self.tokens[2].token == 45 && is_token { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 81 - if self.tokens[2].token == 43 && is_token || self.tokens[2].token == 45 && is_token { [INFO] [stdout] 81 + if !(!is_token || self.tokens[2].token != 43 && self.tokens[2].token != 45) { [INFO] [stdout] | [INFO] [stdout] 81 - if self.tokens[2].token == 43 && is_token || self.tokens[2].token == 45 && is_token { [INFO] [stdout] 81 + if (self.tokens[2].token == 45 || self.tokens[2].token == 43) && is_token { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ast/parsing.rs:235:9 [INFO] [stdout] | [INFO] [stdout] 235 | return variable; [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] 235 - return variable; [INFO] [stdout] 235 + variable [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unreachable pattern [INFO] [stdout] --> src/compiler/function.rs:398:15 [INFO] [stdout] | [INFO] [stdout] 396 | _param_types => {} [INFO] [stdout] | ------------ matches any value [INFO] [stdout] 397 | [INFO] [stdout] 398 | _ => { [INFO] [stdout] | ^ no value can reach this [INFO] [stdout] | [INFO] [stdout] note: there is a binding of the same name; if you meant to pattern match against the value of that binding, that is a feature of constants that is not available for `let` bindings [INFO] [stdout] --> src/compiler/function.rs:391:11 [INFO] [stdout] | [INFO] [stdout] 391 | let _param_types = &type_array[i]; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] = note: `#[warn(unreachable_patterns)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calls to `push` immediately after creation [INFO] [stdout] --> src/ast/parsing.rs:35:13 [INFO] [stdout] | [INFO] [stdout] 35 | / let mut result_vec: Vec = Vec::new(); [INFO] [stdout] 36 | | result_vec.push(result); [INFO] [stdout] | |____________________________________^ help: consider using the `vec![]` macro: `let result_vec: Vec = vec![..];` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `types` is never read [INFO] [stdout] --> src/compiler/function.rs:452:49 [INFO] [stdout] | [INFO] [stdout] 452 | let mut types:Option = None; [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] = note: `#[warn(unused_assignments)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ast/parsing.rs:253:9 [INFO] [stdout] | [INFO] [stdout] 253 | return vec_node; [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] 253 - return vec_node; [INFO] [stdout] 253 + vec_node [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ast/parsing.rs:443:17 [INFO] [stdout] | [INFO] [stdout] 443 | return ast_binary; [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 - return ast_binary; [INFO] [stdout] 443 + ast_binary [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ast/parsing.rs:445:18 [INFO] [stdout] | [INFO] [stdout] 445 | _ => return asts::Types::Error(asts::ErrorAST::new("Binary parsing 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] 445 - _ => return asts::Types::Error(asts::ErrorAST::new("Binary parsing error")), [INFO] [stdout] 445 + _ => asts::Types::Error(asts::ErrorAST::new("Binary parsing error")), [INFO] [stdout] | [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/ast/parsing.rs:277:21 [INFO] [stdout] | [INFO] [stdout] 277 | / match var.index { [INFO] [stdout] 278 | | Some(_) => { [INFO] [stdout] 279 | | loop { [INFO] [stdout] 280 | | self.tokens.remove(0); [INFO] [stdout] ... | [INFO] [stdout] 288 | | None => {} [INFO] [stdout] 289 | | } [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] 277 ~ if let Some(_) = var.index { [INFO] [stdout] 278 + loop { [INFO] [stdout] 279 + self.tokens.remove(0); [INFO] [stdout] 280 + if self.tokens[0].token == 93 { [INFO] [stdout] 281 + break; [INFO] [stdout] 282 + } [INFO] [stdout] 283 + } [INFO] [stdout] 284 + number_vector.push(asts::Types::Variable(var.clone())); [INFO] [stdout] 285 + continue; [INFO] [stdout] 286 + } [INFO] [stdout] | [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/ast/parsing.rs:356:13 [INFO] [stdout] | [INFO] [stdout] 356 | / match binary { [INFO] [stdout] 357 | | asts::Types::Binary(mut bin) => { [INFO] [stdout] 358 | | bin.node.push(number); [INFO] [stdout] 359 | | bin.node.push(binary_sccond); [INFO] [stdout] ... | [INFO] [stdout] 362 | | _ => {} [INFO] [stdout] 363 | | } [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] 356 ~ if let asts::Types::Binary(mut bin) = binary { [INFO] [stdout] 357 + bin.node.push(number); [INFO] [stdout] 358 + bin.node.push(binary_sccond); [INFO] [stdout] 359 + return asts::Types::Binary(bin); [INFO] [stdout] 360 + } [INFO] [stdout] | [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/ast/parsing.rs:400:65 [INFO] [stdout] | [INFO] [stdout] 400 | ... asts::Types::Binary(mut bin) => match bin.node[0].clone() { [INFO] [stdout] | _______________________________________________________^ [INFO] [stdout] 401 | | ... asts::Types::Call(mut call) => { [INFO] [stdout] 402 | | ... call.node.push(ast_temp.clone()); [INFO] [stdout] 403 | | ... let call = asts::Types::Call(call); [INFO] [stdout] ... | [INFO] [stdout] 411 | | ... _ => {} [INFO] [stdout] 412 | | ... }, [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] 400 ~ asts::Types::Binary(mut bin) => if let asts::Types::Call(mut call) = bin.node[0].clone() { [INFO] [stdout] 401 + call.node.push(ast_temp.clone()); [INFO] [stdout] 402 + let call = asts::Types::Call(call); [INFO] [stdout] 403 + bin.node.clear(); [INFO] [stdout] 404 + bin.node.push(call); [INFO] [stdout] 405 + let bins = asts::Types::Binary(bin); [INFO] [stdout] 406 + vars.node.clear(); [INFO] [stdout] 407 + vars.node.push(bins); [INFO] [stdout] 408 + number = asts::Types::Variable(vars); [INFO] [stdout] 409 ~ }, [INFO] [stdout] | [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/ast/parsing.rs:428:13 [INFO] [stdout] | [INFO] [stdout] 428 | / match binary { [INFO] [stdout] 429 | | asts::Types::Binary(mut binary) => { [INFO] [stdout] 430 | | binary.node.push(number.clone()); [INFO] [stdout] 431 | | ast_temp = asts::Types::Binary(binary); [INFO] [stdout] 432 | | } [INFO] [stdout] 433 | | _ => {} [INFO] [stdout] 434 | | } [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] 428 ~ if let asts::Types::Binary(mut binary) = binary { [INFO] [stdout] 429 + binary.node.push(number.clone()); [INFO] [stdout] 430 + ast_temp = asts::Types::Binary(binary); [INFO] [stdout] 431 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ast/parsing.rs:461:9 [INFO] [stdout] | [INFO] [stdout] 461 | return result; [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] 461 - return result; [INFO] [stdout] 461 + result [INFO] [stdout] | [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/ast/parsing.rs:455:9 [INFO] [stdout] | [INFO] [stdout] 455 | / match result { [INFO] [stdout] 456 | | asts::Types::Number(_) => { [INFO] [stdout] 457 | | result = self.calculation(); [INFO] [stdout] ... | [INFO] [stdout] 460 | | } [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] 455 ~ if let asts::Types::Number(_) = result { [INFO] [stdout] 456 + result = self.calculation(); [INFO] [stdout] 457 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ast/parsing.rs:476:17 [INFO] [stdout] | [INFO] [stdout] 476 | return asts::Types::Binary(bin); [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] 476 - return asts::Types::Binary(bin); [INFO] [stdout] 476 + asts::Types::Binary(bin) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ast/parsing.rs:480:17 [INFO] [stdout] | [INFO] [stdout] 480 | return asts::Types::Error(asts::ErrorAST::new("Reassignment operater 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] 480 - return asts::Types::Error(asts::ErrorAST::new("Reassignment operater error")); [INFO] [stdout] 480 + asts::Types::Error(asts::ErrorAST::new("Reassignment operater error")) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `funs` [INFO] [stdout] --> src/compiler/arithmetic.rs:78:29 [INFO] [stdout] | [INFO] [stdout] 78 | asts::Types::Function(funs) => { [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_funs` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ast/parsing.rs:537:9 [INFO] [stdout] | [INFO] [stdout] 537 | return asts::Types::Function(function_ast); [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] 537 - return asts::Types::Function(function_ast); [INFO] [stdout] 537 + asts::Types::Function(function_ast) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ast/parsing.rs:553:9 [INFO] [stdout] | [INFO] [stdout] 553 | return vec; [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] 553 - return vec; [INFO] [stdout] 553 + vec [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ast/parsing.rs:583:9 [INFO] [stdout] | [INFO] [stdout] 583 | return node_vec; [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] 583 - return node_vec; [INFO] [stdout] 583 + node_vec [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ast/parsing.rs:648:9 [INFO] [stdout] | [INFO] [stdout] 648 | return None; [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] 648 - return None; [INFO] [stdout] 648 + None [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter/interpreters.rs:45:13 [INFO] [stdout] | [INFO] [stdout] 45 | return arithmetic.common(); [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 - return arithmetic.common(); [INFO] [stdout] 45 + arithmetic.common() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter/interpreters.rs:49:13 [INFO] [stdout] | [INFO] [stdout] 49 | return ast.clone(); [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] 49 - return ast.clone(); [INFO] [stdout] 49 + ast.clone() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/lexer/lexers.rs:34:9 [INFO] [stdout] | [INFO] [stdout] 34 | return tokens; [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] 34 - return tokens; [INFO] [stdout] 34 + tokens [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/lexer/lexers.rs:28:55 [INFO] [stdout] | [INFO] [stdout] 28 | let (result, continue_index) = Lexer::get(&content, self.index); [INFO] [stdout] | ^^^^^^^^ help: change this to: `content` [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: unneeded `return` statement [INFO] [stdout] --> src/lexer/lexers.rs:184:9 [INFO] [stdout] | [INFO] [stdout] 184 | return (token_value, index + 1); [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] 184 - return (token_value, index + 1); [INFO] [stdout] 184 + (token_value, index + 1) [INFO] [stdout] | [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/lexer/lexers.rs:52:9 [INFO] [stdout] | [INFO] [stdout] 52 | / match reg.captures(&last_str) { [INFO] [stdout] 53 | | Some(_) => { [INFO] [stdout] 54 | | loop { [INFO] [stdout] 55 | | let text = &content.chars().nth(index).expect("Failed").to_string(); [INFO] [stdout] ... | [INFO] [stdout] 115 | | None => {} [INFO] [stdout] 116 | | }; [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] 52 ~ if let Some(_) = reg.captures(&last_str) { [INFO] [stdout] 53 + loop { [INFO] [stdout] 54 + let text = &content.chars().nth(index).expect("Failed").to_string(); [INFO] [stdout] 55 + let reg = Regex::new(r"(\d|[a-zA-Z])+").expect("Failed"); [INFO] [stdout] 56 + let res = match reg.captures(text) { [INFO] [stdout] 57 + Some(_) => true, [INFO] [stdout] 58 + None => false, [INFO] [stdout] 59 + }; [INFO] [stdout] 60 + if !res { [INFO] [stdout] 61 + break; [INFO] [stdout] 62 + } [INFO] [stdout] 63 + identifier_str += text; [INFO] [stdout] 64 + index += 1; [INFO] [stdout] 65 + } [INFO] [stdout] 66 + if identifier_str == "print" { [INFO] [stdout] 67 + let token_value = token::TokenValue::new(TOKEN._print, &identifier_str); [INFO] [stdout] 68 + return (token_value, index); [INFO] [stdout] 69 + } [INFO] [stdout] 70 + if identifier_str == "fn" { [INFO] [stdout] 71 + let token_value = token::TokenValue::new(TOKEN._fun, &identifier_str); [INFO] [stdout] 72 + return (token_value, index); [INFO] [stdout] 73 + } [INFO] [stdout] 74 + if identifier_str == "if" { [INFO] [stdout] 75 + let token_value = token::TokenValue::new(TOKEN._if, &identifier_str); [INFO] [stdout] 76 + return (token_value, index); [INFO] [stdout] 77 + } [INFO] [stdout] 78 + if identifier_str == "else" { [INFO] [stdout] 79 + let token_value = token::TokenValue::new(TOKEN._else, &identifier_str); [INFO] [stdout] 80 + return (token_value, index); [INFO] [stdout] 81 + } [INFO] [stdout] 82 + if identifier_str == "for" { [INFO] [stdout] 83 + let token_value = token::TokenValue::new(TOKEN._for, &identifier_str); [INFO] [stdout] 84 + return (token_value, index); [INFO] [stdout] 85 + } [INFO] [stdout] 86 + if identifier_str == "let" { [INFO] [stdout] 87 + let token_value = token::TokenValue::new(TOKEN._let, &identifier_str); [INFO] [stdout] 88 + return (token_value, index); [INFO] [stdout] 89 + } [INFO] [stdout] 90 + if identifier_str == "true" || identifier_str == "false" { [INFO] [stdout] 91 + let token_value = token::TokenValue::new(TOKEN._bool, &identifier_str); [INFO] [stdout] 92 + return (token_value, index); [INFO] [stdout] 93 + } [INFO] [stdout] 94 + if identifier_str == "return" { [INFO] [stdout] 95 + let token_value = token::TokenValue::new(TOKEN._return, &identifier_str); [INFO] [stdout] 96 + return (token_value, index); [INFO] [stdout] 97 + } [INFO] [stdout] 98 + if identifier_str == "vec" { [INFO] [stdout] 99 + let token_value = token::TokenValue::new(TOKEN._vec, &identifier_str); [INFO] [stdout] 100 + return (token_value, index); [INFO] [stdout] 101 + } [INFO] [stdout] 102 + if identifier_str == "import"{ [INFO] [stdout] 103 + let token_value = token::TokenValue::new(TOKEN._import, &identifier_str); [INFO] [stdout] 104 + return (token_value, index); [INFO] [stdout] 105 + } [INFO] [stdout] 106 + if identifier_str == "const" { [INFO] [stdout] 107 + let token_value = token::TokenValue::new(TOKEN._const, &identifier_str); [INFO] [stdout] 108 + return (token_value, index); [INFO] [stdout] 109 + } [INFO] [stdout] 110 + [INFO] [stdout] 111 + let token_value = token::TokenValue::new(TOKEN._identifier, &identifier_str); [INFO] [stdout] 112 + return (token_value, index); [INFO] [stdout] 113 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/lexer/lexers.rs:56:31 [INFO] [stdout] | [INFO] [stdout] 56 | let reg = Regex::new(r"(\d|[a-zA-Z])+").expect("Failed"); [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/lexer/lexers.rs:54:17 [INFO] [stdout] | [INFO] [stdout] 54 | loop { [INFO] [stdout] | ^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] = note: `#[warn(clippy::regex_creation_in_loops)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/lexer/lexers.rs:57:31 [INFO] [stdout] | [INFO] [stdout] 57 | let res = match reg.captures(text) { [INFO] [stdout] | _______________________________^ [INFO] [stdout] 58 | | Some(_) => true, [INFO] [stdout] 59 | | None => false, [INFO] [stdout] 60 | | }; [INFO] [stdout] | |_____________________^ help: try: `reg.captures(text).is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter/interpreters.rs:214:5 [INFO] [stdout] | [INFO] [stdout] 214 | return (true, None); [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] 214 - return (true, None); [INFO] [stdout] 214 + (true, None) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/interpreter/interpreters.rs:79:25 [INFO] [stdout] | [INFO] [stdout] 79 | / if bin.op == inner_bin.op { [INFO] [stdout] 80 | | is_continue = true; [INFO] [stdout] 81 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 78 ~ asts::Types::Binary(inner_bin) [INFO] [stdout] 79 ~ if bin.op == inner_bin.op => { [INFO] [stdout] 80 | is_continue = true; [INFO] [stdout] 81 ~ } [INFO] [stdout] | [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/interpreter/interpreters.rs:77:17 [INFO] [stdout] | [INFO] [stdout] 77 | / match &bin.node[1] { [INFO] [stdout] 78 | | asts::Types::Binary(inner_bin) => { [INFO] [stdout] 79 | | if bin.op == inner_bin.op { [INFO] [stdout] 80 | | is_continue = true; [INFO] [stdout] ... | [INFO] [stdout] 84 | | _ => {} [INFO] [stdout] 85 | | } [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] 77 ~ if let asts::Types::Binary(inner_bin) = &bin.node[1] { [INFO] [stdout] 78 + if bin.op == inner_bin.op { [INFO] [stdout] 79 + is_continue = true; [INFO] [stdout] 80 + } [INFO] [stdout] 81 + } [INFO] [stdout] | [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/interpreter/interpreters.rs:89:17 [INFO] [stdout] | [INFO] [stdout] 89 | / match bin.node[0].clone() { [INFO] [stdout] 90 | | asts::Types::Variable(mut var) => { [INFO] [stdout] 91 | | var.node.push(result); [INFO] [stdout] 92 | | let varibles = asts::Types::Variable(var); [INFO] [stdout] ... | [INFO] [stdout] 95 | | _ => {} [INFO] [stdout] 96 | | } [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] 89 ~ if let asts::Types::Variable(mut var) = bin.node[0].clone() { [INFO] [stdout] 90 + var.node.push(result); [INFO] [stdout] 91 + let varibles = asts::Types::Variable(var); [INFO] [stdout] 92 + vec_variable.push(varibles); [INFO] [stdout] 93 + } [INFO] [stdout] | [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/interpreter/interpreters.rs:106:13 [INFO] [stdout] | [INFO] [stdout] 106 | / match var_contents { [INFO] [stdout] 107 | | Some(content) => { [INFO] [stdout] 108 | | var_ast.node.push(content); [INFO] [stdout] 109 | | vec_variable.push(asts::Types::Variable(var_ast)); [INFO] [stdout] ... | [INFO] [stdout] 112 | | None => {} [INFO] [stdout] 113 | | } [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] 106 ~ if let Some(content) = var_contents { [INFO] [stdout] 107 + var_ast.node.push(content); [INFO] [stdout] 108 + vec_variable.push(asts::Types::Variable(var_ast)); [INFO] [stdout] 109 + } [INFO] [stdout] | [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/lexer/lexers.rs:119:9 [INFO] [stdout] | [INFO] [stdout] 119 | / match reg.captures(&last_str) { [INFO] [stdout] 120 | | Some(_) => { [INFO] [stdout] 121 | | identifier_str = String::new(); [INFO] [stdout] 122 | | loop { [INFO] [stdout] ... | [INFO] [stdout] 135 | | None => {} [INFO] [stdout] 136 | | }; [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] 119 ~ if let Some(_) = reg.captures(&last_str) { [INFO] [stdout] 120 + identifier_str = String::new(); [INFO] [stdout] 121 + loop { [INFO] [stdout] 122 + index += 1; [INFO] [stdout] 123 + let text = &content.chars().nth(index).expect("Failed").to_string(); [INFO] [stdout] 124 + if text != "\"" { [INFO] [stdout] 125 + identifier_str += &text; [INFO] [stdout] 126 + } [INFO] [stdout] 127 + if text == "\"" { [INFO] [stdout] 128 + break; [INFO] [stdout] 129 + }; [INFO] [stdout] 130 + } [INFO] [stdout] 131 + let token_value = token::TokenValue::new(TOKEN._string, &identifier_str); [INFO] [stdout] 132 + return (token_value, index + 1); [INFO] [stdout] 133 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/lexer/lexers.rs:126:43 [INFO] [stdout] | [INFO] [stdout] 126 | identifier_str += &text; [INFO] [stdout] | ^^^^^ help: change this to: `text` [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/interpreter/interpreters.rs:237:5 [INFO] [stdout] | [INFO] [stdout] 237 | return (true, None); [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] 237 - return (true, None); [INFO] [stdout] 237 + (true, None) [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/interpreter/interpreters.rs:218:10 [INFO] [stdout] | [INFO] [stdout] 218 | ast: &Vec, [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] 218 - ast: &Vec, [INFO] [stdout] 218 + ast: &[asts::Types], [INFO] [stdout] | [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/lexer/lexers.rs:139:9 [INFO] [stdout] | [INFO] [stdout] 139 | / match reg.captures(&last_str) { [INFO] [stdout] 140 | | Some(_) => { [INFO] [stdout] 141 | | loop { [INFO] [stdout] 142 | | let text = &content.chars().nth(index).expect("Failed").to_string(); [INFO] [stdout] ... | [INFO] [stdout] 157 | | None => {} [INFO] [stdout] 158 | | }; [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] 139 ~ if let Some(_) = reg.captures(&last_str) { [INFO] [stdout] 140 + loop { [INFO] [stdout] 141 + let text = &content.chars().nth(index).expect("Failed").to_string(); [INFO] [stdout] 142 + let reg = Regex::new(r"[0-9.]+").expect("Faild"); [INFO] [stdout] 143 + let res = match reg.captures(text) { [INFO] [stdout] 144 + Some(_) => true, [INFO] [stdout] 145 + None => false, [INFO] [stdout] 146 + }; [INFO] [stdout] 147 + if !res { [INFO] [stdout] 148 + break; [INFO] [stdout] 149 + } [INFO] [stdout] 150 + identifier_str += text; [INFO] [stdout] 151 + index += 1; [INFO] [stdout] 152 + } [INFO] [stdout] 153 + let token_value = token::TokenValue::new(TOKEN._number, &identifier_str); [INFO] [stdout] 154 + return (token_value, index); [INFO] [stdout] 155 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/lexer/lexers.rs:143:31 [INFO] [stdout] | [INFO] [stdout] 143 | let reg = Regex::new(r"[0-9.]+").expect("Faild"); [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/lexer/lexers.rs:141:17 [INFO] [stdout] | [INFO] [stdout] 141 | loop { [INFO] [stdout] | ^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/lexer/lexers.rs:144:31 [INFO] [stdout] | [INFO] [stdout] 144 | let res = match reg.captures(text) { [INFO] [stdout] | _______________________________^ [INFO] [stdout] 145 | | Some(_) => true, [INFO] [stdout] 146 | | None => false, [INFO] [stdout] 147 | | }; [INFO] [stdout] | |_____________________^ help: try: `reg.captures(text).is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [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/lexer/lexers.rs:161:9 [INFO] [stdout] | [INFO] [stdout] 161 | / match reg.captures(&last_str) { [INFO] [stdout] 162 | | Some(_) => { [INFO] [stdout] 163 | | loop { [INFO] [stdout] 164 | | let text = &content.chars().nth(index).expect("Failed").to_string(); [INFO] [stdout] ... | [INFO] [stdout] 174 | | None => {} [INFO] [stdout] 175 | | } [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] 161 ~ if let Some(_) = reg.captures(&last_str) { [INFO] [stdout] 162 + loop { [INFO] [stdout] 163 + let text = &content.chars().nth(index).expect("Failed").to_string(); [INFO] [stdout] 164 + if text == "\n" { [INFO] [stdout] 165 + break; [INFO] [stdout] 166 + } [INFO] [stdout] 167 + identifier_str += text; [INFO] [stdout] 168 + index += 1; [INFO] [stdout] 169 + } [INFO] [stdout] 170 + let token_value = token::TokenValue::new(TOKEN._comment, &identifier_str); [INFO] [stdout] 171 + return (token_value, index); [INFO] [stdout] 172 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter/interpreters.rs:256:5 [INFO] [stdout] | [INFO] [stdout] 256 | return result; [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] 256 - return result; [INFO] [stdout] 256 + result [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Token` [INFO] [stdout] --> src/lexer/token.rs:21:5 [INFO] [stdout] | [INFO] [stdout] 21 | / pub const fn new() -> Token { [INFO] [stdout] 22 | | Token { [INFO] [stdout] 23 | | _if: -1, [INFO] [stdout] 24 | | _then: -2, [INFO] [stdout] ... | [INFO] [stdout] 40 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 20 + impl Default for Token { [INFO] [stdout] 21 + fn default() -> Self { [INFO] [stdout] 22 + Self::new() [INFO] [stdout] 23 + } [INFO] [stdout] 24 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter/arithmetic.rs:197:9 [INFO] [stdout] | [INFO] [stdout] 197 | return next_node; [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] 197 - return next_node; [INFO] [stdout] 197 + next_node [INFO] [stdout] | [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/interpreter/arithmetic.rs:20:13 [INFO] [stdout] | [INFO] [stdout] 20 | / match &next_node { [INFO] [stdout] 21 | | asts::Types::Binary(bin) => match self.comparison_operator(bin.op, &node) { [INFO] [stdout] 22 | | Some(num) => { [INFO] [stdout] 23 | | return asts::Types::Number(asts::NumberAST::new(num)); [INFO] [stdout] ... | [INFO] [stdout] 28 | | _ => {} [INFO] [stdout] 29 | | } [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] 20 ~ if let asts::Types::Binary(bin) = &next_node { match self.comparison_operator(bin.op, &node) { [INFO] [stdout] 21 + Some(num) => { [INFO] [stdout] 22 + return asts::Types::Number(asts::NumberAST::new(num)); [INFO] [stdout] 23 + } [INFO] [stdout] 24 + None => {} [INFO] [stdout] 25 + } } [INFO] [stdout] | [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/interpreter/arithmetic.rs:21:45 [INFO] [stdout] | [INFO] [stdout] 21 | asts::Types::Binary(bin) => match self.comparison_operator(bin.op, &node) { [INFO] [stdout] | _____________________________________________^ [INFO] [stdout] 22 | | Some(num) => { [INFO] [stdout] 23 | | return asts::Types::Number(asts::NumberAST::new(num)); [INFO] [stdout] ... | [INFO] [stdout] 26 | | }, [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] 21 ~ asts::Types::Binary(bin) => if let Some(num) = self.comparison_operator(bin.op, &node) { [INFO] [stdout] 22 + return asts::Types::Number(asts::NumberAST::new(num)); [INFO] [stdout] 23 ~ }, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/interpreter/arithmetic.rs:85:16 [INFO] [stdout] | [INFO] [stdout] 85 | if strings.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `strings.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/interpreter/arithmetic.rs:110:13 [INFO] [stdout] | [INFO] [stdout] 110 | let result: bool; [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 `result` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 110 ~ [INFO] [stdout] 111 | [INFO] [stdout] 112 ~ let result: bool = if self.bin.node.len() == 3 { [INFO] [stdout] 113 ~ self.greater_than_equal(numbers[0], numbers[1]) [INFO] [stdout] 114 | } else { [INFO] [stdout] 115 ~ self.greater_than(numbers[0], numbers[1]) [INFO] [stdout] 116 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `ExprAST` [INFO] [stdout] --> src/ast/asts.rs:41:5 [INFO] [stdout] | [INFO] [stdout] 41 | / pub fn new() -> ExprAST { [INFO] [stdout] 42 | | ExprAST { node: Vec::new() } [INFO] [stdout] 43 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 40 + impl Default for ExprAST { [INFO] [stdout] 41 + fn default() -> Self { [INFO] [stdout] 42 + Self::new() [INFO] [stdout] 43 + } [INFO] [stdout] 44 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/interpreter/arithmetic.rs:129:13 [INFO] [stdout] | [INFO] [stdout] 129 | let result: bool; [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] help: move the declaration `result` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 129 ~ [INFO] [stdout] 130 | [INFO] [stdout] 131 ~ let result: bool = if self.bin.node.len() == 3 { [INFO] [stdout] 132 ~ self.less_than_equal(numbers[0], numbers[1]) [INFO] [stdout] 133 | } else { [INFO] [stdout] 134 ~ self.less_than(numbers[0], numbers[1]) [INFO] [stdout] 135 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/interpreter/arithmetic.rs:153:16 [INFO] [stdout] | [INFO] [stdout] 153 | if strings.len() == 0 && self.bin.node.len() == 3 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `strings.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/interpreter/arithmetic.rs:176:16 [INFO] [stdout] | [INFO] [stdout] 176 | if strings.len() == 0 && self.bin.node.len() == 3 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `strings.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter/arithmetic.rs:720:9 [INFO] [stdout] | [INFO] [stdout] 720 | return numbers; [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] 720 - return numbers; [INFO] [stdout] 720 + numbers [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `VectorAST` [INFO] [stdout] --> src/ast/asts.rs:199:5 [INFO] [stdout] | [INFO] [stdout] 199 | / pub fn new() -> VectorAST { [INFO] [stdout] 200 | | VectorAST{ [INFO] [stdout] 201 | | node: Vec::new(), [INFO] [stdout] 202 | | } [INFO] [stdout] 203 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 198 + impl Default for VectorAST { [INFO] [stdout] 199 + fn default() -> Self { [INFO] [stdout] 200 + Self::new() [INFO] [stdout] 201 + } [INFO] [stdout] 202 + } [INFO] [stdout] | [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/interpreter/arithmetic.rs:248:9 [INFO] [stdout] | [INFO] [stdout] 248 | / match node_first.clone() { [INFO] [stdout] 249 | | asts::Types::Binary(binary) => { [INFO] [stdout] 250 | | bin = binary.op; [INFO] [stdout] 251 | | let len = binary.node.len(); [INFO] [stdout] ... | [INFO] [stdout] 263 | | _ => {} [INFO] [stdout] 264 | | } [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] 248 ~ if let asts::Types::Binary(binary) = node_first.clone() { [INFO] [stdout] 249 + bin = binary.op; [INFO] [stdout] 250 + let len = binary.node.len(); [INFO] [stdout] 251 + [INFO] [stdout] 252 + if len == 1 { [INFO] [stdout] 253 + node_seccond = binary.node[0].clone(); [INFO] [stdout] 254 + } else if len >= 2 { [INFO] [stdout] 255 + comparison_node = binary.node[0].clone(); [INFO] [stdout] 256 + node_seccond = binary.node[1].clone(); [INFO] [stdout] 257 + } else { [INFO] [stdout] 258 + let err = error::Error::new(&node_first); [INFO] [stdout] 259 + err.exit("number operater error"); [INFO] [stdout] 260 + } [INFO] [stdout] 261 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calls to `push` immediately after creation [INFO] [stdout] --> src/ast/asts.rs:229:9 [INFO] [stdout] | [INFO] [stdout] 229 | / let mut for_types = Vec::new(); [INFO] [stdout] 230 | | for_types.push(init); [INFO] [stdout] 231 | | for_types.push(cond); [INFO] [stdout] 232 | | for_types.push(inc); [INFO] [stdout] | |____________________________^ help: consider using the `vec![]` macro: `let for_types = vec![..];` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push [INFO] [stdout] = note: `#[warn(clippy::vec_init_then_push)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `RetrunAST` [INFO] [stdout] --> src/ast/asts.rs:247:5 [INFO] [stdout] | [INFO] [stdout] 247 | / pub fn new() -> RetrunAST { [INFO] [stdout] 248 | | RetrunAST{ [INFO] [stdout] 249 | | node:Vec::new(), [INFO] [stdout] 250 | | } [INFO] [stdout] 251 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 246 + impl Default for RetrunAST { [INFO] [stdout] 247 + fn default() -> Self { [INFO] [stdout] 248 + Self::new() [INFO] [stdout] 249 + } [INFO] [stdout] 250 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/interpreter/arithmetic.rs:298:24 [INFO] [stdout] | [INFO] [stdout] 298 | if string_a.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!string_a.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `ImportAST` [INFO] [stdout] --> src/ast/asts.rs:312:5 [INFO] [stdout] | [INFO] [stdout] 312 | / pub fn new() -> ImportAST { [INFO] [stdout] 313 | | ImportAST{ [INFO] [stdout] 314 | | path:Vec::new(), [INFO] [stdout] 315 | | } [INFO] [stdout] 316 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 311 + impl Default for ImportAST { [INFO] [stdout] 312 + fn default() -> Self { [INFO] [stdout] 313 + Self::new() [INFO] [stdout] 314 + } [INFO] [stdout] 315 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `EndAST` [INFO] [stdout] --> src/ast/asts.rs:325:5 [INFO] [stdout] | [INFO] [stdout] 325 | / pub fn new() -> Self { [INFO] [stdout] 326 | | EndAST { [INFO] [stdout] 327 | | end: "end".to_string(), [INFO] [stdout] 328 | | } [INFO] [stdout] 329 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 324 + impl Default for EndAST { [INFO] [stdout] 325 + fn default() -> Self { [INFO] [stdout] 326 + Self::new() [INFO] [stdout] 327 + } [INFO] [stdout] 328 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/interpreter/arithmetic.rs:366:32 [INFO] [stdout] | [INFO] [stdout] 366 | ... if string_a.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!string_a.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/ast/parsing.rs:10:24 [INFO] [stdout] | [INFO] [stdout] 10 | pub fn new(tokens: &Vec) -> Parsing { [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] 10 ~ pub fn new(tokens: &[token::TokenValue]) -> Parsing { [INFO] [stdout] 11 ~ let tokens = tokens.to_owned(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ast/parsing.rs:19:9 [INFO] [stdout] | [INFO] [stdout] 19 | return root; [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] 19 - return root; [INFO] [stdout] 19 + root [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/ast/parsing.rs:81:16 [INFO] [stdout] | [INFO] [stdout] 81 | if self.tokens[2].token == 43 && is_token || self.tokens[2].token == 45 && is_token { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 81 - if self.tokens[2].token == 43 && is_token || self.tokens[2].token == 45 && is_token { [INFO] [stdout] 81 + if !(!is_token || self.tokens[2].token != 43 && self.tokens[2].token != 45) { [INFO] [stdout] | [INFO] [stdout] 81 - if self.tokens[2].token == 43 && is_token || self.tokens[2].token == 45 && is_token { [INFO] [stdout] 81 + if (self.tokens[2].token == 45 || self.tokens[2].token == 43) && is_token { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/interpreter/arithmetic.rs:397:32 [INFO] [stdout] | [INFO] [stdout] 397 | ... if string_a.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!string_a.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ast/parsing.rs:235:9 [INFO] [stdout] | [INFO] [stdout] 235 | return variable; [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] 235 - return variable; [INFO] [stdout] 235 + variable [INFO] [stdout] | [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/interpreter/arithmetic.rs:430:21 [INFO] [stdout] | [INFO] [stdout] 430 | / match comparison_node { [INFO] [stdout] 431 | | asts::Types::Binary(_) => { [INFO] [stdout] 432 | | binarys.node.push(comparison_node); [INFO] [stdout] ... | [INFO] [stdout] 435 | | } [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] 430 ~ if let asts::Types::Binary(_) = comparison_node { [INFO] [stdout] 431 + binarys.node.push(comparison_node); [INFO] [stdout] 432 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/interpreter/arithmetic.rs:450:32 [INFO] [stdout] | [INFO] [stdout] 450 | ... if string_a.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!string_a.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calls to `push` immediately after creation [INFO] [stdout] --> src/ast/parsing.rs:35:13 [INFO] [stdout] | [INFO] [stdout] 35 | / let mut result_vec: Vec = Vec::new(); [INFO] [stdout] 36 | | result_vec.push(result); [INFO] [stdout] | |____________________________________^ help: consider using the `vec![]` macro: `let result_vec: Vec = vec![..];` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/interpreter/arithmetic.rs:481:32 [INFO] [stdout] | [INFO] [stdout] 481 | ... if string_a.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!string_a.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/interpreter/arithmetic.rs:613:21 [INFO] [stdout] | [INFO] [stdout] 613 | / match comparison_node { [INFO] [stdout] 614 | | asts::Types::Binary(_) => match numbers.clone() { [INFO] [stdout] 615 | | asts::Types::Strings(_) => { [INFO] [stdout] 616 | | let result = self.equivalence_string(&string_a, string_b); [INFO] [stdout] ... | [INFO] [stdout] 651 | | _ => {} [INFO] [stdout] 652 | | } [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] 613 ~ if let asts::Types::Binary(_) = comparison_node { match numbers.clone() { [INFO] [stdout] 614 + asts::Types::Strings(_) => { [INFO] [stdout] 615 + let result = self.equivalence_string(&string_a, string_b); [INFO] [stdout] 616 + let equivalence_string_result = [INFO] [stdout] 617 + asts::Types::Boolean(asts::BooleanAST::new(result)); [INFO] [stdout] 618 + return self.calculations_continue( [INFO] [stdout] 619 + string.node, [INFO] [stdout] 620 + equivalence_string_result, [INFO] [stdout] 621 + select_binary, [INFO] [stdout] 622 + ); [INFO] [stdout] 623 + } [INFO] [stdout] 624 + [INFO] [stdout] 625 + asts::Types::Number(_) => { [INFO] [stdout] 626 + let result = [INFO] [stdout] 627 + self.equivalence_string(&number_a.to_string(), string_b); [INFO] [stdout] 628 + let equivalence_string_result = [INFO] [stdout] 629 + asts::Types::Boolean(asts::BooleanAST::new(result)); [INFO] [stdout] 630 + return self.calculations_continue( [INFO] [stdout] 631 + string.node, [INFO] [stdout] 632 + equivalence_string_result, [INFO] [stdout] 633 + select_binary, [INFO] [stdout] 634 + ); [INFO] [stdout] 635 + } [INFO] [stdout] 636 + [INFO] [stdout] 637 + asts::Types::Boolean(_) => { [INFO] [stdout] 638 + let result = self.equivalence_string(&bool_a.to_string(), string_b); [INFO] [stdout] 639 + let equivalence_string_result = [INFO] [stdout] 640 + asts::Types::Boolean(asts::BooleanAST::new(result)); [INFO] [stdout] 641 + return self.calculations_continue( [INFO] [stdout] 642 + string.node, [INFO] [stdout] 643 + equivalence_string_result, [INFO] [stdout] 644 + select_binary, [INFO] [stdout] 645 + ); [INFO] [stdout] 646 + } [INFO] [stdout] 647 + [INFO] [stdout] 648 + _ => {} [INFO] [stdout] 649 + } } [INFO] [stdout] | [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/interpreter/arithmetic.rs:656:21 [INFO] [stdout] | [INFO] [stdout] 656 | / match comparison_node { [INFO] [stdout] 657 | | asts::Types::Binary(_) => match numbers.clone() { [INFO] [stdout] 658 | | asts::Types::Strings(_) => { [INFO] [stdout] 659 | | let result = self.inequality_string(&string_a, string_b); [INFO] [stdout] ... | [INFO] [stdout] 694 | | _ => {} [INFO] [stdout] 695 | | } [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] 656 ~ if let asts::Types::Binary(_) = comparison_node { match numbers.clone() { [INFO] [stdout] 657 + asts::Types::Strings(_) => { [INFO] [stdout] 658 + let result = self.inequality_string(&string_a, string_b); [INFO] [stdout] 659 + let inequality_string_result = [INFO] [stdout] 660 + asts::Types::Boolean(asts::BooleanAST::new(result)); [INFO] [stdout] 661 + return self.calculations_continue( [INFO] [stdout] 662 + string.node, [INFO] [stdout] 663 + inequality_string_result, [INFO] [stdout] 664 + select_binary, [INFO] [stdout] 665 + ); [INFO] [stdout] 666 + } [INFO] [stdout] 667 + [INFO] [stdout] 668 + asts::Types::Number(_) => { [INFO] [stdout] 669 + let result = [INFO] [stdout] 670 + self.inequality_string(&number_a.to_string(), string_b); [INFO] [stdout] 671 + let inequality_string_result = [INFO] [stdout] 672 + asts::Types::Boolean(asts::BooleanAST::new(result)); [INFO] [stdout] 673 + return self.calculations_continue( [INFO] [stdout] 674 + string.node, [INFO] [stdout] 675 + inequality_string_result, [INFO] [stdout] 676 + select_binary, [INFO] [stdout] 677 + ); [INFO] [stdout] 678 + } [INFO] [stdout] 679 + [INFO] [stdout] 680 + asts::Types::Boolean(_) => { [INFO] [stdout] 681 + let result = self.inequality_string(&bool_a.to_string(), string_b); [INFO] [stdout] 682 + let inequality_string_result = [INFO] [stdout] 683 + asts::Types::Boolean(asts::BooleanAST::new(result)); [INFO] [stdout] 684 + return self.calculations_continue( [INFO] [stdout] 685 + string.node, [INFO] [stdout] 686 + inequality_string_result, [INFO] [stdout] 687 + select_binary, [INFO] [stdout] 688 + ); [INFO] [stdout] 689 + } [INFO] [stdout] 690 + [INFO] [stdout] 691 + _ => {} [INFO] [stdout] 692 + } } [INFO] [stdout] | [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/interpreter/arithmetic.rs:700:25 [INFO] [stdout] | [INFO] [stdout] 700 | / match comparison_node { [INFO] [stdout] 701 | | asts::Types::Binary(_) => { [INFO] [stdout] 702 | | binarys.node.push(comparison_node); [INFO] [stdout] ... | [INFO] [stdout] 705 | | } [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] 700 ~ if let asts::Types::Binary(_) = comparison_node { [INFO] [stdout] 701 + binarys.node.push(comparison_node); [INFO] [stdout] 702 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter/arithmetic.rs:737:17 [INFO] [stdout] | [INFO] [stdout] 737 | return number_result; [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] 737 - return number_result; [INFO] [stdout] 737 + number_result [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter/arithmetic.rs:743:17 [INFO] [stdout] | [INFO] [stdout] 743 | return bools_result; [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] 743 - return bools_result; [INFO] [stdout] 743 + bools_result [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter/arithmetic.rs:750:17 [INFO] [stdout] | [INFO] [stdout] 750 | return strings_result; [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] 750 - return strings_result; [INFO] [stdout] 750 + strings_result [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ast/parsing.rs:253:9 [INFO] [stdout] | [INFO] [stdout] 253 | return vec_node; [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] 253 - return vec_node; [INFO] [stdout] 253 + vec_node [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter/arithmetic.rs:786:9 [INFO] [stdout] | [INFO] [stdout] 786 | return (numbers, types); [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] 786 - return (numbers, types); [INFO] [stdout] 786 + (numbers, types) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ast/parsing.rs:443:17 [INFO] [stdout] | [INFO] [stdout] 443 | return ast_binary; [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 - return ast_binary; [INFO] [stdout] 443 + ast_binary [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ast/parsing.rs:445:18 [INFO] [stdout] | [INFO] [stdout] 445 | _ => return asts::Types::Error(asts::ErrorAST::new("Binary parsing 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] 445 - _ => return asts::Types::Error(asts::ErrorAST::new("Binary parsing error")), [INFO] [stdout] 445 + _ => asts::Types::Error(asts::ErrorAST::new("Binary parsing error")), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter/arithmetic.rs:845:9 [INFO] [stdout] | [INFO] [stdout] 845 | return (numbers, strings, types); [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] 845 - return (numbers, strings, types); [INFO] [stdout] 845 + (numbers, strings, types) [INFO] [stdout] | [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/ast/parsing.rs:277:21 [INFO] [stdout] | [INFO] [stdout] 277 | / match var.index { [INFO] [stdout] 278 | | Some(_) => { [INFO] [stdout] 279 | | loop { [INFO] [stdout] 280 | | self.tokens.remove(0); [INFO] [stdout] ... | [INFO] [stdout] 288 | | None => {} [INFO] [stdout] 289 | | } [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] 277 ~ if let Some(_) = var.index { [INFO] [stdout] 278 + loop { [INFO] [stdout] 279 + self.tokens.remove(0); [INFO] [stdout] 280 + if self.tokens[0].token == 93 { [INFO] [stdout] 281 + break; [INFO] [stdout] 282 + } [INFO] [stdout] 283 + } [INFO] [stdout] 284 + number_vector.push(asts::Types::Variable(var.clone())); [INFO] [stdout] 285 + continue; [INFO] [stdout] 286 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/interpreter/arithmetic.rs:816:20 [INFO] [stdout] | [INFO] [stdout] 816 | if strings.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `strings.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/interpreter/arithmetic.rs:828:20 [INFO] [stdout] | [INFO] [stdout] 828 | if numbers.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!numbers.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter/arithmetic.rs:865:9 [INFO] [stdout] | [INFO] [stdout] 865 | return None; [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] 865 - return None; [INFO] [stdout] 865 + None [INFO] [stdout] | [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/ast/parsing.rs:356:13 [INFO] [stdout] | [INFO] [stdout] 356 | / match binary { [INFO] [stdout] 357 | | asts::Types::Binary(mut bin) => { [INFO] [stdout] 358 | | bin.node.push(number); [INFO] [stdout] 359 | | bin.node.push(binary_sccond); [INFO] [stdout] ... | [INFO] [stdout] 362 | | _ => {} [INFO] [stdout] 363 | | } [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] 356 ~ if let asts::Types::Binary(mut bin) = binary { [INFO] [stdout] 357 + bin.node.push(number); [INFO] [stdout] 358 + bin.node.push(binary_sccond); [INFO] [stdout] 359 + return asts::Types::Binary(bin); [INFO] [stdout] 360 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/interpreter/arithmetic.rs:861:45 [INFO] [stdout] | [INFO] [stdout] 861 | let err = error::Error::new(&number); [INFO] [stdout] | ^^^^^^^ help: change this to: `number` [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/interpreter/arithmetic.rs:901:9 [INFO] [stdout] | [INFO] [stdout] 901 | return ast_retruns; [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] 901 - return ast_retruns; [INFO] [stdout] 901 + ast_retruns [INFO] [stdout] | [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/ast/parsing.rs:400:65 [INFO] [stdout] | [INFO] [stdout] 400 | ... asts::Types::Binary(mut bin) => match bin.node[0].clone() { [INFO] [stdout] | _______________________________________________________^ [INFO] [stdout] 401 | | ... asts::Types::Call(mut call) => { [INFO] [stdout] 402 | | ... call.node.push(ast_temp.clone()); [INFO] [stdout] 403 | | ... let call = asts::Types::Call(call); [INFO] [stdout] ... | [INFO] [stdout] 411 | | ... _ => {} [INFO] [stdout] 412 | | ... }, [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] 400 ~ asts::Types::Binary(mut bin) => if let asts::Types::Call(mut call) = bin.node[0].clone() { [INFO] [stdout] 401 + call.node.push(ast_temp.clone()); [INFO] [stdout] 402 + let call = asts::Types::Call(call); [INFO] [stdout] 403 + bin.node.clear(); [INFO] [stdout] 404 + bin.node.push(call); [INFO] [stdout] 405 + let bins = asts::Types::Binary(bin); [INFO] [stdout] 406 + vars.node.clear(); [INFO] [stdout] 407 + vars.node.push(bins); [INFO] [stdout] 408 + number = asts::Types::Variable(vars); [INFO] [stdout] 409 ~ }, [INFO] [stdout] | [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/ast/parsing.rs:428:13 [INFO] [stdout] | [INFO] [stdout] 428 | / match binary { [INFO] [stdout] 429 | | asts::Types::Binary(mut binary) => { [INFO] [stdout] 430 | | binary.node.push(number.clone()); [INFO] [stdout] 431 | | ast_temp = asts::Types::Binary(binary); [INFO] [stdout] 432 | | } [INFO] [stdout] 433 | | _ => {} [INFO] [stdout] 434 | | } [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] 428 ~ if let asts::Types::Binary(mut binary) = binary { [INFO] [stdout] 429 + binary.node.push(number.clone()); [INFO] [stdout] 430 + ast_temp = asts::Types::Binary(binary); [INFO] [stdout] 431 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ast/parsing.rs:461:9 [INFO] [stdout] | [INFO] [stdout] 461 | return result; [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] 461 - return result; [INFO] [stdout] 461 + result [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/interpreter/fors.rs:13:25 [INFO] [stdout] | [INFO] [stdout] 13 | pub fn new(ast_for: &Vec, ast: &Vec) -> For { [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] 13 ~ pub fn new(ast_for: &[asts::Types], ast: &Vec) -> For { [INFO] [stdout] 14 ~ let ast_for = ast_for.to_owned(); [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/interpreter/fors.rs:13:49 [INFO] [stdout] | [INFO] [stdout] 13 | pub fn new(ast_for: &Vec, ast: &Vec) -> For { [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] 13 ~ pub fn new(ast_for: &Vec, ast: &[asts::Types]) -> For { [INFO] [stdout] 14 | let ast_for = ast_for.clone(); [INFO] [stdout] 15 ~ let ast = ast.to_owned(); [INFO] [stdout] | [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/ast/parsing.rs:455:9 [INFO] [stdout] | [INFO] [stdout] 455 | / match result { [INFO] [stdout] 456 | | asts::Types::Number(_) => { [INFO] [stdout] 457 | | result = self.calculation(); [INFO] [stdout] ... | [INFO] [stdout] 460 | | } [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] 455 ~ if let asts::Types::Number(_) = result { [INFO] [stdout] 456 + result = self.calculation(); [INFO] [stdout] 457 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter/fors.rs:107:9 [INFO] [stdout] | [INFO] [stdout] 107 | return None; [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] 107 - return None; [INFO] [stdout] 107 + None [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ast/parsing.rs:476:17 [INFO] [stdout] | [INFO] [stdout] 476 | return asts::Types::Binary(bin); [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] 476 - return asts::Types::Binary(bin); [INFO] [stdout] 476 + asts::Types::Binary(bin) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ast/parsing.rs:480:17 [INFO] [stdout] | [INFO] [stdout] 480 | return asts::Types::Error(asts::ErrorAST::new("Reassignment operater 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] 480 - return asts::Types::Error(asts::ErrorAST::new("Reassignment operater error")); [INFO] [stdout] 480 + asts::Types::Error(asts::ErrorAST::new("Reassignment operater error")) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ast/parsing.rs:537:9 [INFO] [stdout] | [INFO] [stdout] 537 | return asts::Types::Function(function_ast); [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] 537 - return asts::Types::Function(function_ast); [INFO] [stdout] 537 + asts::Types::Function(function_ast) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter/fors.rs:157:9 [INFO] [stdout] | [INFO] [stdout] 157 | return ast_vec; [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] 157 - return ast_vec; [INFO] [stdout] 157 + ast_vec [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ast/parsing.rs:553:9 [INFO] [stdout] | [INFO] [stdout] 553 | return vec; [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] 553 - return vec; [INFO] [stdout] 553 + vec [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/interpreter/fors.rs:148:57 [INFO] [stdout] | [INFO] [stdout] 148 | ... let err = error::Error::new(&result); [INFO] [stdout] | ^^^^^^^ help: change this to: `result` [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/ast/parsing.rs:583:9 [INFO] [stdout] | [INFO] [stdout] 583 | return node_vec; [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] 583 - return node_vec; [INFO] [stdout] 583 + node_vec [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: parameter is only used in recursion [INFO] [stdout] --> src/interpreter/fors.rs:112:9 [INFO] [stdout] | [INFO] [stdout] 112 | name: &str, [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_name` [INFO] [stdout] | [INFO] [stdout] note: parameter used here [INFO] [stdout] --> src/interpreter/fors.rs:121:54 [INFO] [stdout] | [INFO] [stdout] 121 | let vec = self.for_variables(name, result, bin.node.clone()); [INFO] [stdout] | ^^^^ [INFO] [stdout] ... [INFO] [stdout] 129 | let vec = self.for_variables(name, result, num.node.clone()); [INFO] [stdout] | ^^^^ [INFO] [stdout] ... [INFO] [stdout] 139 | vec = self.for_variables(name, result, var.node.clone()); [INFO] [stdout] | ^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#only_used_in_recursion [INFO] [stdout] = note: `#[warn(clippy::only_used_in_recursion)]` 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/interpreter/ifs.rs:12:43 [INFO] [stdout] | [INFO] [stdout] 12 | pub fn new(result: &asts::Types, ifs: &Vec) -> If { [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] 12 ~ pub fn new(result: &asts::Types, ifs: &[asts::Types]) -> If { [INFO] [stdout] 13 | If{ [INFO] [stdout] 14 | result: result.clone(), [INFO] [stdout] 15 ~ ifs: ifs.to_owned() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter/ifs.rs:33:9 [INFO] [stdout] | [INFO] [stdout] 33 | return None; [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] 33 - return None; [INFO] [stdout] 33 + None [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ast/parsing.rs:648:9 [INFO] [stdout] | [INFO] [stdout] 648 | return None; [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] 648 - return None; [INFO] [stdout] 648 + None [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/interpreter/ifs.rs:26:17 [INFO] [stdout] | [INFO] [stdout] 26 | / if boolean.boolean { [INFO] [stdout] 27 | | let (_, result) = interpreters::scope(&self.ifs, vec_variable, vec_function); [INFO] [stdout] 28 | | return result; [INFO] [stdout] 29 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 25 ~ asts::Types::Boolean(boolean) [INFO] [stdout] 26 ~ if boolean.boolean => { [INFO] [stdout] 27 | let (_, result) = interpreters::scope(&self.ifs, vec_variable, vec_function); [INFO] [stdout] 28 | return result; [INFO] [stdout] 29 ~ } [INFO] [stdout] | [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/interpreter/ifs.rs:24:9 [INFO] [stdout] | [INFO] [stdout] 24 | / match self.result { [INFO] [stdout] 25 | | asts::Types::Boolean(boolean) => { [INFO] [stdout] 26 | | if boolean.boolean { [INFO] [stdout] 27 | | let (_, result) = interpreters::scope(&self.ifs, vec_variable, vec_function); [INFO] [stdout] ... | [INFO] [stdout] 31 | | _ => {} [INFO] [stdout] 32 | | } [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] 24 ~ if let asts::Types::Boolean(boolean) = self.result { [INFO] [stdout] 25 + if boolean.boolean { [INFO] [stdout] 26 + let (_, result) = interpreters::scope(&self.ifs, vec_variable, vec_function); [INFO] [stdout] 27 + return result; [INFO] [stdout] 28 + } [INFO] [stdout] 29 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Variable` [INFO] [stdout] --> src/interpreter/variable.rs:13:5 [INFO] [stdout] | [INFO] [stdout] 13 | / pub fn new() -> Variable { [INFO] [stdout] 14 | | let mut var = Variable { [INFO] [stdout] 15 | | variables: Vec::new(), [INFO] [stdout] 16 | | inner: 0, [INFO] [stdout] ... | [INFO] [stdout] 20 | | return var; [INFO] [stdout] 21 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 12 + impl Default for Variable { [INFO] [stdout] 13 + fn default() -> Self { [INFO] [stdout] 14 + Self::new() [INFO] [stdout] 15 + } [INFO] [stdout] 16 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter/variable.rs:20:9 [INFO] [stdout] | [INFO] [stdout] 20 | return var; [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] 20 - return var; [INFO] [stdout] 20 + var [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter/variable.rs:130:9 [INFO] [stdout] | [INFO] [stdout] 130 | return Some(calcu); [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] 130 - return Some(calcu); [INFO] [stdout] 130 + Some(calcu) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter/interpreters.rs:45:13 [INFO] [stdout] | [INFO] [stdout] 45 | return arithmetic.common(); [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 - return arithmetic.common(); [INFO] [stdout] 45 + arithmetic.common() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter/interpreters.rs:49:13 [INFO] [stdout] | [INFO] [stdout] 49 | return ast.clone(); [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] 49 - return ast.clone(); [INFO] [stdout] 49 + ast.clone() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter/interpreters.rs:214:5 [INFO] [stdout] | [INFO] [stdout] 214 | return (true, None); [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] 214 - return (true, None); [INFO] [stdout] 214 + (true, None) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/interpreter/variable.rs:115:62 [INFO] [stdout] | [INFO] [stdout] 115 | let (serch, _) = self.serch_variable(&var, vec_function); [INFO] [stdout] | ^^^^ help: change this to: `var` [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 `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/interpreter/interpreters.rs:79:25 [INFO] [stdout] | [INFO] [stdout] 79 | / if bin.op == inner_bin.op { [INFO] [stdout] 80 | | is_continue = true; [INFO] [stdout] 81 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 78 ~ asts::Types::Binary(inner_bin) [INFO] [stdout] 79 ~ if bin.op == inner_bin.op => { [INFO] [stdout] 80 | is_continue = true; [INFO] [stdout] 81 ~ } [INFO] [stdout] | [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/interpreter/interpreters.rs:77:17 [INFO] [stdout] | [INFO] [stdout] 77 | / match &bin.node[1] { [INFO] [stdout] 78 | | asts::Types::Binary(inner_bin) => { [INFO] [stdout] 79 | | if bin.op == inner_bin.op { [INFO] [stdout] 80 | | is_continue = true; [INFO] [stdout] ... | [INFO] [stdout] 84 | | _ => {} [INFO] [stdout] 85 | | } [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] 77 ~ if let asts::Types::Binary(inner_bin) = &bin.node[1] { [INFO] [stdout] 78 + if bin.op == inner_bin.op { [INFO] [stdout] 79 + is_continue = true; [INFO] [stdout] 80 + } [INFO] [stdout] 81 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter/variable.rs:229:9 [INFO] [stdout] | [INFO] [stdout] 229 | return (variable_retrun, is_mutable); [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] 229 - return (variable_retrun, is_mutable); [INFO] [stdout] 229 + (variable_retrun, is_mutable) [INFO] [stdout] | [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/interpreter/interpreters.rs:89:17 [INFO] [stdout] | [INFO] [stdout] 89 | / match bin.node[0].clone() { [INFO] [stdout] 90 | | asts::Types::Variable(mut var) => { [INFO] [stdout] 91 | | var.node.push(result); [INFO] [stdout] 92 | | let varibles = asts::Types::Variable(var); [INFO] [stdout] ... | [INFO] [stdout] 95 | | _ => {} [INFO] [stdout] 96 | | } [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] 89 ~ if let asts::Types::Variable(mut var) = bin.node[0].clone() { [INFO] [stdout] 90 + var.node.push(result); [INFO] [stdout] 91 + let varibles = asts::Types::Variable(var); [INFO] [stdout] 92 + vec_variable.push(varibles); [INFO] [stdout] 93 + } [INFO] [stdout] | [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/interpreter/interpreters.rs:106:13 [INFO] [stdout] | [INFO] [stdout] 106 | / match var_contents { [INFO] [stdout] 107 | | Some(content) => { [INFO] [stdout] 108 | | var_ast.node.push(content); [INFO] [stdout] 109 | | vec_variable.push(asts::Types::Variable(var_ast)); [INFO] [stdout] ... | [INFO] [stdout] 112 | | None => {} [INFO] [stdout] 113 | | } [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] 106 ~ if let Some(content) = var_contents { [INFO] [stdout] 107 + var_ast.node.push(content); [INFO] [stdout] 108 + vec_variable.push(asts::Types::Variable(var_ast)); [INFO] [stdout] 109 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calls to `push` immediately after creation [INFO] [stdout] --> src/interpreter/variable.rs:171:37 [INFO] [stdout] | [INFO] [stdout] 171 | / ... let mut vec = Vec::new(); [INFO] [stdout] 172 | | ... vec.push(somes); [INFO] [stdout] | |______________________________________^ help: consider using the `vec![]` macro: `let vec = vec![..];` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calls to `push` immediately after creation [INFO] [stdout] --> src/interpreter/variable.rs:188:37 [INFO] [stdout] | [INFO] [stdout] 188 | / ... let mut vec = Vec::new(); [INFO] [stdout] 189 | | ... vec.push(var.clone()); [INFO] [stdout] | |____________________________________________^ help: consider using the `vec![]` macro: `let vec = vec![..];` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calls to `push` immediately after creation [INFO] [stdout] --> src/interpreter/variable.rs:200:45 [INFO] [stdout] | [INFO] [stdout] 200 | / ... let mut vec = Vec::new(); [INFO] [stdout] 201 | | ... vec.push(var.clone()); [INFO] [stdout] | |____________________________________________^ help: consider using the `vec![]` macro: `let vec = vec![..];` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter/variable.rs:341:9 [INFO] [stdout] | [INFO] [stdout] 341 | return ast_vec; [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] 341 - return ast_vec; [INFO] [stdout] 341 + ast_vec [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter/interpreters.rs:237:5 [INFO] [stdout] | [INFO] [stdout] 237 | return (true, None); [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] 237 - return (true, None); [INFO] [stdout] 237 + (true, None) [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/interpreter/interpreters.rs:218:10 [INFO] [stdout] | [INFO] [stdout] 218 | ast: &Vec, [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] 218 - ast: &Vec, [INFO] [stdout] 218 + ast: &[asts::Types], [INFO] [stdout] | [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/interpreter/variable.rs:267:25 [INFO] [stdout] | [INFO] [stdout] 267 | / match function_call { [INFO] [stdout] 268 | | Some(call) => { [INFO] [stdout] 269 | | serch_result.push(call); [INFO] [stdout] 270 | | is_name_space_function = true; [INFO] [stdout] ... | [INFO] [stdout] 284 | | None => {} [INFO] [stdout] 285 | | } [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] 267 ~ if let Some(call) = function_call { [INFO] [stdout] 268 + serch_result.push(call); [INFO] [stdout] 269 + is_name_space_function = true; [INFO] [stdout] 270 + match var.node[0].clone() { [INFO] [stdout] 271 + asts::Types::Binary(bin) => match bin.node[0].clone() { [INFO] [stdout] 272 + asts::Types::Call(call) => { [INFO] [stdout] 273 + vec = self.variables_allocation( [INFO] [stdout] 274 + call.node.clone(), [INFO] [stdout] 275 + vec_function, [INFO] [stdout] 276 + ); [INFO] [stdout] 277 + } [INFO] [stdout] 278 + _ => {} [INFO] [stdout] 279 + }, [INFO] [stdout] 280 + _ => {} [INFO] [stdout] 281 + } [INFO] [stdout] 282 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter/interpreters.rs:256:5 [INFO] [stdout] | [INFO] [stdout] 256 | return result; [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] 256 - return result; [INFO] [stdout] 256 + result [INFO] [stdout] | [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/interpreter/variable.rs:271:33 [INFO] [stdout] | [INFO] [stdout] 271 | / ... match var.node[0].clone() { [INFO] [stdout] 272 | | ... asts::Types::Binary(bin) => match bin.node[0].clone() { [INFO] [stdout] 273 | | ... asts::Types::Call(call) => { [INFO] [stdout] 274 | | ... vec = self.variables_allocation( [INFO] [stdout] ... | [INFO] [stdout] 281 | | ... _ => {} [INFO] [stdout] 282 | | ... } [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] 271 ~ if let asts::Types::Binary(bin) = var.node[0].clone() { match bin.node[0].clone() { [INFO] [stdout] 272 + asts::Types::Call(call) => { [INFO] [stdout] 273 + vec = self.variables_allocation( [INFO] [stdout] 274 + call.node.clone(), [INFO] [stdout] 275 + vec_function, [INFO] [stdout] 276 + ); [INFO] [stdout] 277 + } [INFO] [stdout] 278 + _ => {} [INFO] [stdout] 279 + } } [INFO] [stdout] | [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/interpreter/variable.rs:272:65 [INFO] [stdout] | [INFO] [stdout] 272 | ... asts::Types::Binary(bin) => match bin.node[0].clone() { [INFO] [stdout] | ___________________________________________________^ [INFO] [stdout] 273 | | ... asts::Types::Call(call) => { [INFO] [stdout] 274 | | ... vec = self.variables_allocation( [INFO] [stdout] 275 | | ... call.node.clone(), [INFO] [stdout] ... | [INFO] [stdout] 279 | | ... _ => {} [INFO] [stdout] 280 | | ... }, [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] 272 ~ asts::Types::Binary(bin) => if let asts::Types::Call(call) = bin.node[0].clone() { [INFO] [stdout] 273 + vec = self.variables_allocation( [INFO] [stdout] 274 + call.node.clone(), [INFO] [stdout] 275 + vec_function, [INFO] [stdout] 276 + ); [INFO] [stdout] 277 ~ }, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter/arithmetic.rs:197:9 [INFO] [stdout] | [INFO] [stdout] 197 | return next_node; [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] 197 - return next_node; [INFO] [stdout] 197 + next_node [INFO] [stdout] | [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/interpreter/arithmetic.rs:20:13 [INFO] [stdout] | [INFO] [stdout] 20 | / match &next_node { [INFO] [stdout] 21 | | asts::Types::Binary(bin) => match self.comparison_operator(bin.op, &node) { [INFO] [stdout] 22 | | Some(num) => { [INFO] [stdout] 23 | | return asts::Types::Number(asts::NumberAST::new(num)); [INFO] [stdout] ... | [INFO] [stdout] 28 | | _ => {} [INFO] [stdout] 29 | | } [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] 20 ~ if let asts::Types::Binary(bin) = &next_node { match self.comparison_operator(bin.op, &node) { [INFO] [stdout] 21 + Some(num) => { [INFO] [stdout] 22 + return asts::Types::Number(asts::NumberAST::new(num)); [INFO] [stdout] 23 + } [INFO] [stdout] 24 + None => {} [INFO] [stdout] 25 + } } [INFO] [stdout] | [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/interpreter/arithmetic.rs:21:45 [INFO] [stdout] | [INFO] [stdout] 21 | asts::Types::Binary(bin) => match self.comparison_operator(bin.op, &node) { [INFO] [stdout] | _____________________________________________^ [INFO] [stdout] 22 | | Some(num) => { [INFO] [stdout] 23 | | return asts::Types::Number(asts::NumberAST::new(num)); [INFO] [stdout] ... | [INFO] [stdout] 26 | | }, [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] 21 ~ asts::Types::Binary(bin) => if let Some(num) = self.comparison_operator(bin.op, &node) { [INFO] [stdout] 22 + return asts::Types::Number(asts::NumberAST::new(num)); [INFO] [stdout] 23 ~ }, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Function` [INFO] [stdout] --> src/interpreter/function.rs:14:5 [INFO] [stdout] | [INFO] [stdout] 14 | / pub fn new() -> Function { [INFO] [stdout] 15 | | let mut fun = Function { [INFO] [stdout] 16 | | funcstions: Vec::new(), [INFO] [stdout] 17 | | inner: 0, [INFO] [stdout] ... | [INFO] [stdout] 21 | | return fun; [INFO] [stdout] 22 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 13 + impl Default for Function { [INFO] [stdout] 14 + fn default() -> Self { [INFO] [stdout] 15 + Self::new() [INFO] [stdout] 16 + } [INFO] [stdout] 17 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter/function.rs:21:9 [INFO] [stdout] | [INFO] [stdout] 21 | return fun; [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] 21 - return fun; [INFO] [stdout] 21 + fun [INFO] [stdout] | [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/interpreter/function.rs:54:13 [INFO] [stdout] | [INFO] [stdout] 54 | / match node { [INFO] [stdout] 55 | | asts::Types::Function(_) => { [INFO] [stdout] 56 | | self.funcstions[self.inner].push(node); [INFO] [stdout] ... | [INFO] [stdout] 59 | | } [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] 54 ~ if let asts::Types::Function(_) = node { [INFO] [stdout] 55 + self.funcstions[self.inner].push(node); [INFO] [stdout] 56 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter/function.rs:83:9 [INFO] [stdout] | [INFO] [stdout] 83 | return inner; [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] 83 - return inner; [INFO] [stdout] 83 + inner [INFO] [stdout] | [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/interpreter/function.rs:74:13 [INFO] [stdout] | [INFO] [stdout] 74 | / match node { [INFO] [stdout] 75 | | asts::Types::Function(_) => { [INFO] [stdout] 76 | | inner.push(node); [INFO] [stdout] ... | [INFO] [stdout] 79 | | } [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] 74 ~ if let asts::Types::Function(_) = node { [INFO] [stdout] 75 + inner.push(node); [INFO] [stdout] 76 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter/function.rs:140:9 [INFO] [stdout] | [INFO] [stdout] 140 | return None; [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] 140 - return None; [INFO] [stdout] 140 + None [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/interpreter/function.rs:99:67 [INFO] [stdout] | [INFO] [stdout] 99 | let (var_result, _) = variable.serch_variable(&var, self); [INFO] [stdout] | ^^^^ help: change this to: `var` [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/interpreter/function.rs:104:60 [INFO] [stdout] | [INFO] [stdout] 104 | let result = interpreters::calculation(&value, variable, self); [INFO] [stdout] | ^^^^^^ help: change this to: `value` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/interpreter/function.rs:109:36 [INFO] [stdout] | [INFO] [stdout] 109 | self.print_var(&value); [INFO] [stdout] | ^^^^^^ help: change this to: `value` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/interpreter/function.rs:130:25 [INFO] [stdout] | [INFO] [stdout] 130 | / if serch_string == fun.name { [INFO] [stdout] 131 | | return self.function(fun, &argument, variable); [INFO] [stdout] 132 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 129 ~ asts::Types::Function(fun) [INFO] [stdout] 130 ~ if serch_string == fun.name => { [INFO] [stdout] 131 | return self.function(fun, &argument, variable); [INFO] [stdout] 132 ~ } [INFO] [stdout] | [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/interpreter/function.rs:128:17 [INFO] [stdout] | [INFO] [stdout] 128 | / match fun { [INFO] [stdout] 129 | | asts::Types::Function(fun) => { [INFO] [stdout] 130 | | if serch_string == fun.name { [INFO] [stdout] 131 | | return self.function(fun, &argument, variable); [INFO] [stdout] ... | [INFO] [stdout] 135 | | _ => {} [INFO] [stdout] 136 | | } [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] 128 ~ if let asts::Types::Function(fun) = fun { [INFO] [stdout] 129 + if serch_string == fun.name { [INFO] [stdout] 130 + return self.function(fun, &argument, variable); [INFO] [stdout] 131 + } [INFO] [stdout] 132 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/interpreter/arithmetic.rs:85:16 [INFO] [stdout] | [INFO] [stdout] 85 | if strings.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `strings.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/interpreter/arithmetic.rs:110:13 [INFO] [stdout] | [INFO] [stdout] 110 | let result: bool; [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 `result` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 110 ~ [INFO] [stdout] 111 | [INFO] [stdout] 112 ~ let result: bool = if self.bin.node.len() == 3 { [INFO] [stdout] 113 ~ self.greater_than_equal(numbers[0], numbers[1]) [INFO] [stdout] 114 | } else { [INFO] [stdout] 115 ~ self.greater_than(numbers[0], numbers[1]) [INFO] [stdout] 116 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter/function.rs:212:9 [INFO] [stdout] | [INFO] [stdout] 212 | return result; [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] 212 - return result; [INFO] [stdout] 212 + result [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/interpreter/arithmetic.rs:129:13 [INFO] [stdout] | [INFO] [stdout] 129 | let result: bool; [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] help: move the declaration `result` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 129 ~ [INFO] [stdout] 130 | [INFO] [stdout] 131 ~ let result: bool = if self.bin.node.len() == 3 { [INFO] [stdout] 132 ~ self.less_than_equal(numbers[0], numbers[1]) [INFO] [stdout] 133 | } else { [INFO] [stdout] 134 ~ self.less_than(numbers[0], numbers[1]) [INFO] [stdout] 135 ~ }; [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/interpreter/function.rs:146:19 [INFO] [stdout] | [INFO] [stdout] 146 | argument: &Vec, [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] 146 - argument: &Vec, [INFO] [stdout] 146 + argument: &[asts::Types], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/interpreter/arithmetic.rs:153:16 [INFO] [stdout] | [INFO] [stdout] 153 | if strings.len() == 0 && self.bin.node.len() == 3 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `strings.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/interpreter/arithmetic.rs:176:16 [INFO] [stdout] | [INFO] [stdout] 176 | if strings.len() == 0 && self.bin.node.len() == 3 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `strings.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/interpreter/function.rs:189:49 [INFO] [stdout] | [INFO] [stdout] 189 | let err = error::Error::new(&function_argument); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: change this to: `function_argument` [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: the function `interpreters::scope` doesn't need a mutable reference [INFO] [stdout] --> src/interpreter/function.rs:197:47 [INFO] [stdout] | [INFO] [stdout] 197 | let (_, result) = interpreters::scope(&mut node, vec_variable, self); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed [INFO] [stdout] = note: `#[warn(clippy::unnecessary_mut_passed)]` on by default [INFO] [stdout] help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] 197 - let (_, result) = interpreters::scope(&mut node, vec_variable, self); [INFO] [stdout] 197 + let (_, result) = interpreters::scope(&node, vec_variable, self); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/interpreter/function.rs:197:47 [INFO] [stdout] | [INFO] [stdout] 197 | let (_, result) = interpreters::scope(&mut node, vec_variable, self); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `node` [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/interpreter/arithmetic.rs:720:9 [INFO] [stdout] | [INFO] [stdout] 720 | return numbers; [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] 720 - return numbers; [INFO] [stdout] 720 + numbers [INFO] [stdout] | [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/interpreter/function.rs:200:9 [INFO] [stdout] | [INFO] [stdout] 200 | / match &result { [INFO] [stdout] 201 | | Some(types_result) => { [INFO] [stdout] 202 | | let continu = self.type_inspection_retruns(&result_type, types_result); [INFO] [stdout] 203 | | if !continu { [INFO] [stdout] ... | [INFO] [stdout] 208 | | None => {} [INFO] [stdout] 209 | | } [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] 200 ~ if let Some(types_result) = &result { [INFO] [stdout] 201 + let continu = self.type_inspection_retruns(&result_type, types_result); [INFO] [stdout] 202 + if !continu { [INFO] [stdout] 203 + let err = error::Error::new(&function.argument.clone()[index - 1]); [INFO] [stdout] 204 + err.exit("argument type error"); [INFO] [stdout] 205 + } [INFO] [stdout] 206 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/interpreter/function.rs:227:45 [INFO] [stdout] | [INFO] [stdout] 227 | let err = error::Error::new(&var_result); [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `var_result` [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 seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/interpreter/arithmetic.rs:248:9 [INFO] [stdout] | [INFO] [stdout] 248 | / match node_first.clone() { [INFO] [stdout] 249 | | asts::Types::Binary(binary) => { [INFO] [stdout] 250 | | bin = binary.op; [INFO] [stdout] 251 | | let len = binary.node.len(); [INFO] [stdout] ... | [INFO] [stdout] 263 | | _ => {} [INFO] [stdout] 264 | | } [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] 248 ~ if let asts::Types::Binary(binary) = node_first.clone() { [INFO] [stdout] 249 + bin = binary.op; [INFO] [stdout] 250 + let len = binary.node.len(); [INFO] [stdout] 251 + [INFO] [stdout] 252 + if len == 1 { [INFO] [stdout] 253 + node_seccond = binary.node[0].clone(); [INFO] [stdout] 254 + } else if len >= 2 { [INFO] [stdout] 255 + comparison_node = binary.node[0].clone(); [INFO] [stdout] 256 + node_seccond = binary.node[1].clone(); [INFO] [stdout] 257 + } else { [INFO] [stdout] 258 + let err = error::Error::new(&node_first); [INFO] [stdout] 259 + err.exit("number operater error"); [INFO] [stdout] 260 + } [INFO] [stdout] 261 + } [INFO] [stdout] | [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/interpreter/function.rs:240:9 [INFO] [stdout] | [INFO] [stdout] 240 | / match argument_type { [INFO] [stdout] 241 | | asts::Types::Variable(var) => match var.types.clone() { [INFO] [stdout] 242 | | Some(types_var) => { [INFO] [stdout] 243 | | argument_types = types_var; [INFO] [stdout] ... | [INFO] [stdout] 248 | | _ => {} [INFO] [stdout] 249 | | } [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] 240 ~ if let asts::Types::Variable(var) = argument_type { match var.types.clone() { [INFO] [stdout] 241 + Some(types_var) => { [INFO] [stdout] 242 + argument_types = types_var; [INFO] [stdout] 243 + } [INFO] [stdout] 244 + _ => {} [INFO] [stdout] 245 + } } [INFO] [stdout] | [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/interpreter/function.rs:241:43 [INFO] [stdout] | [INFO] [stdout] 241 | asts::Types::Variable(var) => match var.types.clone() { [INFO] [stdout] | ___________________________________________^ [INFO] [stdout] 242 | | Some(types_var) => { [INFO] [stdout] 243 | | argument_types = types_var; [INFO] [stdout] ... | [INFO] [stdout] 246 | | }, [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] 241 ~ asts::Types::Variable(var) => if let Some(types_var) = var.types.clone() { [INFO] [stdout] 242 + argument_types = types_var; [INFO] [stdout] 243 ~ }, [INFO] [stdout] | [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/interpreter/function.rs:251:9 [INFO] [stdout] | [INFO] [stdout] 251 | / match types { [INFO] [stdout] 252 | | Some(t) => match t { [INFO] [stdout] 253 | | asts::VariableTypes::Bool => match argument_types { [INFO] [stdout] 254 | | asts::VariableTypes::Bool => { [INFO] [stdout] ... | [INFO] [stdout] 278 | | _ => {} [INFO] [stdout] 279 | | } [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] 251 ~ if let Some(t) = types { match t { [INFO] [stdout] 252 + asts::VariableTypes::Bool => match argument_types { [INFO] [stdout] 253 + asts::VariableTypes::Bool => { [INFO] [stdout] 254 + return true; [INFO] [stdout] 255 + } [INFO] [stdout] 256 + _ => {} [INFO] [stdout] 257 + }, [INFO] [stdout] 258 + asts::VariableTypes::Int => match argument_types { [INFO] [stdout] 259 + asts::VariableTypes::Int => { [INFO] [stdout] 260 + return true; [INFO] [stdout] 261 + } [INFO] [stdout] 262 + _ => {} [INFO] [stdout] 263 + }, [INFO] [stdout] 264 + asts::VariableTypes::Strings => match argument_types { [INFO] [stdout] 265 + asts::VariableTypes::Strings => { [INFO] [stdout] 266 + return true; [INFO] [stdout] 267 + } [INFO] [stdout] 268 + _ => {} [INFO] [stdout] 269 + }, [INFO] [stdout] 270 + [INFO] [stdout] 271 + _ => { [INFO] [stdout] 272 + let err = error::Error::new(argument_type); [INFO] [stdout] 273 + err.exit("argument_type"); [INFO] [stdout] 274 + } [INFO] [stdout] 275 + } } [INFO] [stdout] | [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/interpreter/function.rs:253:46 [INFO] [stdout] | [INFO] [stdout] 253 | asts::VariableTypes::Bool => match argument_types { [INFO] [stdout] | ______________________________________________^ [INFO] [stdout] 254 | | asts::VariableTypes::Bool => { [INFO] [stdout] 255 | | return true; [INFO] [stdout] ... | [INFO] [stdout] 258 | | }, [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] 253 ~ asts::VariableTypes::Bool => if let asts::VariableTypes::Bool = argument_types { [INFO] [stdout] 254 + return true; [INFO] [stdout] 255 ~ }, [INFO] [stdout] | [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/interpreter/function.rs:259:45 [INFO] [stdout] | [INFO] [stdout] 259 | asts::VariableTypes::Int => match argument_types { [INFO] [stdout] | _____________________________________________^ [INFO] [stdout] 260 | | asts::VariableTypes::Int => { [INFO] [stdout] 261 | | return true; [INFO] [stdout] ... | [INFO] [stdout] 264 | | }, [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] 259 ~ asts::VariableTypes::Int => if let asts::VariableTypes::Int = argument_types { [INFO] [stdout] 260 + return true; [INFO] [stdout] 261 ~ }, [INFO] [stdout] | [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/interpreter/function.rs:265:49 [INFO] [stdout] | [INFO] [stdout] 265 | asts::VariableTypes::Strings => match argument_types { [INFO] [stdout] | _________________________________________________^ [INFO] [stdout] 266 | | asts::VariableTypes::Strings => { [INFO] [stdout] 267 | | return true; [INFO] [stdout] ... | [INFO] [stdout] 270 | | }, [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] 265 ~ asts::VariableTypes::Strings => if let asts::VariableTypes::Strings = argument_types { [INFO] [stdout] 266 + return true; [INFO] [stdout] 267 ~ }, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/interpreter/arithmetic.rs:298:24 [INFO] [stdout] | [INFO] [stdout] 298 | if string_a.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!string_a.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/interpreter/function.rs:289:9 [INFO] [stdout] | [INFO] [stdout] 289 | / match types { [INFO] [stdout] 290 | | Some(t) => match t { [INFO] [stdout] 291 | | asts::VariableTypes::Bool => match argument_type { [INFO] [stdout] 292 | | asts::Types::Boolean(_) => { [INFO] [stdout] ... | [INFO] [stdout] 315 | | _ => {} [INFO] [stdout] 316 | | } [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] 289 ~ if let Some(t) = types { match t { [INFO] [stdout] 290 + asts::VariableTypes::Bool => match argument_type { [INFO] [stdout] 291 + asts::Types::Boolean(_) => { [INFO] [stdout] 292 + return true; [INFO] [stdout] 293 + } [INFO] [stdout] 294 + _ => {} [INFO] [stdout] 295 + }, [INFO] [stdout] 296 + asts::VariableTypes::Int => match argument_type { [INFO] [stdout] 297 + asts::Types::Number(_) => { [INFO] [stdout] 298 + return true; [INFO] [stdout] 299 + } [INFO] [stdout] 300 + _ => {} [INFO] [stdout] 301 + }, [INFO] [stdout] 302 + asts::VariableTypes::Strings => match argument_type { [INFO] [stdout] 303 + asts::Types::Strings(_) => { [INFO] [stdout] 304 + return true; [INFO] [stdout] 305 + } [INFO] [stdout] 306 + _ => {} [INFO] [stdout] 307 + }, [INFO] [stdout] 308 + [INFO] [stdout] 309 + _ => { [INFO] [stdout] 310 + let err = error::Error::new(argument_type); [INFO] [stdout] 311 + err.exit("argument_type"); [INFO] [stdout] 312 + } [INFO] [stdout] 313 + } } [INFO] [stdout] | [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/interpreter/function.rs:291:46 [INFO] [stdout] | [INFO] [stdout] 291 | asts::VariableTypes::Bool => match argument_type { [INFO] [stdout] | ______________________________________________^ [INFO] [stdout] 292 | | asts::Types::Boolean(_) => { [INFO] [stdout] 293 | | return true; [INFO] [stdout] ... | [INFO] [stdout] 296 | | }, [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] 291 ~ asts::VariableTypes::Bool => if let asts::Types::Boolean(_) = argument_type { [INFO] [stdout] 292 + return true; [INFO] [stdout] 293 ~ }, [INFO] [stdout] | [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/interpreter/function.rs:297:45 [INFO] [stdout] | [INFO] [stdout] 297 | asts::VariableTypes::Int => match argument_type { [INFO] [stdout] | _____________________________________________^ [INFO] [stdout] 298 | | asts::Types::Number(_) => { [INFO] [stdout] 299 | | return true; [INFO] [stdout] ... | [INFO] [stdout] 302 | | }, [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] 297 ~ asts::VariableTypes::Int => if let asts::Types::Number(_) = argument_type { [INFO] [stdout] 298 + return true; [INFO] [stdout] 299 ~ }, [INFO] [stdout] | [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/interpreter/function.rs:303:49 [INFO] [stdout] | [INFO] [stdout] 303 | asts::VariableTypes::Strings => match argument_type { [INFO] [stdout] | _________________________________________________^ [INFO] [stdout] 304 | | asts::Types::Strings(_) => { [INFO] [stdout] 305 | | return true; [INFO] [stdout] ... | [INFO] [stdout] 308 | | }, [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] 303 ~ asts::VariableTypes::Strings => if let asts::Types::Strings(_) = argument_type { [INFO] [stdout] 304 + return true; [INFO] [stdout] 305 ~ }, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/interpreter/arithmetic.rs:366:32 [INFO] [stdout] | [INFO] [stdout] 366 | ... if string_a.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!string_a.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/interpreter/arithmetic.rs:397:32 [INFO] [stdout] | [INFO] [stdout] 397 | ... if string_a.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!string_a.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/interpreter/arithmetic.rs:430:21 [INFO] [stdout] | [INFO] [stdout] 430 | / match comparison_node { [INFO] [stdout] 431 | | asts::Types::Binary(_) => { [INFO] [stdout] 432 | | binarys.node.push(comparison_node); [INFO] [stdout] ... | [INFO] [stdout] 435 | | } [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] 430 ~ if let asts::Types::Binary(_) = comparison_node { [INFO] [stdout] 431 + binarys.node.push(comparison_node); [INFO] [stdout] 432 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/interpreter/arithmetic.rs:450:32 [INFO] [stdout] | [INFO] [stdout] 450 | ... if string_a.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!string_a.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/interpreter/arithmetic.rs:481:32 [INFO] [stdout] | [INFO] [stdout] 481 | ... if string_a.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!string_a.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Compile` [INFO] [stdout] --> src/compiler/to_c.rs:20:3 [INFO] [stdout] | [INFO] [stdout] 20 | / pub fn new() -> Compile { [INFO] [stdout] 21 | | fs::create_dir_all("./build").expect("dir create failed"); [INFO] [stdout] 22 | | let file = fs::File::create("./build/build.c").expect("create failed"); [INFO] [stdout] 23 | | let vairables = variable::Vriables::new(); [INFO] [stdout] ... | [INFO] [stdout] 33 | | } [INFO] [stdout] | |___^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 19 + impl Default for Compile { [INFO] [stdout] 20 + fn default() -> Self { [INFO] [stdout] 21 + Self::new() [INFO] [stdout] 22 + } [INFO] [stdout] 23 + } [INFO] [stdout] | [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/interpreter/arithmetic.rs:613:21 [INFO] [stdout] | [INFO] [stdout] 613 | / match comparison_node { [INFO] [stdout] 614 | | asts::Types::Binary(_) => match numbers.clone() { [INFO] [stdout] 615 | | asts::Types::Strings(_) => { [INFO] [stdout] 616 | | let result = self.equivalence_string(&string_a, string_b); [INFO] [stdout] ... | [INFO] [stdout] 651 | | _ => {} [INFO] [stdout] 652 | | } [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] 613 ~ if let asts::Types::Binary(_) = comparison_node { match numbers.clone() { [INFO] [stdout] 614 + asts::Types::Strings(_) => { [INFO] [stdout] 615 + let result = self.equivalence_string(&string_a, string_b); [INFO] [stdout] 616 + let equivalence_string_result = [INFO] [stdout] 617 + asts::Types::Boolean(asts::BooleanAST::new(result)); [INFO] [stdout] 618 + return self.calculations_continue( [INFO] [stdout] 619 + string.node, [INFO] [stdout] 620 + equivalence_string_result, [INFO] [stdout] 621 + select_binary, [INFO] [stdout] 622 + ); [INFO] [stdout] 623 + } [INFO] [stdout] 624 + [INFO] [stdout] 625 + asts::Types::Number(_) => { [INFO] [stdout] 626 + let result = [INFO] [stdout] 627 + self.equivalence_string(&number_a.to_string(), string_b); [INFO] [stdout] 628 + let equivalence_string_result = [INFO] [stdout] 629 + asts::Types::Boolean(asts::BooleanAST::new(result)); [INFO] [stdout] 630 + return self.calculations_continue( [INFO] [stdout] 631 + string.node, [INFO] [stdout] 632 + equivalence_string_result, [INFO] [stdout] 633 + select_binary, [INFO] [stdout] 634 + ); [INFO] [stdout] 635 + } [INFO] [stdout] 636 + [INFO] [stdout] 637 + asts::Types::Boolean(_) => { [INFO] [stdout] 638 + let result = self.equivalence_string(&bool_a.to_string(), string_b); [INFO] [stdout] 639 + let equivalence_string_result = [INFO] [stdout] 640 + asts::Types::Boolean(asts::BooleanAST::new(result)); [INFO] [stdout] 641 + return self.calculations_continue( [INFO] [stdout] 642 + string.node, [INFO] [stdout] 643 + equivalence_string_result, [INFO] [stdout] 644 + select_binary, [INFO] [stdout] 645 + ); [INFO] [stdout] 646 + } [INFO] [stdout] 647 + [INFO] [stdout] 648 + _ => {} [INFO] [stdout] 649 + } } [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/compiler/to_c.rs:67:39 [INFO] [stdout] | [INFO] [stdout] 67 | pub(crate) fn scope(&mut self, ast: &Vec) { [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] 67 - pub(crate) fn scope(&mut self, ast: &Vec) { [INFO] [stdout] 67 + pub(crate) fn scope(&mut self, ast: &[asts::Types]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/compiler/to_c.rs:123:9 [INFO] [stdout] | [INFO] [stdout] 123 | return; [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] 122 - _ => { [INFO] [stdout] 123 - return; [INFO] [stdout] 122 + _ => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/compiler/to_c.rs:109:25 [INFO] [stdout] | [INFO] [stdout] 109 | self.fors_write(&fors); [INFO] [stdout] | ^^^^^ help: change this to: `fors` [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: useless use of `format!` [INFO] [stdout] --> src/compiler/function.rs:25:36 [INFO] [stdout] | [INFO] [stdout] 25 | values.push_str(&format!("{}", &var.name)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `(&var.name).to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/interpreter/arithmetic.rs:656:21 [INFO] [stdout] | [INFO] [stdout] 656 | / match comparison_node { [INFO] [stdout] 657 | | asts::Types::Binary(_) => match numbers.clone() { [INFO] [stdout] 658 | | asts::Types::Strings(_) => { [INFO] [stdout] 659 | | let result = self.inequality_string(&string_a, string_b); [INFO] [stdout] ... | [INFO] [stdout] 694 | | _ => {} [INFO] [stdout] 695 | | } [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] 656 ~ if let asts::Types::Binary(_) = comparison_node { match numbers.clone() { [INFO] [stdout] 657 + asts::Types::Strings(_) => { [INFO] [stdout] 658 + let result = self.inequality_string(&string_a, string_b); [INFO] [stdout] 659 + let inequality_string_result = [INFO] [stdout] 660 + asts::Types::Boolean(asts::BooleanAST::new(result)); [INFO] [stdout] 661 + return self.calculations_continue( [INFO] [stdout] 662 + string.node, [INFO] [stdout] 663 + inequality_string_result, [INFO] [stdout] 664 + select_binary, [INFO] [stdout] 665 + ); [INFO] [stdout] 666 + } [INFO] [stdout] 667 + [INFO] [stdout] 668 + asts::Types::Number(_) => { [INFO] [stdout] 669 + let result = [INFO] [stdout] 670 + self.inequality_string(&number_a.to_string(), string_b); [INFO] [stdout] 671 + let inequality_string_result = [INFO] [stdout] 672 + asts::Types::Boolean(asts::BooleanAST::new(result)); [INFO] [stdout] 673 + return self.calculations_continue( [INFO] [stdout] 674 + string.node, [INFO] [stdout] 675 + inequality_string_result, [INFO] [stdout] 676 + select_binary, [INFO] [stdout] 677 + ); [INFO] [stdout] 678 + } [INFO] [stdout] 679 + [INFO] [stdout] 680 + asts::Types::Boolean(_) => { [INFO] [stdout] 681 + let result = self.inequality_string(&bool_a.to_string(), string_b); [INFO] [stdout] 682 + let inequality_string_result = [INFO] [stdout] 683 + asts::Types::Boolean(asts::BooleanAST::new(result)); [INFO] [stdout] 684 + return self.calculations_continue( [INFO] [stdout] 685 + string.node, [INFO] [stdout] 686 + inequality_string_result, [INFO] [stdout] 687 + select_binary, [INFO] [stdout] 688 + ); [INFO] [stdout] 689 + } [INFO] [stdout] 690 + [INFO] [stdout] 691 + _ => {} [INFO] [stdout] 692 + } } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/compiler/function.rs:36:36 [INFO] [stdout] | [INFO] [stdout] 36 | values.push_str(&format!("{}", &var.name)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `(&var.name).to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [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/interpreter/arithmetic.rs:700:25 [INFO] [stdout] | [INFO] [stdout] 700 | / match comparison_node { [INFO] [stdout] 701 | | asts::Types::Binary(_) => { [INFO] [stdout] 702 | | binarys.node.push(comparison_node); [INFO] [stdout] ... | [INFO] [stdout] 705 | | } [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] 700 ~ if let asts::Types::Binary(_) = comparison_node { [INFO] [stdout] 701 + binarys.node.push(comparison_node); [INFO] [stdout] 702 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/compiler/function.rs:67:11 [INFO] [stdout] | [INFO] [stdout] 67 | values.push_str("\""); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `values.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] = note: `#[warn(clippy::single_char_add_str)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter/arithmetic.rs:737:17 [INFO] [stdout] | [INFO] [stdout] 737 | return number_result; [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] 737 - return number_result; [INFO] [stdout] 737 + number_result [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/compiler/function.rs:78:50 [INFO] [stdout] | [INFO] [stdout] 78 | pub(crate) fn function_write(&mut self, nodes: &Vec) { [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] 78 - pub(crate) fn function_write(&mut self, nodes: &Vec) { [INFO] [stdout] 78 + pub(crate) fn function_write(&mut self, nodes: &[asts::Types]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter/arithmetic.rs:743:17 [INFO] [stdout] | [INFO] [stdout] 743 | return bools_result; [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] 743 - return bools_result; [INFO] [stdout] 743 + bools_result [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter/arithmetic.rs:750:17 [INFO] [stdout] | [INFO] [stdout] 750 | return strings_result; [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] 750 - return strings_result; [INFO] [stdout] 750 + strings_result [INFO] [stdout] | [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/compiler/function.rs:87:41 [INFO] [stdout] | [INFO] [stdout] 87 | asts::Types::Import(imports) => match &imports.path[0] { [INFO] [stdout] | _________________________________________^ [INFO] [stdout] 88 | | asts::Types::Strings(strings) => { [INFO] [stdout] 89 | | self.variable.vec_push(); [INFO] [stdout] 90 | | let result = interpreter::interpreters::read_file(&strings.name); [INFO] [stdout] ... | [INFO] [stdout] 98 | | _ => {} [INFO] [stdout] 99 | | }, [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] 87 ~ asts::Types::Import(imports) => if let asts::Types::Strings(strings) = &imports.path[0] { [INFO] [stdout] 88 + self.variable.vec_push(); [INFO] [stdout] 89 + let result = interpreter::interpreters::read_file(&strings.name); [INFO] [stdout] 90 + let name: Vec<&str> = strings.name.split('.').collect(); [INFO] [stdout] 91 + let name: Vec<&str> = name[name.len() - 2].split('/').collect(); [INFO] [stdout] 92 + self.to_import(&name[2]); [INFO] [stdout] 93 + self.function_write(&result.node); [INFO] [stdout] 94 + self.variable.last_remove(); [INFO] [stdout] 95 + self.to_import(""); [INFO] [stdout] 96 ~ }, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter/arithmetic.rs:786:9 [INFO] [stdout] | [INFO] [stdout] 786 | return (numbers, types); [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] 786 - return (numbers, types); [INFO] [stdout] 786 + (numbers, types) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/compiler/function.rs:93:28 [INFO] [stdout] | [INFO] [stdout] 93 | self.to_import(&name[2]); [INFO] [stdout] | ^^^^^^^^ help: change this to: `name[2]` [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: comparison to empty slice [INFO] [stdout] --> src/compiler/function.rs:104:16 [INFO] [stdout] | [INFO] [stdout] 104 | if self.import == "" { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.import.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] = note: `#[warn(clippy::comparison_to_empty)]` 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/compiler/function.rs:105:54 [INFO] [stdout] | [INFO] [stdout] 105 | let mut types = Types::new(&funs.name, &f); [INFO] [stdout] | ^^ help: change this to: `f` [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/interpreter/arithmetic.rs:845:9 [INFO] [stdout] | [INFO] [stdout] 845 | return (numbers, strings, types); [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] 845 - return (numbers, strings, types); [INFO] [stdout] 845 + (numbers, strings, types) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/compiler/function.rs:107:30 [INFO] [stdout] | [INFO] [stdout] 107 | self.functions(&f, &funs, &mut types, &funs.name); [INFO] [stdout] | ^^ help: change this to: `f` [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: length comparison to zero [INFO] [stdout] --> src/interpreter/arithmetic.rs:816:20 [INFO] [stdout] | [INFO] [stdout] 816 | if strings.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `strings.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/compiler/function.rs:111:53 [INFO] [stdout] | [INFO] [stdout] 111 | let mut types = Types::new(funs_name, &f); [INFO] [stdout] | ^^ help: change this to: `f` [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: length comparison to zero [INFO] [stdout] --> src/interpreter/arithmetic.rs:828:20 [INFO] [stdout] | [INFO] [stdout] 828 | if numbers.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!numbers.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/compiler/function.rs:113:30 [INFO] [stdout] | [INFO] [stdout] 113 | self.functions(&f, &funs, &mut types, funs_name); [INFO] [stdout] | ^^ help: change this to: `f` [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: comparison to empty slice [INFO] [stdout] --> src/compiler/function.rs:122:17 [INFO] [stdout] | [INFO] [stdout] 122 | if self.import == "" { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.import.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter/arithmetic.rs:865:9 [INFO] [stdout] | [INFO] [stdout] 865 | return None; [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] 865 - return None; [INFO] [stdout] 865 + None [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/interpreter/arithmetic.rs:861:45 [INFO] [stdout] | [INFO] [stdout] 861 | let err = error::Error::new(&number); [INFO] [stdout] | ^^^^^^^ help: change this to: `number` [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/interpreter/arithmetic.rs:901:9 [INFO] [stdout] | [INFO] [stdout] 901 | return ast_retruns; [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] 901 - return ast_retruns; [INFO] [stdout] 901 + ast_retruns [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/compiler/function.rs:243:26 [INFO] [stdout] | [INFO] [stdout] 243 | self.calcuration(&bin, "tmp"); [INFO] [stdout] | ^^^^ help: change this to: `bin` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/interpreter/fors.rs:13:25 [INFO] [stdout] | [INFO] [stdout] 13 | pub fn new(ast_for: &Vec, ast: &Vec) -> For { [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] 13 ~ pub fn new(ast_for: &[asts::Types], ast: &Vec) -> For { [INFO] [stdout] 14 ~ let ast_for = ast_for.to_owned(); [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/interpreter/fors.rs:13:49 [INFO] [stdout] | [INFO] [stdout] 13 | pub fn new(ast_for: &Vec, ast: &Vec) -> For { [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] 13 ~ pub fn new(ast_for: &Vec, ast: &[asts::Types]) -> For { [INFO] [stdout] 14 | let ast_for = ast_for.clone(); [INFO] [stdout] 15 ~ let ast = ast.to_owned(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` can be collapsed into the outer `match` [INFO] [stdout] --> src/compiler/function.rs:272:20 [INFO] [stdout] | [INFO] [stdout] 272 | Some(t) => match t { [INFO] [stdout] | ____________________^ [INFO] [stdout] 273 | | asts::VariableTypes::Bool => { [INFO] [stdout] 274 | | if bools.boolean == true { [INFO] [stdout] 275 | | self.write("1"); [INFO] [stdout] ... | [INFO] [stdout] 284 | | }, [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/compiler/function.rs:272:14 [INFO] [stdout] | [INFO] [stdout] 272 | Some(t) => match t { [INFO] [stdout] | ^ replace this binding [INFO] [stdout] 273 | asts::VariableTypes::Bool => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ with this pattern [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter/fors.rs:107:9 [INFO] [stdout] | [INFO] [stdout] 107 | return None; [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] 107 - return None; [INFO] [stdout] 107 + None [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against true are unnecessary [INFO] [stdout] --> src/compiler/function.rs:274:16 [INFO] [stdout] | [INFO] [stdout] 274 | if bools.boolean == true { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `bools.boolean` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_comparison)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` can be collapsed into the outer `match` [INFO] [stdout] --> src/compiler/function.rs:292:20 [INFO] [stdout] | [INFO] [stdout] 292 | Some(t) => match t { [INFO] [stdout] | ____________________^ [INFO] [stdout] 293 | | asts::VariableTypes::Strings => { [INFO] [stdout] 294 | | self.write(&strings.name); [INFO] [stdout] ... | [INFO] [stdout] 300 | | }, [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/compiler/function.rs:292:14 [INFO] [stdout] | [INFO] [stdout] 292 | Some(t) => match t { [INFO] [stdout] | ^ replace this binding [INFO] [stdout] 293 | asts::VariableTypes::Strings => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ with this pattern [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter/fors.rs:157:9 [INFO] [stdout] | [INFO] [stdout] 157 | return ast_vec; [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] 157 - return ast_vec; [INFO] [stdout] 157 + ast_vec [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` can be collapsed into the outer `match` [INFO] [stdout] --> src/compiler/function.rs:358:20 [INFO] [stdout] | [INFO] [stdout] 358 | Some(t) => match t { [INFO] [stdout] | ____________________^ [INFO] [stdout] 359 | | asts::VariableTypes::Int => { [INFO] [stdout] 360 | | self.write(&num.val.to_string()); [INFO] [stdout] ... | [INFO] [stdout] 366 | | }, [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/compiler/function.rs:358:14 [INFO] [stdout] | [INFO] [stdout] 358 | Some(t) => match t { [INFO] [stdout] | ^ replace this binding [INFO] [stdout] 359 | asts::VariableTypes::Int => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ with this pattern [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/interpreter/fors.rs:148:57 [INFO] [stdout] | [INFO] [stdout] 148 | ... let err = error::Error::new(&result); [INFO] [stdout] | ^^^^^^^ help: change this to: `result` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/compiler/function.rs:382:51 [INFO] [stdout] | [INFO] [stdout] 382 | pub(crate) fn argment_write(&mut self, argment: &Vec, callee: &str) { [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] 382 - pub(crate) fn argment_write(&mut self, argment: &Vec, callee: &str) { [INFO] [stdout] 382 + pub(crate) fn argment_write(&mut self, argment: &[asts::Types], callee: &str) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/compiler/function.rs:383:8 [INFO] [stdout] | [INFO] [stdout] 383 | if argment.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `argment.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: parameter is only used in recursion [INFO] [stdout] --> src/interpreter/fors.rs:112:9 [INFO] [stdout] | [INFO] [stdout] 112 | name: &str, [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_name` [INFO] [stdout] | [INFO] [stdout] note: parameter used here [INFO] [stdout] --> src/interpreter/fors.rs:121:54 [INFO] [stdout] | [INFO] [stdout] 121 | let vec = self.for_variables(name, result, bin.node.clone()); [INFO] [stdout] | ^^^^ [INFO] [stdout] ... [INFO] [stdout] 129 | let vec = self.for_variables(name, result, num.node.clone()); [INFO] [stdout] | ^^^^ [INFO] [stdout] ... [INFO] [stdout] 139 | vec = self.for_variables(name, result, var.node.clone()); [INFO] [stdout] | ^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#only_used_in_recursion [INFO] [stdout] = note: `#[warn(clippy::only_used_in_recursion)]` 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/interpreter/ifs.rs:12:43 [INFO] [stdout] | [INFO] [stdout] 12 | pub fn new(result: &asts::Types, ifs: &Vec) -> If { [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] 12 ~ pub fn new(result: &asts::Types, ifs: &[asts::Types]) -> If { [INFO] [stdout] 13 | If{ [INFO] [stdout] 14 | result: result.clone(), [INFO] [stdout] 15 ~ ifs: ifs.to_owned() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` can be collapsed into the outer `match` [INFO] [stdout] --> src/compiler/function.rs:395:24 [INFO] [stdout] | [INFO] [stdout] 395 | Some(t) => match t { [INFO] [stdout] | ________________________^ [INFO] [stdout] 396 | | _param_types => {} [INFO] [stdout] 397 | | [INFO] [stdout] 398 | | _ => { [INFO] [stdout] ... | [INFO] [stdout] 402 | | }, [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/compiler/function.rs:395:18 [INFO] [stdout] | [INFO] [stdout] 395 | Some(t) => match t { [INFO] [stdout] | ^ replace this binding [INFO] [stdout] 396 | _param_types => {} [INFO] [stdout] | ^^^^^^^^^^^^ with this pattern [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter/ifs.rs:33:9 [INFO] [stdout] | [INFO] [stdout] 33 | return None; [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] 33 - return None; [INFO] [stdout] 33 + None [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/interpreter/ifs.rs:26:17 [INFO] [stdout] | [INFO] [stdout] 26 | / if boolean.boolean { [INFO] [stdout] 27 | | let (_, result) = interpreters::scope(&self.ifs, vec_variable, vec_function); [INFO] [stdout] 28 | | return result; [INFO] [stdout] 29 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 25 ~ asts::Types::Boolean(boolean) [INFO] [stdout] 26 ~ if boolean.boolean => { [INFO] [stdout] 27 | let (_, result) = interpreters::scope(&self.ifs, vec_variable, vec_function); [INFO] [stdout] 28 | return result; [INFO] [stdout] 29 ~ } [INFO] [stdout] | [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/interpreter/ifs.rs:24:9 [INFO] [stdout] | [INFO] [stdout] 24 | / match self.result { [INFO] [stdout] 25 | | asts::Types::Boolean(boolean) => { [INFO] [stdout] 26 | | if boolean.boolean { [INFO] [stdout] 27 | | let (_, result) = interpreters::scope(&self.ifs, vec_variable, vec_function); [INFO] [stdout] ... | [INFO] [stdout] 31 | | _ => {} [INFO] [stdout] 32 | | } [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] 24 ~ if let asts::Types::Boolean(boolean) = self.result { [INFO] [stdout] 25 + if boolean.boolean { [INFO] [stdout] 26 + let (_, result) = interpreters::scope(&self.ifs, vec_variable, vec_function); [INFO] [stdout] 27 + return result; [INFO] [stdout] 28 + } [INFO] [stdout] 29 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/compiler/function.rs:429:27 [INFO] [stdout] | [INFO] [stdout] 429 | self.call_write(&call); [INFO] [stdout] | ^^^^^ help: change this to: `call` [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 should consider adding a `Default` implementation for `Variable` [INFO] [stdout] --> src/interpreter/variable.rs:13:5 [INFO] [stdout] | [INFO] [stdout] 13 | / pub fn new() -> Variable { [INFO] [stdout] 14 | | let mut var = Variable { [INFO] [stdout] 15 | | variables: Vec::new(), [INFO] [stdout] 16 | | inner: 0, [INFO] [stdout] ... | [INFO] [stdout] 20 | | return var; [INFO] [stdout] 21 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 12 + impl Default for Variable { [INFO] [stdout] 13 + fn default() -> Self { [INFO] [stdout] 14 + Self::new() [INFO] [stdout] 15 + } [INFO] [stdout] 16 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter/variable.rs:20:9 [INFO] [stdout] | [INFO] [stdout] 20 | return var; [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] 20 - return var; [INFO] [stdout] 20 + var [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/compiler/function.rs:453:8 [INFO] [stdout] | [INFO] [stdout] 453 | if self.import != ""{ [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.import.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/compiler/function.rs:461:48 [INFO] [stdout] | [INFO] [stdout] 461 | let mut call_var = self.type_write(&t, &var_name, &asts::Types::Call(call.clone())); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `var_name` [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/interpreter/variable.rs:130:9 [INFO] [stdout] | [INFO] [stdout] 130 | return Some(calcu); [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] 130 - return Some(calcu); [INFO] [stdout] 130 + Some(calcu) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/compiler/function.rs:463:9 [INFO] [stdout] | [INFO] [stdout] 463 | call_var.push_str("("); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `call_var.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 if-then-else expression assigns a bool literal [INFO] [stdout] --> src/compiler/variable.rs:36:5 [INFO] [stdout] | [INFO] [stdout] 36 | / if self.change { [INFO] [stdout] 37 | | self.change = false; [INFO] [stdout] 38 | | } else { [INFO] [stdout] 39 | | self.change = true; [INFO] [stdout] 40 | | } [INFO] [stdout] | |_____^ help: you can reduce it to: `self.change = !self.change;` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool_assign [INFO] [stdout] = note: `#[warn(clippy::needless_bool_assign)]` 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/interpreter/variable.rs:115:62 [INFO] [stdout] | [INFO] [stdout] 115 | let (serch, _) = self.serch_variable(&var, vec_function); [INFO] [stdout] | ^^^^ help: change this to: `var` [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/interpreter/variable.rs:229:9 [INFO] [stdout] | [INFO] [stdout] 229 | return (variable_retrun, is_mutable); [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] 229 - return (variable_retrun, is_mutable); [INFO] [stdout] 229 + (variable_retrun, is_mutable) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Vriables` [INFO] [stdout] --> src/compiler/variable.rs:51:3 [INFO] [stdout] | [INFO] [stdout] 51 | / pub fn new() -> Vriables { [INFO] [stdout] 52 | | let mut var = Vriables { [INFO] [stdout] 53 | | variables: Vec::new(), [INFO] [stdout] 54 | | inner: 0, [INFO] [stdout] ... | [INFO] [stdout] 58 | | return var; [INFO] [stdout] 59 | | } [INFO] [stdout] | |___^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 50 + impl Default for Vriables { [INFO] [stdout] 51 + fn default() -> Self { [INFO] [stdout] 52 + Self::new() [INFO] [stdout] 53 + } [INFO] [stdout] 54 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/compiler/variable.rs:58:5 [INFO] [stdout] | [INFO] [stdout] 58 | return var; [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] 58 - return var; [INFO] [stdout] 58 + var [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/compiler/variable.rs:74:5 [INFO] [stdout] | [INFO] [stdout] 74 | return address; [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] 74 - return address; [INFO] [stdout] 74 + address [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calls to `push` immediately after creation [INFO] [stdout] --> src/interpreter/variable.rs:171:37 [INFO] [stdout] | [INFO] [stdout] 171 | / ... let mut vec = Vec::new(); [INFO] [stdout] 172 | | ... vec.push(somes); [INFO] [stdout] | |______________________________________^ help: consider using the `vec![]` macro: `let vec = vec![..];` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/compiler/variable.rs:112:5 [INFO] [stdout] | [INFO] [stdout] 112 | return (None, Vec::new(), false); [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] 112 - return (None, Vec::new(), false); [INFO] [stdout] 112 + (None, Vec::new(), false) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calls to `push` immediately after creation [INFO] [stdout] --> src/interpreter/variable.rs:188:37 [INFO] [stdout] | [INFO] [stdout] 188 | / ... let mut vec = Vec::new(); [INFO] [stdout] 189 | | ... vec.push(var.clone()); [INFO] [stdout] | |____________________________________________^ help: consider using the `vec![]` macro: `let vec = vec![..];` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calls to `push` immediately after creation [INFO] [stdout] --> src/interpreter/variable.rs:200:45 [INFO] [stdout] | [INFO] [stdout] 200 | / ... let mut vec = Vec::new(); [INFO] [stdout] 201 | | ... vec.push(var.clone()); [INFO] [stdout] | |____________________________________________^ help: consider using the `vec![]` macro: `let vec = vec![..];` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/compiler/variable.rs:190:11 [INFO] [stdout] | [INFO] [stdout] 190 | return; [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] 189 - } [INFO] [stdout] 190 - return; [INFO] [stdout] 189 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter/variable.rs:341:9 [INFO] [stdout] | [INFO] [stdout] 341 | return ast_vec; [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] 341 - return ast_vec; [INFO] [stdout] 341 + ast_vec [INFO] [stdout] | [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/compiler/variable.rs:121:9 [INFO] [stdout] | [INFO] [stdout] 121 | / match &var.index { [INFO] [stdout] 122 | | Some(i) => { [INFO] [stdout] 123 | | let sertch_type = self.variable.sertch_type(&var.name).0; [INFO] [stdout] 124 | | match sertch_type { [INFO] [stdout] ... | [INFO] [stdout] 153 | | None => {} [INFO] [stdout] 154 | | } [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] 121 ~ if let Some(i) = &var.index { [INFO] [stdout] 122 + let sertch_type = self.variable.sertch_type(&var.name).0; [INFO] [stdout] 123 + match sertch_type { [INFO] [stdout] 124 + Some(t) => { [INFO] [stdout] 125 + let mut var_tmp = [INFO] [stdout] 126 + self.type_write(&t, &var_name, &asts::Types::Variable(var.clone())); [INFO] [stdout] 127 + var_tmp.push_str(&var.name); [INFO] [stdout] 128 + var_tmp.push_str("["); [INFO] [stdout] 129 + match &i[0] { [INFO] [stdout] 130 + asts::Types::Number(num) => { [INFO] [stdout] 131 + var_tmp.push_str(&num.val.to_string()); [INFO] [stdout] 132 + } [INFO] [stdout] 133 + [INFO] [stdout] 134 + _ => { [INFO] [stdout] 135 + let err = error::Error::new(&var.node[0]); [INFO] [stdout] 136 + err.exit("variable error"); [INFO] [stdout] 137 + } [INFO] [stdout] 138 + } [INFO] [stdout] 139 + self.write(&var_tmp); [INFO] [stdout] 140 + self.write("];"); [INFO] [stdout] 141 + return; [INFO] [stdout] 142 + } [INFO] [stdout] 143 + [INFO] [stdout] 144 + None => { [INFO] [stdout] 145 + let err = error::Error::new(&var.node[0]); [INFO] [stdout] 146 + err.exit("variable error"); [INFO] [stdout] 147 + } [INFO] [stdout] 148 + } [INFO] [stdout] 149 + return; [INFO] [stdout] 150 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/compiler/variable.rs:127:39 [INFO] [stdout] | [INFO] [stdout] 127 | self.type_write(&t, &var_name, &asts::Types::Variable(var.clone())); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `var_name` [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/compiler/variable.rs:129:17 [INFO] [stdout] | [INFO] [stdout] 129 | var_tmp.push_str("["); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `var_tmp.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: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/interpreter/variable.rs:267:25 [INFO] [stdout] | [INFO] [stdout] 267 | / match function_call { [INFO] [stdout] 268 | | Some(call) => { [INFO] [stdout] 269 | | serch_result.push(call); [INFO] [stdout] 270 | | is_name_space_function = true; [INFO] [stdout] ... | [INFO] [stdout] 284 | | None => {} [INFO] [stdout] 285 | | } [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] 267 ~ if let Some(call) = function_call { [INFO] [stdout] 268 + serch_result.push(call); [INFO] [stdout] 269 + is_name_space_function = true; [INFO] [stdout] 270 + match var.node[0].clone() { [INFO] [stdout] 271 + asts::Types::Binary(bin) => match bin.node[0].clone() { [INFO] [stdout] 272 + asts::Types::Call(call) => { [INFO] [stdout] 273 + vec = self.variables_allocation( [INFO] [stdout] 274 + call.node.clone(), [INFO] [stdout] 275 + vec_function, [INFO] [stdout] 276 + ); [INFO] [stdout] 277 + } [INFO] [stdout] 278 + _ => {} [INFO] [stdout] 279 + }, [INFO] [stdout] 280 + _ => {} [INFO] [stdout] 281 + } [INFO] [stdout] 282 + } [INFO] [stdout] | [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/interpreter/variable.rs:271:33 [INFO] [stdout] | [INFO] [stdout] 271 | / ... match var.node[0].clone() { [INFO] [stdout] 272 | | ... asts::Types::Binary(bin) => match bin.node[0].clone() { [INFO] [stdout] 273 | | ... asts::Types::Call(call) => { [INFO] [stdout] 274 | | ... vec = self.variables_allocation( [INFO] [stdout] ... | [INFO] [stdout] 281 | | ... _ => {} [INFO] [stdout] 282 | | ... } [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] 271 ~ if let asts::Types::Binary(bin) = var.node[0].clone() { match bin.node[0].clone() { [INFO] [stdout] 272 + asts::Types::Call(call) => { [INFO] [stdout] 273 + vec = self.variables_allocation( [INFO] [stdout] 274 + call.node.clone(), [INFO] [stdout] 275 + vec_function, [INFO] [stdout] 276 + ); [INFO] [stdout] 277 + } [INFO] [stdout] 278 + _ => {} [INFO] [stdout] 279 + } } [INFO] [stdout] | [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/compiler/variable.rs:171:11 [INFO] [stdout] | [INFO] [stdout] 171 | / match &var.node[0] { [INFO] [stdout] 172 | | asts::Types::Binary(bin) => { [INFO] [stdout] 173 | | if bin.op == '.' { [INFO] [stdout] 174 | | match &bin.node[0] { [INFO] [stdout] ... | [INFO] [stdout] 188 | | _ => {} [INFO] [stdout] 189 | | } [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] 171 ~ if let asts::Types::Binary(bin) = &var.node[0] { [INFO] [stdout] 172 + if bin.op == '.' { [INFO] [stdout] 173 + match &bin.node[0] { [INFO] [stdout] 174 + asts::Types::Call(call) => { [INFO] [stdout] 175 + let call_name = &format!("import_{}_{}", var.name, call.callee); [INFO] [stdout] 176 + self.var_call_write(call, var_name, call_name, var); [INFO] [stdout] 177 + } [INFO] [stdout] 178 + [INFO] [stdout] 179 + _ => {} [INFO] [stdout] 180 + } [INFO] [stdout] 181 + } else { [INFO] [stdout] 182 + let err = error::Error::new(&var.node[0]); [INFO] [stdout] 183 + err.exit("variable error"); [INFO] [stdout] 184 + } [INFO] [stdout] 185 + } [INFO] [stdout] | [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/interpreter/variable.rs:272:65 [INFO] [stdout] | [INFO] [stdout] 272 | ... asts::Types::Binary(bin) => match bin.node[0].clone() { [INFO] [stdout] | ___________________________________________________^ [INFO] [stdout] 273 | | ... asts::Types::Call(call) => { [INFO] [stdout] 274 | | ... vec = self.variables_allocation( [INFO] [stdout] 275 | | ... call.node.clone(), [INFO] [stdout] ... | [INFO] [stdout] 279 | | ... _ => {} [INFO] [stdout] 280 | | ... }, [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] 272 ~ asts::Types::Binary(bin) => if let asts::Types::Call(call) = bin.node[0].clone() { [INFO] [stdout] 273 + vec = self.variables_allocation( [INFO] [stdout] 274 + call.node.clone(), [INFO] [stdout] 275 + vec_function, [INFO] [stdout] 276 + ); [INFO] [stdout] 277 ~ }, [INFO] [stdout] | [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/compiler/variable.rs:174:17 [INFO] [stdout] | [INFO] [stdout] 174 | / match &bin.node[0] { [INFO] [stdout] 175 | | asts::Types::Call(call) => { [INFO] [stdout] 176 | | let call_name = &format!("import_{}_{}", var.name, call.callee); [INFO] [stdout] 177 | | self.var_call_write(call, var_name, call_name, var); [INFO] [stdout] ... | [INFO] [stdout] 180 | | _ => {} [INFO] [stdout] 181 | | } [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] 174 ~ if let asts::Types::Call(call) = &bin.node[0] { [INFO] [stdout] 175 + let call_name = &format!("import_{}_{}", var.name, call.callee); [INFO] [stdout] 176 + self.var_call_write(call, var_name, call_name, var); [INFO] [stdout] 177 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/compiler/variable.rs:196:41 [INFO] [stdout] | [INFO] [stdout] 196 | self.resubstitution(var_name, &bin, var); [INFO] [stdout] | ^^^^ help: change this to: `bin` [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/compiler/variable.rs:200:42 [INFO] [stdout] | [INFO] [stdout] 200 | let types_cal = self.calcuration(&bin, var_name); [INFO] [stdout] | ^^^^ help: change this to: `bin` [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 seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/compiler/variable.rs:203:9 [INFO] [stdout] | [INFO] [stdout] 203 | / match types_cal { [INFO] [stdout] 204 | | asts::VariableTypes::Strings => { [INFO] [stdout] 205 | | types.change(); [INFO] [stdout] ... | [INFO] [stdout] 208 | | } [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] 203 ~ if let asts::VariableTypes::Strings = types_cal { [INFO] [stdout] 204 + types.change(); [INFO] [stdout] 205 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Function` [INFO] [stdout] --> src/interpreter/function.rs:14:5 [INFO] [stdout] | [INFO] [stdout] 14 | / pub fn new() -> Function { [INFO] [stdout] 15 | | let mut fun = Function { [INFO] [stdout] 16 | | funcstions: Vec::new(), [INFO] [stdout] 17 | | inner: 0, [INFO] [stdout] ... | [INFO] [stdout] 21 | | return fun; [INFO] [stdout] 22 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 13 + impl Default for Function { [INFO] [stdout] 14 + fn default() -> Self { [INFO] [stdout] 15 + Self::new() [INFO] [stdout] 16 + } [INFO] [stdout] 17 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/compiler/variable.rs:236:9 [INFO] [stdout] | [INFO] [stdout] 236 | num_var.push_str(";"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `num_var.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: unneeded `return` statement [INFO] [stdout] --> src/interpreter/function.rs:21:9 [INFO] [stdout] | [INFO] [stdout] 21 | return fun; [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] 21 - return fun; [INFO] [stdout] 21 + fun [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/compiler/variable.rs:249:11 [INFO] [stdout] | [INFO] [stdout] 249 | num_var.push_str("1"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `num_var.push('1')` [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 string literal [INFO] [stdout] --> src/compiler/variable.rs:251:11 [INFO] [stdout] | [INFO] [stdout] 251 | num_var.push_str("0"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `num_var.push('0')` [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 string literal [INFO] [stdout] --> src/compiler/variable.rs:253:9 [INFO] [stdout] | [INFO] [stdout] 253 | num_var.push_str(";"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `num_var.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: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/interpreter/function.rs:54:13 [INFO] [stdout] | [INFO] [stdout] 54 | / match node { [INFO] [stdout] 55 | | asts::Types::Function(_) => { [INFO] [stdout] 56 | | self.funcstions[self.inner].push(node); [INFO] [stdout] ... | [INFO] [stdout] 59 | | } [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] 54 ~ if let asts::Types::Function(_) = node { [INFO] [stdout] 55 + self.funcstions[self.inner].push(node); [INFO] [stdout] 56 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter/function.rs:83:9 [INFO] [stdout] | [INFO] [stdout] 83 | return inner; [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] 83 - return inner; [INFO] [stdout] 83 + inner [INFO] [stdout] | [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/interpreter/function.rs:74:13 [INFO] [stdout] | [INFO] [stdout] 74 | / match node { [INFO] [stdout] 75 | | asts::Types::Function(_) => { [INFO] [stdout] 76 | | inner.push(node); [INFO] [stdout] ... | [INFO] [stdout] 79 | | } [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] 74 ~ if let asts::Types::Function(_) = node { [INFO] [stdout] 75 + inner.push(node); [INFO] [stdout] 76 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter/function.rs:140:9 [INFO] [stdout] | [INFO] [stdout] 140 | return None; [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] 140 - return None; [INFO] [stdout] 140 + None [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/interpreter/function.rs:99:67 [INFO] [stdout] | [INFO] [stdout] 99 | let (var_result, _) = variable.serch_variable(&var, self); [INFO] [stdout] | ^^^^ help: change this to: `var` [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/interpreter/function.rs:104:60 [INFO] [stdout] | [INFO] [stdout] 104 | let result = interpreters::calculation(&value, variable, self); [INFO] [stdout] | ^^^^^^ help: change this to: `value` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/interpreter/function.rs:109:36 [INFO] [stdout] | [INFO] [stdout] 109 | self.print_var(&value); [INFO] [stdout] | ^^^^^^ help: change this to: `value` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/compiler/variable.rs:314:35 [INFO] [stdout] | [INFO] [stdout] 314 | fn array_write(&mut self, arry: &Vec, types: &asts::VariableTypes) { [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] 314 - fn array_write(&mut self, arry: &Vec, types: &asts::VariableTypes) { [INFO] [stdout] 314 + fn array_write(&mut self, arry: &[asts::Types], types: &asts::VariableTypes) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/compiler/variable.rs:407:5 [INFO] [stdout] | [INFO] [stdout] 407 | return types_str; [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] 407 - return types_str; [INFO] [stdout] 407 + types_str [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/interpreter/function.rs:130:25 [INFO] [stdout] | [INFO] [stdout] 130 | / if serch_string == fun.name { [INFO] [stdout] 131 | | return self.function(fun, &argument, variable); [INFO] [stdout] 132 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 129 ~ asts::Types::Function(fun) [INFO] [stdout] 130 ~ if serch_string == fun.name => { [INFO] [stdout] 131 | return self.function(fun, &argument, variable); [INFO] [stdout] 132 ~ } [INFO] [stdout] | [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/interpreter/function.rs:128:17 [INFO] [stdout] | [INFO] [stdout] 128 | / match fun { [INFO] [stdout] 129 | | asts::Types::Function(fun) => { [INFO] [stdout] 130 | | if serch_string == fun.name { [INFO] [stdout] 131 | | return self.function(fun, &argument, variable); [INFO] [stdout] ... | [INFO] [stdout] 135 | | _ => {} [INFO] [stdout] 136 | | } [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] 128 ~ if let asts::Types::Function(fun) = fun { [INFO] [stdout] 129 + if serch_string == fun.name { [INFO] [stdout] 130 + return self.function(fun, &argument, variable); [INFO] [stdout] 131 + } [INFO] [stdout] 132 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter/function.rs:212:9 [INFO] [stdout] | [INFO] [stdout] 212 | return result; [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] 212 - return result; [INFO] [stdout] 212 + result [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/interpreter/function.rs:146:19 [INFO] [stdout] | [INFO] [stdout] 146 | argument: &Vec, [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] 146 - argument: &Vec, [INFO] [stdout] 146 + argument: &[asts::Types], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/compiler/variable.rs:390:9 [INFO] [stdout] | [INFO] [stdout] 390 | types_str.push_str("="); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `types_str.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/compiler/variable.rs:402:37 [INFO] [stdout] | [INFO] [stdout] 402 | let err = error::Error::new(&node); [INFO] [stdout] | ^^^^^ help: change this to: `node` [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/compiler/variable.rs:414:51 [INFO] [stdout] | [INFO] [stdout] 414 | let types_var = self.variable.sertch_type(&var_name).0; [INFO] [stdout] | ^^^^^^^^^ help: change this to: `var_name` [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/interpreter/function.rs:189:49 [INFO] [stdout] | [INFO] [stdout] 189 | let err = error::Error::new(&function_argument); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: change this to: `function_argument` [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 match could be written as a `let` statement [INFO] [stdout] --> src/compiler/variable.rs:417:26 [INFO] [stdout] | [INFO] [stdout] 417 | Some(_ts) => match t { [INFO] [stdout] | __________________________^ [INFO] [stdout] 418 | | _ts => { [INFO] [stdout] 419 | | self.write(&format!("{} = {}", var_name, vars.name)); [INFO] [stdout] 420 | | self.write(";"); [INFO] [stdout] 421 | | } [INFO] [stdout] 422 | | }, [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding [INFO] [stdout] = note: `#[warn(clippy::match_single_binding)]` on by default [INFO] [stdout] help: consider using a `let` statement [INFO] [stdout] | [INFO] [stdout] 417 ~ Some(_ts) => { [INFO] [stdout] 418 + let _ts = t; [INFO] [stdout] 419 + self.write(&format!("{} = {}", var_name, vars.name)); [INFO] [stdout] 420 + self.write(";"); [INFO] [stdout] 421 ~ }, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the function `interpreters::scope` doesn't need a mutable reference [INFO] [stdout] --> src/interpreter/function.rs:197:47 [INFO] [stdout] | [INFO] [stdout] 197 | let (_, result) = interpreters::scope(&mut node, vec_variable, self); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed [INFO] [stdout] = note: `#[warn(clippy::unnecessary_mut_passed)]` on by default [INFO] [stdout] help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] 197 - let (_, result) = interpreters::scope(&mut node, vec_variable, self); [INFO] [stdout] 197 + let (_, result) = interpreters::scope(&node, vec_variable, self); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/interpreter/function.rs:197:47 [INFO] [stdout] | [INFO] [stdout] 197 | let (_, result) = interpreters::scope(&mut node, vec_variable, self); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `node` [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 seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/interpreter/function.rs:200:9 [INFO] [stdout] | [INFO] [stdout] 200 | / match &result { [INFO] [stdout] 201 | | Some(types_result) => { [INFO] [stdout] 202 | | let continu = self.type_inspection_retruns(&result_type, types_result); [INFO] [stdout] 203 | | if !continu { [INFO] [stdout] ... | [INFO] [stdout] 208 | | None => {} [INFO] [stdout] 209 | | } [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] 200 ~ if let Some(types_result) = &result { [INFO] [stdout] 201 + let continu = self.type_inspection_retruns(&result_type, types_result); [INFO] [stdout] 202 + if !continu { [INFO] [stdout] 203 + let err = error::Error::new(&function.argument.clone()[index - 1]); [INFO] [stdout] 204 + err.exit("argument type error"); [INFO] [stdout] 205 + } [INFO] [stdout] 206 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/interpreter/function.rs:227:45 [INFO] [stdout] | [INFO] [stdout] 227 | let err = error::Error::new(&var_result); [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `var_result` [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: methods called `into_*` usually take `self` by value [INFO] [stdout] --> src/compiler/arithmetic.rs:23:22 [INFO] [stdout] | [INFO] [stdout] 23 | pub fn into_string(&mut self) { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] = note: `#[warn(clippy::wrong_self_convention)]` on by default [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/interpreter/function.rs:240:9 [INFO] [stdout] | [INFO] [stdout] 240 | / match argument_type { [INFO] [stdout] 241 | | asts::Types::Variable(var) => match var.types.clone() { [INFO] [stdout] 242 | | Some(types_var) => { [INFO] [stdout] 243 | | argument_types = types_var; [INFO] [stdout] ... | [INFO] [stdout] 248 | | _ => {} [INFO] [stdout] 249 | | } [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] 240 ~ if let asts::Types::Variable(var) = argument_type { match var.types.clone() { [INFO] [stdout] 241 + Some(types_var) => { [INFO] [stdout] 242 + argument_types = types_var; [INFO] [stdout] 243 + } [INFO] [stdout] 244 + _ => {} [INFO] [stdout] 245 + } } [INFO] [stdout] | [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/interpreter/function.rs:241:43 [INFO] [stdout] | [INFO] [stdout] 241 | asts::Types::Variable(var) => match var.types.clone() { [INFO] [stdout] | ___________________________________________^ [INFO] [stdout] 242 | | Some(types_var) => { [INFO] [stdout] 243 | | argument_types = types_var; [INFO] [stdout] ... | [INFO] [stdout] 246 | | }, [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] 241 ~ asts::Types::Variable(var) => if let Some(types_var) = var.types.clone() { [INFO] [stdout] 242 + argument_types = types_var; [INFO] [stdout] 243 ~ }, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/compiler/arithmetic.rs:156:9 [INFO] [stdout] | [INFO] [stdout] 156 | return asts::VariableTypes::Strings; [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] 156 - return asts::VariableTypes::Strings; [INFO] [stdout] 156 + asts::VariableTypes::Strings [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/compiler/arithmetic.rs:160:9 [INFO] [stdout] | [INFO] [stdout] 160 | return asts::VariableTypes::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] 160 - return asts::VariableTypes::Int; [INFO] [stdout] 160 + asts::VariableTypes::Int [INFO] [stdout] | [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/interpreter/function.rs:251:9 [INFO] [stdout] | [INFO] [stdout] 251 | / match types { [INFO] [stdout] 252 | | Some(t) => match t { [INFO] [stdout] 253 | | asts::VariableTypes::Bool => match argument_types { [INFO] [stdout] 254 | | asts::VariableTypes::Bool => { [INFO] [stdout] ... | [INFO] [stdout] 278 | | _ => {} [INFO] [stdout] 279 | | } [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] 251 ~ if let Some(t) = types { match t { [INFO] [stdout] 252 + asts::VariableTypes::Bool => match argument_types { [INFO] [stdout] 253 + asts::VariableTypes::Bool => { [INFO] [stdout] 254 + return true; [INFO] [stdout] 255 + } [INFO] [stdout] 256 + _ => {} [INFO] [stdout] 257 + }, [INFO] [stdout] 258 + asts::VariableTypes::Int => match argument_types { [INFO] [stdout] 259 + asts::VariableTypes::Int => { [INFO] [stdout] 260 + return true; [INFO] [stdout] 261 + } [INFO] [stdout] 262 + _ => {} [INFO] [stdout] 263 + }, [INFO] [stdout] 264 + asts::VariableTypes::Strings => match argument_types { [INFO] [stdout] 265 + asts::VariableTypes::Strings => { [INFO] [stdout] 266 + return true; [INFO] [stdout] 267 + } [INFO] [stdout] 268 + _ => {} [INFO] [stdout] 269 + }, [INFO] [stdout] 270 + [INFO] [stdout] 271 + _ => { [INFO] [stdout] 272 + let err = error::Error::new(argument_type); [INFO] [stdout] 273 + err.exit("argument_type"); [INFO] [stdout] 274 + } [INFO] [stdout] 275 + } } [INFO] [stdout] | [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/interpreter/function.rs:253:46 [INFO] [stdout] | [INFO] [stdout] 253 | asts::VariableTypes::Bool => match argument_types { [INFO] [stdout] | ______________________________________________^ [INFO] [stdout] 254 | | asts::VariableTypes::Bool => { [INFO] [stdout] 255 | | return true; [INFO] [stdout] ... | [INFO] [stdout] 258 | | }, [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] 253 ~ asts::VariableTypes::Bool => if let asts::VariableTypes::Bool = argument_types { [INFO] [stdout] 254 + return true; [INFO] [stdout] 255 ~ }, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/compiler/arithmetic.rs:41:9 [INFO] [stdout] | [INFO] [stdout] 41 | / if &bin.op.to_string() == op { [INFO] [stdout] 42 | | if op == "+" { [INFO] [stdout] 43 | | self.write(&format!("{}++;", var_name)); [INFO] [stdout] 44 | | }else if op == "-"{ [INFO] [stdout] ... | [INFO] [stdout] 51 | | return asts::VariableTypes::Int; [INFO] [stdout] 52 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 40 ~ asts::Types::Binary(bin) [INFO] [stdout] 41 ~ if &bin.op.to_string() == op => { [INFO] [stdout] 42 | if op == "+" { [INFO] [stdout] ... [INFO] [stdout] 51 | return asts::VariableTypes::Int; [INFO] [stdout] 52 ~ } [INFO] [stdout] | [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/interpreter/function.rs:259:45 [INFO] [stdout] | [INFO] [stdout] 259 | asts::VariableTypes::Int => match argument_types { [INFO] [stdout] | _____________________________________________^ [INFO] [stdout] 260 | | asts::VariableTypes::Int => { [INFO] [stdout] 261 | | return true; [INFO] [stdout] ... | [INFO] [stdout] 264 | | }, [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] 259 ~ asts::VariableTypes::Int => if let asts::VariableTypes::Int = argument_types { [INFO] [stdout] 260 + return true; [INFO] [stdout] 261 ~ }, [INFO] [stdout] | [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/compiler/arithmetic.rs:39:5 [INFO] [stdout] | [INFO] [stdout] 39 | / match in_node { [INFO] [stdout] 40 | | asts::Types::Binary(bin) => { [INFO] [stdout] 41 | | if &bin.op.to_string() == op { [INFO] [stdout] 42 | | if op == "+" { [INFO] [stdout] ... | [INFO] [stdout] 54 | | _ => {} [INFO] [stdout] 55 | | } [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] 39 ~ if let asts::Types::Binary(bin) = in_node { [INFO] [stdout] 40 + if &bin.op.to_string() == op { [INFO] [stdout] 41 + if op == "+" { [INFO] [stdout] 42 + self.write(&format!("{}++;", var_name)); [INFO] [stdout] 43 + }else if op == "-"{ [INFO] [stdout] 44 + self.write(&format!("{}--;", var_name)); [INFO] [stdout] 45 + }else{ [INFO] [stdout] 46 + let err = error::Error::new(node); [INFO] [stdout] 47 + err.exit("type error"); [INFO] [stdout] 48 + } [INFO] [stdout] 49 + [INFO] [stdout] 50 + return asts::VariableTypes::Int; [INFO] [stdout] 51 + } [INFO] [stdout] 52 + } [INFO] [stdout] | [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/interpreter/function.rs:265:49 [INFO] [stdout] | [INFO] [stdout] 265 | asts::VariableTypes::Strings => match argument_types { [INFO] [stdout] | _________________________________________________^ [INFO] [stdout] 266 | | asts::VariableTypes::Strings => { [INFO] [stdout] 267 | | return true; [INFO] [stdout] ... | [INFO] [stdout] 270 | | }, [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] 265 ~ asts::VariableTypes::Strings => if let asts::VariableTypes::Strings = argument_types { [INFO] [stdout] 266 + return true; [INFO] [stdout] 267 ~ }, [INFO] [stdout] | [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/interpreter/function.rs:289:9 [INFO] [stdout] | [INFO] [stdout] 289 | / match types { [INFO] [stdout] 290 | | Some(t) => match t { [INFO] [stdout] 291 | | asts::VariableTypes::Bool => match argument_type { [INFO] [stdout] 292 | | asts::Types::Boolean(_) => { [INFO] [stdout] ... | [INFO] [stdout] 315 | | _ => {} [INFO] [stdout] 316 | | } [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] 289 ~ if let Some(t) = types { match t { [INFO] [stdout] 290 + asts::VariableTypes::Bool => match argument_type { [INFO] [stdout] 291 + asts::Types::Boolean(_) => { [INFO] [stdout] 292 + return true; [INFO] [stdout] 293 + } [INFO] [stdout] 294 + _ => {} [INFO] [stdout] 295 + }, [INFO] [stdout] 296 + asts::VariableTypes::Int => match argument_type { [INFO] [stdout] 297 + asts::Types::Number(_) => { [INFO] [stdout] 298 + return true; [INFO] [stdout] 299 + } [INFO] [stdout] 300 + _ => {} [INFO] [stdout] 301 + }, [INFO] [stdout] 302 + asts::VariableTypes::Strings => match argument_type { [INFO] [stdout] 303 + asts::Types::Strings(_) => { [INFO] [stdout] 304 + return true; [INFO] [stdout] 305 + } [INFO] [stdout] 306 + _ => {} [INFO] [stdout] 307 + }, [INFO] [stdout] 308 + [INFO] [stdout] 309 + _ => { [INFO] [stdout] 310 + let err = error::Error::new(argument_type); [INFO] [stdout] 311 + err.exit("argument_type"); [INFO] [stdout] 312 + } [INFO] [stdout] 313 + } } [INFO] [stdout] | [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/interpreter/function.rs:291:46 [INFO] [stdout] | [INFO] [stdout] 291 | asts::VariableTypes::Bool => match argument_type { [INFO] [stdout] | ______________________________________________^ [INFO] [stdout] 292 | | asts::Types::Boolean(_) => { [INFO] [stdout] 293 | | return true; [INFO] [stdout] ... | [INFO] [stdout] 296 | | }, [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] 291 ~ asts::VariableTypes::Bool => if let asts::Types::Boolean(_) = argument_type { [INFO] [stdout] 292 + return true; [INFO] [stdout] 293 ~ }, [INFO] [stdout] | [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/interpreter/function.rs:297:45 [INFO] [stdout] | [INFO] [stdout] 297 | asts::VariableTypes::Int => match argument_type { [INFO] [stdout] | _____________________________________________^ [INFO] [stdout] 298 | | asts::Types::Number(_) => { [INFO] [stdout] 299 | | return true; [INFO] [stdout] ... | [INFO] [stdout] 302 | | }, [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] 297 ~ asts::VariableTypes::Int => if let asts::Types::Number(_) = argument_type { [INFO] [stdout] 298 + return true; [INFO] [stdout] 299 ~ }, [INFO] [stdout] | [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/interpreter/function.rs:303:49 [INFO] [stdout] | [INFO] [stdout] 303 | asts::VariableTypes::Strings => match argument_type { [INFO] [stdout] | _________________________________________________^ [INFO] [stdout] 304 | | asts::Types::Strings(_) => { [INFO] [stdout] 305 | | return true; [INFO] [stdout] ... | [INFO] [stdout] 308 | | }, [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] 303 ~ asts::VariableTypes::Strings => if let asts::Types::Strings(_) = argument_type { [INFO] [stdout] 304 + return true; [INFO] [stdout] 305 ~ }, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/compiler/arithmetic.rs:61:34 [INFO] [stdout] | [INFO] [stdout] 61 | formats.strings.push_str(&op); [INFO] [stdout] | ^^^ help: change this to: `op` [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/compiler/arithmetic.rs:69:11 [INFO] [stdout] | [INFO] [stdout] 69 | formats.strings.push_str(","); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `formats.strings.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: useless use of `format!` [INFO] [stdout] --> src/compiler/arithmetic.rs:89:43 [INFO] [stdout] | [INFO] [stdout] 89 | formats.strings.push_str(&format!("{}", vars.name)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `vars.name.to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/compiler/arithmetic.rs:91:19 [INFO] [stdout] | [INFO] [stdout] 91 | formats.strings.push_str(","); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `formats.strings.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: useless use of `format!` [INFO] [stdout] --> src/compiler/arithmetic.rs:100:43 [INFO] [stdout] | [INFO] [stdout] 100 | formats.strings.push_str(&format!("{}", vars.name)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `vars.name.to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/compiler/arithmetic.rs:101:42 [INFO] [stdout] | [INFO] [stdout] 101 | formats.strings.push_str(&op); [INFO] [stdout] | ^^^ help: change this to: `op` [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 should consider adding a `Default` implementation for `Compile` [INFO] [stdout] --> src/compiler/to_c.rs:20:3 [INFO] [stdout] | [INFO] [stdout] 20 | / pub fn new() -> Compile { [INFO] [stdout] 21 | | fs::create_dir_all("./build").expect("dir create failed"); [INFO] [stdout] 22 | | let file = fs::File::create("./build/build.c").expect("create failed"); [INFO] [stdout] 23 | | let vairables = variable::Vriables::new(); [INFO] [stdout] ... | [INFO] [stdout] 33 | | } [INFO] [stdout] | |___^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 19 + impl Default for Compile { [INFO] [stdout] 20 + fn default() -> Self { [INFO] [stdout] 21 + Self::new() [INFO] [stdout] 22 + } [INFO] [stdout] 23 + } [INFO] [stdout] | [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/compiler/arithmetic.rs:146:5 [INFO] [stdout] | [INFO] [stdout] 146 | / match reg.captures(&formats.strings) { [INFO] [stdout] 147 | | Some(_) => { [INFO] [stdout] 148 | | return asts::VariableTypes::Bool; [INFO] [stdout] ... | [INFO] [stdout] 151 | | } [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] 146 ~ if let Some(_) = reg.captures(&formats.strings) { [INFO] [stdout] 147 + return asts::VariableTypes::Bool; [INFO] [stdout] 148 + } [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/compiler/to_c.rs:67:39 [INFO] [stdout] | [INFO] [stdout] 67 | pub(crate) fn scope(&mut self, ast: &Vec) { [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] 67 - pub(crate) fn scope(&mut self, ast: &Vec) { [INFO] [stdout] 67 + pub(crate) fn scope(&mut self, ast: &[asts::Types]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/compiler/arithmetic.rs:183:9 [INFO] [stdout] | [INFO] [stdout] 183 | return; [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] 182 - self.calcuration_write(&strings.node[0], foramts, &asts::VariableTypes::Strings); [INFO] [stdout] 183 - return; [INFO] [stdout] 182 + self.calcuration_write(&strings.node[0], foramts, &asts::VariableTypes::Strings); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/compiler/arithmetic.rs:201:9 [INFO] [stdout] | [INFO] [stdout] 201 | return; [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] 200 - self.calcuration_write(&num.node[0], foramts, &asts::VariableTypes::Int); [INFO] [stdout] 201 - return; [INFO] [stdout] 200 + self.calcuration_write(&num.node[0], foramts, &asts::VariableTypes::Int); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/compiler/arithmetic.rs:242:9 [INFO] [stdout] | [INFO] [stdout] 242 | return; [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] 241 - } [INFO] [stdout] 242 - return; [INFO] [stdout] 241 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/compiler/to_c.rs:123:9 [INFO] [stdout] | [INFO] [stdout] 123 | return; [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] 122 - _ => { [INFO] [stdout] 123 - return; [INFO] [stdout] 122 + _ => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/compiler/arithmetic.rs:294:9 [INFO] [stdout] | [INFO] [stdout] 294 | return; [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] 293 - } [INFO] [stdout] 294 - return; [INFO] [stdout] 293 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/compiler/to_c.rs:109:25 [INFO] [stdout] | [INFO] [stdout] 109 | self.fors_write(&fors); [INFO] [stdout] | ^^^^^ help: change this to: `fors` [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 seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/compiler/arithmetic.rs:189:9 [INFO] [stdout] | [INFO] [stdout] 189 | / match types { [INFO] [stdout] 190 | | asts::VariableTypes::Strings => { [INFO] [stdout] 191 | | foramts.formats.push_str("%d"); [INFO] [stdout] ... | [INFO] [stdout] 194 | | } [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] 189 ~ if let asts::VariableTypes::Strings = types { [INFO] [stdout] 190 + foramts.formats.push_str("%d"); [INFO] [stdout] 191 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/compiler/arithmetic.rs:210:15 [INFO] [stdout] | [INFO] [stdout] 210 | foramts.strings.push_str(","); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `foramts.strings.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: calling `push_str()` using a single-character converted to string [INFO] [stdout] --> src/compiler/arithmetic.rs:217:13 [INFO] [stdout] | [INFO] [stdout] 217 | foramts.strings.push_str(&bin.op.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` without `to_string()`: `foramts.strings.push(bin.op)` [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: useless use of `format!` [INFO] [stdout] --> src/compiler/function.rs:25:36 [INFO] [stdout] | [INFO] [stdout] 25 | values.push_str(&format!("{}", &var.name)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `(&var.name).to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/compiler/arithmetic.rs:219:15 [INFO] [stdout] | [INFO] [stdout] 219 | / match bin.node[1].clone() { [INFO] [stdout] 220 | | asts::Types::Binary(bin) => { [INFO] [stdout] 221 | | foramts.strings.push_str(&bin.op.to_string()); [INFO] [stdout] ... | [INFO] [stdout] 224 | | _ => {} [INFO] [stdout] 225 | | } [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] 219 ~ if let asts::Types::Binary(bin) = bin.node[1].clone() { [INFO] [stdout] 220 + foramts.strings.push_str(&bin.op.to_string()); [INFO] [stdout] 221 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character converted to string [INFO] [stdout] --> src/compiler/arithmetic.rs:221:19 [INFO] [stdout] | [INFO] [stdout] 221 | foramts.strings.push_str(&bin.op.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` without `to_string()`: `foramts.strings.push(bin.op)` [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: useless use of `format!` [INFO] [stdout] --> src/compiler/function.rs:36:36 [INFO] [stdout] | [INFO] [stdout] 36 | values.push_str(&format!("{}", &var.name)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `(&var.name).to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/compiler/function.rs:67:11 [INFO] [stdout] | [INFO] [stdout] 67 | values.push_str("\""); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `values.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] = note: `#[warn(clippy::single_char_add_str)]` 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/compiler/function.rs:78:50 [INFO] [stdout] | [INFO] [stdout] 78 | pub(crate) fn function_write(&mut self, nodes: &Vec) { [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] 78 - pub(crate) fn function_write(&mut self, nodes: &Vec) { [INFO] [stdout] 78 + pub(crate) fn function_write(&mut self, nodes: &[asts::Types]) { [INFO] [stdout] | [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/compiler/function.rs:87:41 [INFO] [stdout] | [INFO] [stdout] 87 | asts::Types::Import(imports) => match &imports.path[0] { [INFO] [stdout] | _________________________________________^ [INFO] [stdout] 88 | | asts::Types::Strings(strings) => { [INFO] [stdout] 89 | | self.variable.vec_push(); [INFO] [stdout] 90 | | let result = interpreter::interpreters::read_file(&strings.name); [INFO] [stdout] ... | [INFO] [stdout] 98 | | _ => {} [INFO] [stdout] 99 | | }, [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] 87 ~ asts::Types::Import(imports) => if let asts::Types::Strings(strings) = &imports.path[0] { [INFO] [stdout] 88 + self.variable.vec_push(); [INFO] [stdout] 89 + let result = interpreter::interpreters::read_file(&strings.name); [INFO] [stdout] 90 + let name: Vec<&str> = strings.name.split('.').collect(); [INFO] [stdout] 91 + let name: Vec<&str> = name[name.len() - 2].split('/').collect(); [INFO] [stdout] 92 + self.to_import(&name[2]); [INFO] [stdout] 93 + self.function_write(&result.node); [INFO] [stdout] 94 + self.variable.last_remove(); [INFO] [stdout] 95 + self.to_import(""); [INFO] [stdout] 96 ~ }, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/compiler/function.rs:93:28 [INFO] [stdout] | [INFO] [stdout] 93 | self.to_import(&name[2]); [INFO] [stdout] | ^^^^^^^^ help: change this to: `name[2]` [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/compiler/ifs.rs:13:32 [INFO] [stdout] | [INFO] [stdout] 13 | match self.calcuration(&bin, tmp){ [INFO] [stdout] | ^^^^ help: change this to: `bin` [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: comparison to empty slice [INFO] [stdout] --> src/compiler/function.rs:104:16 [INFO] [stdout] | [INFO] [stdout] 104 | if self.import == "" { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.import.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] = note: `#[warn(clippy::comparison_to_empty)]` 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/compiler/function.rs:105:54 [INFO] [stdout] | [INFO] [stdout] 105 | let mut types = Types::new(&funs.name, &f); [INFO] [stdout] | ^^ help: change this to: `f` [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/compiler/function.rs:107:30 [INFO] [stdout] | [INFO] [stdout] 107 | self.functions(&f, &funs, &mut types, &funs.name); [INFO] [stdout] | ^^ help: change this to: `f` [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/compiler/function.rs:111:53 [INFO] [stdout] | [INFO] [stdout] 111 | let mut types = Types::new(funs_name, &f); [INFO] [stdout] | ^^ help: change this to: `f` [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/compiler/function.rs:113:30 [INFO] [stdout] | [INFO] [stdout] 113 | self.functions(&f, &funs, &mut types, funs_name); [INFO] [stdout] | ^^ help: change this to: `f` [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: comparison to empty slice [INFO] [stdout] --> src/compiler/function.rs:122:17 [INFO] [stdout] | [INFO] [stdout] 122 | if self.import == "" { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.import.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/compiler/fors.rs:59:32 [INFO] [stdout] | [INFO] [stdout] 59 | fn fors_juge(&mut self, node:&Vec, op:Option) { [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] 59 - fn fors_juge(&mut self, node:&Vec, op:Option) { [INFO] [stdout] 59 + fn fors_juge(&mut self, node:&[asts::Types], op:Option) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/compiler/function.rs:243:26 [INFO] [stdout] | [INFO] [stdout] 243 | self.calcuration(&bin, "tmp"); [INFO] [stdout] | ^^^^ help: change this to: `bin` [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 `match` can be collapsed into the outer `match` [INFO] [stdout] --> src/compiler/function.rs:272:20 [INFO] [stdout] | [INFO] [stdout] 272 | Some(t) => match t { [INFO] [stdout] | ____________________^ [INFO] [stdout] 273 | | asts::VariableTypes::Bool => { [INFO] [stdout] 274 | | if bools.boolean == true { [INFO] [stdout] 275 | | self.write("1"); [INFO] [stdout] ... | [INFO] [stdout] 284 | | }, [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/compiler/function.rs:272:14 [INFO] [stdout] | [INFO] [stdout] 272 | Some(t) => match t { [INFO] [stdout] | ^ replace this binding [INFO] [stdout] 273 | asts::VariableTypes::Bool => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ with this pattern [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against true are unnecessary [INFO] [stdout] --> src/compiler/function.rs:274:16 [INFO] [stdout] | [INFO] [stdout] 274 | if bools.boolean == true { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `bools.boolean` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_comparison)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` can be collapsed into the outer `match` [INFO] [stdout] --> src/compiler/function.rs:292:20 [INFO] [stdout] | [INFO] [stdout] 292 | Some(t) => match t { [INFO] [stdout] | ____________________^ [INFO] [stdout] 293 | | asts::VariableTypes::Strings => { [INFO] [stdout] 294 | | self.write(&strings.name); [INFO] [stdout] ... | [INFO] [stdout] 300 | | }, [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/compiler/function.rs:292:14 [INFO] [stdout] | [INFO] [stdout] 292 | Some(t) => match t { [INFO] [stdout] | ^ replace this binding [INFO] [stdout] 293 | asts::VariableTypes::Strings => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ with this pattern [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` can be collapsed into the outer `match` [INFO] [stdout] --> src/compiler/function.rs:358:20 [INFO] [stdout] | [INFO] [stdout] 358 | Some(t) => match t { [INFO] [stdout] | ____________________^ [INFO] [stdout] 359 | | asts::VariableTypes::Int => { [INFO] [stdout] 360 | | self.write(&num.val.to_string()); [INFO] [stdout] ... | [INFO] [stdout] 366 | | }, [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/compiler/function.rs:358:14 [INFO] [stdout] | [INFO] [stdout] 358 | Some(t) => match t { [INFO] [stdout] | ^ replace this binding [INFO] [stdout] 359 | asts::VariableTypes::Int => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ with this pattern [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/compiler/function.rs:382:51 [INFO] [stdout] | [INFO] [stdout] 382 | pub(crate) fn argment_write(&mut self, argment: &Vec, callee: &str) { [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] 382 - pub(crate) fn argment_write(&mut self, argment: &Vec, callee: &str) { [INFO] [stdout] 382 + pub(crate) fn argment_write(&mut self, argment: &[asts::Types], callee: &str) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/compiler/function.rs:383:8 [INFO] [stdout] | [INFO] [stdout] 383 | if argment.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `argment.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` can be collapsed into the outer `match` [INFO] [stdout] --> src/compiler/function.rs:395:24 [INFO] [stdout] | [INFO] [stdout] 395 | Some(t) => match t { [INFO] [stdout] | ________________________^ [INFO] [stdout] 396 | | _param_types => {} [INFO] [stdout] 397 | | [INFO] [stdout] 398 | | _ => { [INFO] [stdout] ... | [INFO] [stdout] 402 | | }, [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/compiler/function.rs:395:18 [INFO] [stdout] | [INFO] [stdout] 395 | Some(t) => match t { [INFO] [stdout] | ^ replace this binding [INFO] [stdout] 396 | _param_types => {} [INFO] [stdout] | ^^^^^^^^^^^^ with this pattern [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/compiler/function.rs:429:27 [INFO] [stdout] | [INFO] [stdout] 429 | self.call_write(&call); [INFO] [stdout] | ^^^^^ help: change this to: `call` [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: comparison to empty slice [INFO] [stdout] --> src/compiler/function.rs:453:8 [INFO] [stdout] | [INFO] [stdout] 453 | if self.import != ""{ [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.import.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/compiler/function.rs:461:48 [INFO] [stdout] | [INFO] [stdout] 461 | let mut call_var = self.type_write(&t, &var_name, &asts::Types::Call(call.clone())); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `var_name` [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/compiler/function.rs:463:9 [INFO] [stdout] | [INFO] [stdout] 463 | call_var.push_str("("); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `call_var.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 if-then-else expression assigns a bool literal [INFO] [stdout] --> src/compiler/variable.rs:36:5 [INFO] [stdout] | [INFO] [stdout] 36 | / if self.change { [INFO] [stdout] 37 | | self.change = false; [INFO] [stdout] 38 | | } else { [INFO] [stdout] 39 | | self.change = true; [INFO] [stdout] 40 | | } [INFO] [stdout] | |_____^ help: you can reduce it to: `self.change = !self.change;` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool_assign [INFO] [stdout] = note: `#[warn(clippy::needless_bool_assign)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Vriables` [INFO] [stdout] --> src/compiler/variable.rs:51:3 [INFO] [stdout] | [INFO] [stdout] 51 | / pub fn new() -> Vriables { [INFO] [stdout] 52 | | let mut var = Vriables { [INFO] [stdout] 53 | | variables: Vec::new(), [INFO] [stdout] 54 | | inner: 0, [INFO] [stdout] ... | [INFO] [stdout] 58 | | return var; [INFO] [stdout] 59 | | } [INFO] [stdout] | |___^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 50 + impl Default for Vriables { [INFO] [stdout] 51 + fn default() -> Self { [INFO] [stdout] 52 + Self::new() [INFO] [stdout] 53 + } [INFO] [stdout] 54 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/compiler/variable.rs:58:5 [INFO] [stdout] | [INFO] [stdout] 58 | return var; [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] 58 - return var; [INFO] [stdout] 58 + var [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/compiler/variable.rs:74:5 [INFO] [stdout] | [INFO] [stdout] 74 | return address; [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] 74 - return address; [INFO] [stdout] 74 + address [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/compiler/variable.rs:112:5 [INFO] [stdout] | [INFO] [stdout] 112 | return (None, Vec::new(), false); [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] 112 - return (None, Vec::new(), false); [INFO] [stdout] 112 + (None, Vec::new(), false) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/compiler/variable.rs:190:11 [INFO] [stdout] | [INFO] [stdout] 190 | return; [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] 189 - } [INFO] [stdout] 190 - return; [INFO] [stdout] 189 + } [INFO] [stdout] | [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/compiler/variable.rs:121:9 [INFO] [stdout] | [INFO] [stdout] 121 | / match &var.index { [INFO] [stdout] 122 | | Some(i) => { [INFO] [stdout] 123 | | let sertch_type = self.variable.sertch_type(&var.name).0; [INFO] [stdout] 124 | | match sertch_type { [INFO] [stdout] ... | [INFO] [stdout] 153 | | None => {} [INFO] [stdout] 154 | | } [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] 121 ~ if let Some(i) = &var.index { [INFO] [stdout] 122 + let sertch_type = self.variable.sertch_type(&var.name).0; [INFO] [stdout] 123 + match sertch_type { [INFO] [stdout] 124 + Some(t) => { [INFO] [stdout] 125 + let mut var_tmp = [INFO] [stdout] 126 + self.type_write(&t, &var_name, &asts::Types::Variable(var.clone())); [INFO] [stdout] 127 + var_tmp.push_str(&var.name); [INFO] [stdout] 128 + var_tmp.push_str("["); [INFO] [stdout] 129 + match &i[0] { [INFO] [stdout] 130 + asts::Types::Number(num) => { [INFO] [stdout] 131 + var_tmp.push_str(&num.val.to_string()); [INFO] [stdout] 132 + } [INFO] [stdout] 133 + [INFO] [stdout] 134 + _ => { [INFO] [stdout] 135 + let err = error::Error::new(&var.node[0]); [INFO] [stdout] 136 + err.exit("variable error"); [INFO] [stdout] 137 + } [INFO] [stdout] 138 + } [INFO] [stdout] 139 + self.write(&var_tmp); [INFO] [stdout] 140 + self.write("];"); [INFO] [stdout] 141 + return; [INFO] [stdout] 142 + } [INFO] [stdout] 143 + [INFO] [stdout] 144 + None => { [INFO] [stdout] 145 + let err = error::Error::new(&var.node[0]); [INFO] [stdout] 146 + err.exit("variable error"); [INFO] [stdout] 147 + } [INFO] [stdout] 148 + } [INFO] [stdout] 149 + return; [INFO] [stdout] 150 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/compiler/variable.rs:127:39 [INFO] [stdout] | [INFO] [stdout] 127 | self.type_write(&t, &var_name, &asts::Types::Variable(var.clone())); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `var_name` [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/compiler/variable.rs:129:17 [INFO] [stdout] | [INFO] [stdout] 129 | var_tmp.push_str("["); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `var_tmp.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: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/compiler/variable.rs:171:11 [INFO] [stdout] | [INFO] [stdout] 171 | / match &var.node[0] { [INFO] [stdout] 172 | | asts::Types::Binary(bin) => { [INFO] [stdout] 173 | | if bin.op == '.' { [INFO] [stdout] 174 | | match &bin.node[0] { [INFO] [stdout] ... | [INFO] [stdout] 188 | | _ => {} [INFO] [stdout] 189 | | } [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] 171 ~ if let asts::Types::Binary(bin) = &var.node[0] { [INFO] [stdout] 172 + if bin.op == '.' { [INFO] [stdout] 173 + match &bin.node[0] { [INFO] [stdout] 174 + asts::Types::Call(call) => { [INFO] [stdout] 175 + let call_name = &format!("import_{}_{}", var.name, call.callee); [INFO] [stdout] 176 + self.var_call_write(call, var_name, call_name, var); [INFO] [stdout] 177 + } [INFO] [stdout] 178 + [INFO] [stdout] 179 + _ => {} [INFO] [stdout] 180 + } [INFO] [stdout] 181 + } else { [INFO] [stdout] 182 + let err = error::Error::new(&var.node[0]); [INFO] [stdout] 183 + err.exit("variable error"); [INFO] [stdout] 184 + } [INFO] [stdout] 185 + } [INFO] [stdout] | [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/compiler/variable.rs:174:17 [INFO] [stdout] | [INFO] [stdout] 174 | / match &bin.node[0] { [INFO] [stdout] 175 | | asts::Types::Call(call) => { [INFO] [stdout] 176 | | let call_name = &format!("import_{}_{}", var.name, call.callee); [INFO] [stdout] 177 | | self.var_call_write(call, var_name, call_name, var); [INFO] [stdout] ... | [INFO] [stdout] 180 | | _ => {} [INFO] [stdout] 181 | | } [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] 174 ~ if let asts::Types::Call(call) = &bin.node[0] { [INFO] [stdout] 175 + let call_name = &format!("import_{}_{}", var.name, call.callee); [INFO] [stdout] 176 + self.var_call_write(call, var_name, call_name, var); [INFO] [stdout] 177 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/compiler/variable.rs:196:41 [INFO] [stdout] | [INFO] [stdout] 196 | self.resubstitution(var_name, &bin, var); [INFO] [stdout] | ^^^^ help: change this to: `bin` [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/compiler/variable.rs:200:42 [INFO] [stdout] | [INFO] [stdout] 200 | let types_cal = self.calcuration(&bin, var_name); [INFO] [stdout] | ^^^^ help: change this to: `bin` [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 seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/compiler/variable.rs:203:9 [INFO] [stdout] | [INFO] [stdout] 203 | / match types_cal { [INFO] [stdout] 204 | | asts::VariableTypes::Strings => { [INFO] [stdout] 205 | | types.change(); [INFO] [stdout] ... | [INFO] [stdout] 208 | | } [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] 203 ~ if let asts::VariableTypes::Strings = types_cal { [INFO] [stdout] 204 + types.change(); [INFO] [stdout] 205 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/compiler/variable.rs:236:9 [INFO] [stdout] | [INFO] [stdout] 236 | num_var.push_str(";"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `num_var.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: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/compiler/variable.rs:249:11 [INFO] [stdout] | [INFO] [stdout] 249 | num_var.push_str("1"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `num_var.push('1')` [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 string literal [INFO] [stdout] --> src/compiler/variable.rs:251:11 [INFO] [stdout] | [INFO] [stdout] 251 | num_var.push_str("0"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `num_var.push('0')` [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 string literal [INFO] [stdout] --> src/compiler/variable.rs:253:9 [INFO] [stdout] | [INFO] [stdout] 253 | num_var.push_str(";"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `num_var.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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/compiler/variable.rs:314:35 [INFO] [stdout] | [INFO] [stdout] 314 | fn array_write(&mut self, arry: &Vec, types: &asts::VariableTypes) { [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] 314 - fn array_write(&mut self, arry: &Vec, types: &asts::VariableTypes) { [INFO] [stdout] 314 + fn array_write(&mut self, arry: &[asts::Types], types: &asts::VariableTypes) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/compiler/variable.rs:407:5 [INFO] [stdout] | [INFO] [stdout] 407 | return types_str; [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] 407 - return types_str; [INFO] [stdout] 407 + types_str [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/compiler/variable.rs:390:9 [INFO] [stdout] | [INFO] [stdout] 390 | types_str.push_str("="); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `types_str.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/compiler/variable.rs:402:37 [INFO] [stdout] | [INFO] [stdout] 402 | let err = error::Error::new(&node); [INFO] [stdout] | ^^^^^ help: change this to: `node` [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/compiler/variable.rs:414:51 [INFO] [stdout] | [INFO] [stdout] 414 | let types_var = self.variable.sertch_type(&var_name).0; [INFO] [stdout] | ^^^^^^^^^ help: change this to: `var_name` [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 match could be written as a `let` statement [INFO] [stdout] --> src/compiler/variable.rs:417:26 [INFO] [stdout] | [INFO] [stdout] 417 | Some(_ts) => match t { [INFO] [stdout] | __________________________^ [INFO] [stdout] 418 | | _ts => { [INFO] [stdout] 419 | | self.write(&format!("{} = {}", var_name, vars.name)); [INFO] [stdout] 420 | | self.write(";"); [INFO] [stdout] 421 | | } [INFO] [stdout] 422 | | }, [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding [INFO] [stdout] = note: `#[warn(clippy::match_single_binding)]` on by default [INFO] [stdout] help: consider using a `let` statement [INFO] [stdout] | [INFO] [stdout] 417 ~ Some(_ts) => { [INFO] [stdout] 418 + let _ts = t; [INFO] [stdout] 419 + self.write(&format!("{} = {}", var_name, vars.name)); [INFO] [stdout] 420 + self.write(";"); [INFO] [stdout] 421 ~ }, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods called `into_*` usually take `self` by value [INFO] [stdout] --> src/compiler/arithmetic.rs:23:22 [INFO] [stdout] | [INFO] [stdout] 23 | pub fn into_string(&mut self) { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] = note: `#[warn(clippy::wrong_self_convention)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/compiler/arithmetic.rs:156:9 [INFO] [stdout] | [INFO] [stdout] 156 | return asts::VariableTypes::Strings; [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] 156 - return asts::VariableTypes::Strings; [INFO] [stdout] 156 + asts::VariableTypes::Strings [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/compiler/arithmetic.rs:160:9 [INFO] [stdout] | [INFO] [stdout] 160 | return asts::VariableTypes::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] 160 - return asts::VariableTypes::Int; [INFO] [stdout] 160 + asts::VariableTypes::Int [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/compiler/arithmetic.rs:41:9 [INFO] [stdout] | [INFO] [stdout] 41 | / if &bin.op.to_string() == op { [INFO] [stdout] 42 | | if op == "+" { [INFO] [stdout] 43 | | self.write(&format!("{}++;", var_name)); [INFO] [stdout] 44 | | }else if op == "-"{ [INFO] [stdout] ... | [INFO] [stdout] 51 | | return asts::VariableTypes::Int; [INFO] [stdout] 52 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 40 ~ asts::Types::Binary(bin) [INFO] [stdout] 41 ~ if &bin.op.to_string() == op => { [INFO] [stdout] 42 | if op == "+" { [INFO] [stdout] ... [INFO] [stdout] 51 | return asts::VariableTypes::Int; [INFO] [stdout] 52 ~ } [INFO] [stdout] | [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/compiler/arithmetic.rs:39:5 [INFO] [stdout] | [INFO] [stdout] 39 | / match in_node { [INFO] [stdout] 40 | | asts::Types::Binary(bin) => { [INFO] [stdout] 41 | | if &bin.op.to_string() == op { [INFO] [stdout] 42 | | if op == "+" { [INFO] [stdout] ... | [INFO] [stdout] 54 | | _ => {} [INFO] [stdout] 55 | | } [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] 39 ~ if let asts::Types::Binary(bin) = in_node { [INFO] [stdout] 40 + if &bin.op.to_string() == op { [INFO] [stdout] 41 + if op == "+" { [INFO] [stdout] 42 + self.write(&format!("{}++;", var_name)); [INFO] [stdout] 43 + }else if op == "-"{ [INFO] [stdout] 44 + self.write(&format!("{}--;", var_name)); [INFO] [stdout] 45 + }else{ [INFO] [stdout] 46 + let err = error::Error::new(node); [INFO] [stdout] 47 + err.exit("type error"); [INFO] [stdout] 48 + } [INFO] [stdout] 49 + [INFO] [stdout] 50 + return asts::VariableTypes::Int; [INFO] [stdout] 51 + } [INFO] [stdout] 52 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/compiler/arithmetic.rs:61:34 [INFO] [stdout] | [INFO] [stdout] 61 | formats.strings.push_str(&op); [INFO] [stdout] | ^^^ help: change this to: `op` [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/compiler/arithmetic.rs:69:11 [INFO] [stdout] | [INFO] [stdout] 69 | formats.strings.push_str(","); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `formats.strings.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: useless use of `format!` [INFO] [stdout] --> src/compiler/arithmetic.rs:89:43 [INFO] [stdout] | [INFO] [stdout] 89 | formats.strings.push_str(&format!("{}", vars.name)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `vars.name.to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/compiler/arithmetic.rs:91:19 [INFO] [stdout] | [INFO] [stdout] 91 | formats.strings.push_str(","); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `formats.strings.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: useless use of `format!` [INFO] [stdout] --> src/compiler/arithmetic.rs:100:43 [INFO] [stdout] | [INFO] [stdout] 100 | formats.strings.push_str(&format!("{}", vars.name)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `vars.name.to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/compiler/arithmetic.rs:101:42 [INFO] [stdout] | [INFO] [stdout] 101 | formats.strings.push_str(&op); [INFO] [stdout] | ^^^ help: change this to: `op` [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 seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/compiler/arithmetic.rs:146:5 [INFO] [stdout] | [INFO] [stdout] 146 | / match reg.captures(&formats.strings) { [INFO] [stdout] 147 | | Some(_) => { [INFO] [stdout] 148 | | return asts::VariableTypes::Bool; [INFO] [stdout] ... | [INFO] [stdout] 151 | | } [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] 146 ~ if let Some(_) = reg.captures(&formats.strings) { [INFO] [stdout] 147 + return asts::VariableTypes::Bool; [INFO] [stdout] 148 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/compiler/arithmetic.rs:183:9 [INFO] [stdout] | [INFO] [stdout] 183 | return; [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] 182 - self.calcuration_write(&strings.node[0], foramts, &asts::VariableTypes::Strings); [INFO] [stdout] 183 - return; [INFO] [stdout] 182 + self.calcuration_write(&strings.node[0], foramts, &asts::VariableTypes::Strings); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/compiler/arithmetic.rs:201:9 [INFO] [stdout] | [INFO] [stdout] 201 | return; [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] 200 - self.calcuration_write(&num.node[0], foramts, &asts::VariableTypes::Int); [INFO] [stdout] 201 - return; [INFO] [stdout] 200 + self.calcuration_write(&num.node[0], foramts, &asts::VariableTypes::Int); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/compiler/arithmetic.rs:242:9 [INFO] [stdout] | [INFO] [stdout] 242 | return; [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] 241 - } [INFO] [stdout] 242 - return; [INFO] [stdout] 241 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/compiler/arithmetic.rs:294:9 [INFO] [stdout] | [INFO] [stdout] 294 | return; [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] 293 - } [INFO] [stdout] 294 - return; [INFO] [stdout] 293 + } [INFO] [stdout] | [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/compiler/arithmetic.rs:189:9 [INFO] [stdout] | [INFO] [stdout] 189 | / match types { [INFO] [stdout] 190 | | asts::VariableTypes::Strings => { [INFO] [stdout] 191 | | foramts.formats.push_str("%d"); [INFO] [stdout] ... | [INFO] [stdout] 194 | | } [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] 189 ~ if let asts::VariableTypes::Strings = types { [INFO] [stdout] 190 + foramts.formats.push_str("%d"); [INFO] [stdout] 191 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/compiler/arithmetic.rs:210:15 [INFO] [stdout] | [INFO] [stdout] 210 | foramts.strings.push_str(","); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `foramts.strings.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: calling `push_str()` using a single-character converted to string [INFO] [stdout] --> src/compiler/arithmetic.rs:217:13 [INFO] [stdout] | [INFO] [stdout] 217 | foramts.strings.push_str(&bin.op.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` without `to_string()`: `foramts.strings.push(bin.op)` [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: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/compiler/arithmetic.rs:219:15 [INFO] [stdout] | [INFO] [stdout] 219 | / match bin.node[1].clone() { [INFO] [stdout] 220 | | asts::Types::Binary(bin) => { [INFO] [stdout] 221 | | foramts.strings.push_str(&bin.op.to_string()); [INFO] [stdout] ... | [INFO] [stdout] 224 | | _ => {} [INFO] [stdout] 225 | | } [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] 219 ~ if let asts::Types::Binary(bin) = bin.node[1].clone() { [INFO] [stdout] 220 + foramts.strings.push_str(&bin.op.to_string()); [INFO] [stdout] 221 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character converted to string [INFO] [stdout] --> src/compiler/arithmetic.rs:221:19 [INFO] [stdout] | [INFO] [stdout] 221 | foramts.strings.push_str(&bin.op.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` without `to_string()`: `foramts.strings.push(bin.op)` [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/compiler/ifs.rs:13:32 [INFO] [stdout] | [INFO] [stdout] 13 | match self.calcuration(&bin, tmp){ [INFO] [stdout] | ^^^^ help: change this to: `bin` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/compiler/fors.rs:59:32 [INFO] [stdout] | [INFO] [stdout] 59 | fn fors_juge(&mut self, node:&Vec, op:Option) { [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] 59 - fn fors_juge(&mut self, node:&Vec, op:Option) { [INFO] [stdout] 59 + fn fors_juge(&mut self, node:&[asts::Types], op:Option) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 3.70s [INFO] running `Command { std: "docker" "inspect" "740e28409e5db65cd296eff7ca885c9304c062a40820e04fed8dbb94e52b1219", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "740e28409e5db65cd296eff7ca885c9304c062a40820e04fed8dbb94e52b1219", kill_on_drop: false }` [INFO] [stdout] 740e28409e5db65cd296eff7ca885c9304c062a40820e04fed8dbb94e52b1219