[INFO] cloning repository https://github.com/xiaoguaixu/rust-monkey [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/xiaoguaixu/rust-monkey" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fxiaoguaixu%2Frust-monkey", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fxiaoguaixu%2Frust-monkey'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] d9e2c975fd7c22cad9cca9a563770cc6ccbd254c [INFO] linting xiaoguaixu/rust-monkey against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fxiaoguaixu%2Frust-monkey" "/workspace/builds/worker-1-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-1-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/xiaoguaixu/rust-monkey [INFO] finished tweaking git repo https://github.com/xiaoguaixu/rust-monkey [INFO] tweaked toml for git repo https://github.com/xiaoguaixu/rust-monkey written to /workspace/builds/worker-1-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/xiaoguaixu/rust-monkey 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/xiaoguaixu/rust-monkey already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Blocking waiting for file lock on package cache [INFO] [stderr] Blocking waiting for file lock on package cache [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] 7858fe3bd9d50ffa4c797229e477e349fd021dfd137d2b8670e316a3bb8023e1 [INFO] running `Command { std: "docker" "start" "-a" "7858fe3bd9d50ffa4c797229e477e349fd021dfd137d2b8670e316a3bb8023e1", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "7858fe3bd9d50ffa4c797229e477e349fd021dfd137d2b8670e316a3bb8023e1", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "7858fe3bd9d50ffa4c797229e477e349fd021dfd137d2b8670e316a3bb8023e1", kill_on_drop: false }` [INFO] [stdout] 7858fe3bd9d50ffa4c797229e477e349fd021dfd137d2b8670e316a3bb8023e1 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "clippy" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 3f7ba356ec93a47057f40e32d4309adb695e94d8d9c86830146b73e4a110c397 [INFO] running `Command { std: "docker" "start" "-a" "3f7ba356ec93a47057f40e32d4309adb695e94d8d9c86830146b73e4a110c397", kill_on_drop: false }` [INFO] [stderr] Compiling proc-macro2 v1.0.69 [INFO] [stderr] Compiling unicode-ident v1.0.12 [INFO] [stderr] Compiling siphasher v0.3.11 [INFO] [stderr] Compiling paste v1.0.14 [INFO] [stderr] Checking once_cell v1.18.0 [INFO] [stderr] Checking phf_shared v0.11.2 [INFO] [stderr] Compiling phf_generator v0.11.2 [INFO] [stderr] Compiling quote v1.0.33 [INFO] [stderr] Compiling syn v2.0.38 [INFO] [stderr] Compiling phf_macros v0.11.2 [INFO] [stderr] Checking phf v0.11.2 [INFO] [stderr] Checking rust-monkey v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: method `as_any_mut` is never used [INFO] [stdout] --> src/object/base.rs:32:8 [INFO] [stdout] | [INFO] [stdout] 30 | pub trait Downcast { [INFO] [stdout] | -------- method in this trait [INFO] [stdout] 31 | fn as_any(&self) -> &dyn Any; [INFO] [stdout] 32 | fn as_any_mut(&mut self) -> &mut dyn Any; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `as_any_mut` is never used [INFO] [stdout] --> src/ast/base.rs:9:8 [INFO] [stdout] | [INFO] [stdout] 3 | pub trait Node { [INFO] [stdout] | ---- method in this trait [INFO] [stdout] ... [INFO] [stdout] 9 | fn as_any_mut(&mut self) -> &mut dyn Any; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `statement_node` is never used [INFO] [stdout] --> src/ast/base.rs:13:8 [INFO] [stdout] | [INFO] [stdout] 12 | pub trait Statement: Node { [INFO] [stdout] | --------- method in this trait [INFO] [stdout] 13 | fn statement_node(&self); [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `expression_node` is never used [INFO] [stdout] --> src/ast/base.rs:18:8 [INFO] [stdout] | [INFO] [stdout] 17 | pub trait Expression: Node { [INFO] [stdout] | ---------- method in this trait [INFO] [stdout] 18 | fn expression_node(&self); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait `Upcast` is never used [INFO] [stdout] --> src/ast/base.rs:22:11 [INFO] [stdout] | [INFO] [stdout] 22 | pub trait Upcast { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/token/mod.rs:87:28 [INFO] [stdout] | [INFO] [stdout] 87 | pub fn lookup_ident(ident: &String) -> TokenType { [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] 87 ~ pub fn lookup_ident(ident: &str) -> TokenType { [INFO] [stdout] 88 | // match KEYWORDS.get(ident.as_str()) { [INFO] [stdout] ... [INFO] [stdout] 95 | KEYWORDS.with(|val| { [INFO] [stdout] 96 ~ if let Some(v) = val.get(ident) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/token/mod.rs:99:9 [INFO] [stdout] | [INFO] [stdout] 99 | return token::IDENT.to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 99 - return token::IDENT.to_string(); [INFO] [stdout] 99 + token::IDENT.to_string() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/lexer/mod.rs:14:23 [INFO] [stdout] | [INFO] [stdout] 14 | pub fn new(input: &String) -> Self { [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] 14 ~ pub fn new(input: &str) -> Self { [INFO] [stdout] 15 | let mut l = Self { [INFO] [stdout] 16 ~ input: input.to_owned(), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/lexer/mod.rs:143:9 [INFO] [stdout] | [INFO] [stdout] 143 | / return if self.read_position >= self.input.len() { [INFO] [stdout] 144 | | '\0' [INFO] [stdout] 145 | | } else { [INFO] [stdout] 146 | | self.input.chars().nth(self.read_position).unwrap() [INFO] [stdout] 147 | | }; [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] 143 ~ if self.read_position >= self.input.len() { [INFO] [stdout] 144 + '\0' [INFO] [stdout] 145 + } else { [INFO] [stdout] 146 + self.input.chars().nth(self.read_position).unwrap() [INFO] [stdout] 147 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/lexer/mod.rs:179:9 [INFO] [stdout] | [INFO] [stdout] 179 | / return token::Token { [INFO] [stdout] 180 | | token_type: token_type.clone(), [INFO] [stdout] 181 | | literal: ch.to_string(), [INFO] [stdout] 182 | | }; [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] 179 ~ token::Token { [INFO] [stdout] 180 + token_type: token_type.clone(), [INFO] [stdout] 181 + literal: ch.to_string(), [INFO] [stdout] 182 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/lexer/mod.rs:186:9 [INFO] [stdout] | [INFO] [stdout] 186 | / return token::Token { [INFO] [stdout] 187 | | token_type: token_type.clone(), [INFO] [stdout] 188 | | literal: literal.clone(), [INFO] [stdout] 189 | | }; [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] 186 ~ token::Token { [INFO] [stdout] 187 + token_type: token_type.clone(), [INFO] [stdout] 188 + literal: literal.clone(), [INFO] [stdout] 189 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/lexer/mod.rs:185:61 [INFO] [stdout] | [INFO] [stdout] 185 | fn new_token_ex(token_type: &token::TokenType, literal: &String) -> token::Token { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 185 ~ fn new_token_ex(token_type: &token::TokenType, literal: &str) -> token::Token { [INFO] [stdout] 186 | return token::Token { [INFO] [stdout] 187 | token_type: token_type.clone(), [INFO] [stdout] 188 ~ literal: literal.to_owned(), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/lexer/mod.rs:193:9 [INFO] [stdout] | [INFO] [stdout] 193 | return 'a' <= ch && ch <= 'z' || 'A' <= ch && ch <= 'Z' || ch == '_'; [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] 193 - return 'a' <= ch && ch <= 'z' || 'A' <= ch && ch <= 'Z' || ch == '_'; [INFO] [stdout] 193 + 'a' <= ch && ch <= 'z' || 'A' <= ch && ch <= 'Z' || ch == '_' [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/lexer/mod.rs:193:16 [INFO] [stdout] | [INFO] [stdout] 193 | return 'a' <= ch && ch <= 'z' || 'A' <= ch && ch <= 'Z' || ch == '_'; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: use: `('a'..='z').contains(&ch)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] = note: `#[warn(clippy::manual_range_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/lexer/mod.rs:193:42 [INFO] [stdout] | [INFO] [stdout] 193 | return 'a' <= ch && ch <= 'z' || 'A' <= ch && ch <= 'Z' || ch == '_'; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: use: `('A'..='Z').contains(&ch)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/lexer/mod.rs:197:9 [INFO] [stdout] | [INFO] [stdout] 197 | return '0' <= ch && ch <= '9'; [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 '0' <= ch && ch <= '9'; [INFO] [stdout] 197 + '0' <= ch && ch <= '9' [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/lexer/mod.rs:197:16 [INFO] [stdout] | [INFO] [stdout] 197 | return '0' <= ch && ch <= '9'; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: use: `('0'..='9').contains(&ch)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/object/environment.rs:28:9 [INFO] [stdout] | [INFO] [stdout] 28 | / return match self.store.get(name) { [INFO] [stdout] 29 | | None => { [INFO] [stdout] 30 | | match &self.outer { [INFO] [stdout] 31 | | None => { None } [INFO] [stdout] ... | [INFO] [stdout] 37 | | Some(v) => { Some(v) } [INFO] [stdout] 38 | | }; [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] 28 ~ match self.store.get(name) { [INFO] [stdout] 29 + None => { [INFO] [stdout] 30 + match &self.outer { [INFO] [stdout] 31 + None => { None } [INFO] [stdout] 32 + Some(v) => { [INFO] [stdout] 33 + v.get(name) [INFO] [stdout] 34 + } [INFO] [stdout] 35 + } [INFO] [stdout] 36 + } [INFO] [stdout] 37 + Some(v) => { Some(v) } [INFO] [stdout] 38 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/object/mod.rs:41:9 [INFO] [stdout] | [INFO] [stdout] 41 | return INTEGER_OBJ; [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] 41 - return INTEGER_OBJ; [INFO] [stdout] 41 + INTEGER_OBJ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/object/mod.rs:66:9 [INFO] [stdout] | [INFO] [stdout] 66 | return BOOLEAN_OBJ; [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] 66 - return BOOLEAN_OBJ; [INFO] [stdout] 66 + BOOLEAN_OBJ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `NULL` contains a capitalized acronym [INFO] [stdout] --> src/object/mod.rs:83:12 [INFO] [stdout] | [INFO] [stdout] 83 | pub struct NULL {} [INFO] [stdout] | ^^^^ help: consider making the acronym lowercase, except the initial letter: `Null` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] = note: `#[warn(clippy::upper_case_acronyms)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/object/mod.rs:89:9 [INFO] [stdout] | [INFO] [stdout] 89 | return NULL_OBJ; [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] 89 - return NULL_OBJ; [INFO] [stdout] 89 + NULL_OBJ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/object/mod.rs:105:9 [INFO] [stdout] | [INFO] [stdout] 105 | return RETURN_VALUE_OBJ; [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] 105 - return RETURN_VALUE_OBJ; [INFO] [stdout] 105 + RETURN_VALUE_OBJ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/object/mod.rs:121:9 [INFO] [stdout] | [INFO] [stdout] 121 | return ERROR_OBJ; [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] 121 - return ERROR_OBJ; [INFO] [stdout] 121 + ERROR_OBJ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/object/mod.rs:139:9 [INFO] [stdout] | [INFO] [stdout] 139 | return FUNCTION_OBJ; [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] 139 - return FUNCTION_OBJ; [INFO] [stdout] 139 + FUNCTION_OBJ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/object/mod.rs:159:9 [INFO] [stdout] | [INFO] [stdout] 159 | return STRING_OBJ; [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] 159 - return STRING_OBJ; [INFO] [stdout] 159 + STRING_OBJ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/object/mod.rs:171:20 [INFO] [stdout] | [INFO] [stdout] 171 | value: format!("{}", self.value), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `self.value.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: unneeded `return` statement [INFO] [stdout] --> src/object/mod.rs:184:9 [INFO] [stdout] | [INFO] [stdout] 184 | return BUILTIN_OBJ; [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 BUILTIN_OBJ; [INFO] [stdout] 184 + BUILTIN_OBJ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/object/mod.rs:200:9 [INFO] [stdout] | [INFO] [stdout] 200 | return ARRAY_OBJ; [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 - return ARRAY_OBJ; [INFO] [stdout] 200 + ARRAY_OBJ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/object/mod.rs:226:9 [INFO] [stdout] | [INFO] [stdout] 226 | return HASH_OBJ; [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] 226 - return HASH_OBJ; [INFO] [stdout] 226 + HASH_OBJ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/util/mod.rs:31:9 [INFO] [stdout] | [INFO] [stdout] 31 | / return match self { [INFO] [stdout] 32 | | VariantValue::ValueInt(v) => { *v } [INFO] [stdout] 33 | | _ => { 0 } [INFO] [stdout] 34 | | }; [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] 31 ~ match self { [INFO] [stdout] 32 + VariantValue::ValueInt(v) => { *v } [INFO] [stdout] 33 + _ => { 0 } [INFO] [stdout] 34 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/util/mod.rs:38:9 [INFO] [stdout] | [INFO] [stdout] 38 | / return match self { [INFO] [stdout] 39 | | VariantValue::ValueString(v) => { v.clone() } [INFO] [stdout] 40 | | _ => { "".to_string() } [INFO] [stdout] 41 | | }; [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] 38 ~ match self { [INFO] [stdout] 39 + VariantValue::ValueString(v) => { v.clone() } [INFO] [stdout] 40 + _ => { "".to_string() } [INFO] [stdout] 41 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/util/mod.rs:45:9 [INFO] [stdout] | [INFO] [stdout] 45 | / return match self { [INFO] [stdout] 46 | | VariantValue::ValueBool(v) => { *v } [INFO] [stdout] 47 | | _ => { false } [INFO] [stdout] 48 | | }; [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 ~ match self { [INFO] [stdout] 46 + VariantValue::ValueBool(v) => { *v } [INFO] [stdout] 47 + _ => { false } [INFO] [stdout] 48 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/ast/expression.rs:22:36 [INFO] [stdout] | [INFO] [stdout] 22 | pub fn from_expression<'a>(expression: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] ... [INFO] [stdout] 46 | express_trait_impl!(Identifier); [INFO] [stdout] | ------------------------------- in this macro invocation [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: `#[warn(clippy::needless_lifetimes)]` on by default [INFO] [stdout] = note: this warning originates in the macro `express_trait_impl` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 22 - pub fn from_expression<'a>(expression: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] 22 + pub fn from_expression(expression: &Rc ) -> Option<& $impl_name> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/ast/expression.rs:22:36 [INFO] [stdout] | [INFO] [stdout] 22 | pub fn from_expression<'a>(expression: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] ... [INFO] [stdout] 62 | express_trait_impl!(Boolean); [INFO] [stdout] | ---------------------------- in this macro invocation [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: this warning originates in the macro `express_trait_impl` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 22 - pub fn from_expression<'a>(expression: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] 22 + pub fn from_expression(expression: &Rc ) -> Option<& $impl_name> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/ast/expression.rs:22:36 [INFO] [stdout] | [INFO] [stdout] 22 | pub fn from_expression<'a>(expression: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] ... [INFO] [stdout] 78 | express_trait_impl!(IntegerLiteral); [INFO] [stdout] | ----------------------------------- in this macro invocation [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: this warning originates in the macro `express_trait_impl` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 22 - pub fn from_expression<'a>(expression: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] 22 + pub fn from_expression(expression: &Rc ) -> Option<& $impl_name> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/ast/expression.rs:22:36 [INFO] [stdout] | [INFO] [stdout] 22 | pub fn from_expression<'a>(expression: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] ... [INFO] [stdout] 95 | express_trait_impl!(PrefixExpression); [INFO] [stdout] | ------------------------------------- in this macro invocation [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: this warning originates in the macro `express_trait_impl` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 22 - pub fn from_expression<'a>(expression: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] 22 + pub fn from_expression(expression: &Rc ) -> Option<& $impl_name> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/ast/expression.rs:22:36 [INFO] [stdout] | [INFO] [stdout] 22 | pub fn from_expression<'a>(expression: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] ... [INFO] [stdout] 113 | express_trait_impl!(InfixExpression); [INFO] [stdout] | ------------------------------------ in this macro invocation [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: this warning originates in the macro `express_trait_impl` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 22 - pub fn from_expression<'a>(expression: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] 22 + pub fn from_expression(expression: &Rc ) -> Option<& $impl_name> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/ast/expression.rs:22:36 [INFO] [stdout] | [INFO] [stdout] 22 | pub fn from_expression<'a>(expression: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] ... [INFO] [stdout] 138 | express_trait_impl!(IfExpression); [INFO] [stdout] | --------------------------------- in this macro invocation [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: this warning originates in the macro `express_trait_impl` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 22 - pub fn from_expression<'a>(expression: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] 22 + pub fn from_expression(expression: &Rc ) -> Option<& $impl_name> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/ast/expression.rs:22:36 [INFO] [stdout] | [INFO] [stdout] 22 | pub fn from_expression<'a>(expression: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] ... [INFO] [stdout] 159 | express_trait_impl!(FunctionLiteral); [INFO] [stdout] | ------------------------------------ in this macro invocation [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: this warning originates in the macro `express_trait_impl` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 22 - pub fn from_expression<'a>(expression: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] 22 + pub fn from_expression(expression: &Rc ) -> Option<& $impl_name> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/ast/expression.rs:22:36 [INFO] [stdout] | [INFO] [stdout] 22 | pub fn from_expression<'a>(expression: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] ... [INFO] [stdout] 179 | express_trait_impl!(CallExpression); [INFO] [stdout] | ----------------------------------- in this macro invocation [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: this warning originates in the macro `express_trait_impl` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 22 - pub fn from_expression<'a>(expression: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] 22 + pub fn from_expression(expression: &Rc ) -> Option<& $impl_name> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/ast/expression.rs:22:36 [INFO] [stdout] | [INFO] [stdout] 22 | pub fn from_expression<'a>(expression: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] ... [INFO] [stdout] 193 | express_trait_impl!(StringLiteral); [INFO] [stdout] | ---------------------------------- in this macro invocation [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: this warning originates in the macro `express_trait_impl` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 22 - pub fn from_expression<'a>(expression: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] 22 + pub fn from_expression(expression: &Rc ) -> Option<& $impl_name> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/ast/expression.rs:22:36 [INFO] [stdout] | [INFO] [stdout] 22 | pub fn from_expression<'a>(expression: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] ... [INFO] [stdout] 211 | express_trait_impl!(ArrayLiteral); [INFO] [stdout] | --------------------------------- in this macro invocation [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: this warning originates in the macro `express_trait_impl` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 22 - pub fn from_expression<'a>(expression: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] 22 + pub fn from_expression(expression: &Rc ) -> Option<& $impl_name> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/ast/expression.rs:22:36 [INFO] [stdout] | [INFO] [stdout] 22 | pub fn from_expression<'a>(expression: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] ... [INFO] [stdout] 226 | express_trait_impl!(IndexExpression); [INFO] [stdout] | ------------------------------------ in this macro invocation [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: this warning originates in the macro `express_trait_impl` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 22 - pub fn from_expression<'a>(expression: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] 22 + pub fn from_expression(expression: &Rc ) -> Option<& $impl_name> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/ast/expression.rs:22:36 [INFO] [stdout] | [INFO] [stdout] 22 | pub fn from_expression<'a>(expression: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] ... [INFO] [stdout] 245 | express_trait_impl!(HashLiteral); [INFO] [stdout] | -------------------------------- in this macro invocation [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: this warning originates in the macro `express_trait_impl` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 22 - pub fn from_expression<'a>(expression: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] 22 + pub fn from_expression(expression: &Rc ) -> Option<& $impl_name> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/ast/statement.rs:21:35 [INFO] [stdout] | [INFO] [stdout] 21 | pub fn from_statement<'a>(statement: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] ... [INFO] [stdout] 51 | macro_statement_trait_impl!(LetStatement); [INFO] [stdout] | ----------------------------------------- in this macro invocation [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: this warning originates in the macro `macro_statement_trait_impl` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 21 - pub fn from_statement<'a>(statement: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] 21 + pub fn from_statement(statement: &Rc ) -> Option<& $impl_name> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/ast/statement.rs:21:35 [INFO] [stdout] | [INFO] [stdout] 21 | pub fn from_statement<'a>(statement: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] ... [INFO] [stdout] 72 | macro_statement_trait_impl!(ReturnStatement); [INFO] [stdout] | -------------------------------------------- in this macro invocation [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: this warning originates in the macro `macro_statement_trait_impl` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 21 - pub fn from_statement<'a>(statement: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] 21 + pub fn from_statement(statement: &Rc ) -> Option<& $impl_name> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/ast/statement.rs:21:35 [INFO] [stdout] | [INFO] [stdout] 21 | pub fn from_statement<'a>(statement: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] ... [INFO] [stdout] 86 | macro_statement_trait_impl!(ExpressionStatement); [INFO] [stdout] | ------------------------------------------------ in this macro invocation [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: this warning originates in the macro `macro_statement_trait_impl` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 21 - pub fn from_statement<'a>(statement: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] 21 + pub fn from_statement(statement: &Rc ) -> Option<& $impl_name> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/ast/statement.rs:98:13 [INFO] [stdout] | [INFO] [stdout] 98 | rlt = rlt + v.string().as_str(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `rlt += v.string().as_str()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/ast/statement.rs:21:35 [INFO] [stdout] | [INFO] [stdout] 21 | pub fn from_statement<'a>(statement: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] ... [INFO] [stdout] 105 | macro_statement_trait_impl!(BlockStatement); [INFO] [stdout] | ------------------------------------------- in this macro invocation [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: this warning originates in the macro `macro_statement_trait_impl` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 21 - pub fn from_statement<'a>(statement: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] 21 + pub fn from_statement(statement: &Rc ) -> Option<& $impl_name> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/ast/program.rs:32:13 [INFO] [stdout] | [INFO] [stdout] 32 | rlt = rlt + v.string().as_str(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `rlt += v.string().as_str()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/repl/mod.rs:18:12 [INFO] [stdout] | [INFO] [stdout] 18 | if p.errors().len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!p.errors().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: literal with an empty format string [INFO] [stdout] --> src/repl/mod.rs:48:20 [INFO] [stdout] | [INFO] [stdout] 48 | println!("{}", "Woops! We ran into some monkey business here!"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_literal [INFO] [stdout] = note: `#[warn(clippy::print_literal)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 48 - println!("{}", "Woops! We ran into some monkey business here!"); [INFO] [stdout] 48 + println!("Woops! We ran into some monkey business here!"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: literal with an empty format string [INFO] [stdout] --> src/repl/mod.rs:49:20 [INFO] [stdout] | [INFO] [stdout] 49 | println!("{}", " parser errors:"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_literal [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 49 - println!("{}", " parser errors:"); [INFO] [stdout] 49 + println!(" parser errors:"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `LOWEST` contains a capitalized acronym [INFO] [stdout] --> src/parser/base.rs:11:5 [INFO] [stdout] | [INFO] [stdout] 11 | LOWEST = 1, [INFO] [stdout] | ^^^^^^ help: consider making the acronym lowercase, except the initial letter: `Lowest` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `EQUALS` contains a capitalized acronym [INFO] [stdout] --> src/parser/base.rs:12:5 [INFO] [stdout] | [INFO] [stdout] 12 | EQUALS, [INFO] [stdout] | ^^^^^^ help: consider making the acronym lowercase, except the initial letter: `Equals` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `LESSGREATER` contains a capitalized acronym [INFO] [stdout] --> src/parser/base.rs:14:5 [INFO] [stdout] | [INFO] [stdout] 14 | LESSGREATER, [INFO] [stdout] | ^^^^^^^^^^^ help: consider making the acronym lowercase, except the initial letter: `Lessgreater` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `SUM` contains a capitalized acronym [INFO] [stdout] --> src/parser/base.rs:16:5 [INFO] [stdout] | [INFO] [stdout] 16 | SUM, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Sum` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `PRODUCT` contains a capitalized acronym [INFO] [stdout] --> src/parser/base.rs:18:5 [INFO] [stdout] | [INFO] [stdout] 18 | PRODUCT, [INFO] [stdout] | ^^^^^^^ help: consider making the acronym lowercase, except the initial letter: `Product` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `PREFIX` contains a capitalized acronym [INFO] [stdout] --> src/parser/base.rs:20:5 [INFO] [stdout] | [INFO] [stdout] 20 | PREFIX, [INFO] [stdout] | ^^^^^^ help: consider making the acronym lowercase, except the initial letter: `Prefix` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `CALL` contains a capitalized acronym [INFO] [stdout] --> src/parser/base.rs:22:5 [INFO] [stdout] | [INFO] [stdout] 22 | CALL, [INFO] [stdout] | ^^^^ help: consider making the acronym lowercase, except the initial letter: `Call` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `INDEX` contains a capitalized acronym [INFO] [stdout] --> src/parser/base.rs:24:5 [INFO] [stdout] | [INFO] [stdout] 24 | INDEX, // array[index] [INFO] [stdout] | ^^^^^ help: consider making the acronym lowercase, except the initial letter: `Index` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `statement` after checking its variant with `is_some` [INFO] [stdout] --> src/parser/func.rs:16:37 [INFO] [stdout] | [INFO] [stdout] 15 | if statement.is_some() { [INFO] [stdout] | ---------------------- help: try: `if let Some() = statement` [INFO] [stdout] 16 | program.statements.push(statement.unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `expression` after checking its variant with `is_some` [INFO] [stdout] --> src/parser/func_base.rs:91:30 [INFO] [stdout] | [INFO] [stdout] 90 | if expression.is_some() { [INFO] [stdout] | ----------------------- help: try: `if let Some() = expression` [INFO] [stdout] 91 | expressions.push(expression.unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this block may be rewritten with the `?` operator [INFO] [stdout] --> src/parser/func_prefix.rs:184:9 [INFO] [stdout] | [INFO] [stdout] 184 | / if key.is_none() { [INFO] [stdout] 185 | | return None; [INFO] [stdout] 186 | | } [INFO] [stdout] | |_________^ help: replace it with: `key.as_ref()?;` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] = note: `#[warn(clippy::question_mark)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this block may be rewritten with the `?` operator [INFO] [stdout] --> src/parser/func_prefix.rs:196:9 [INFO] [stdout] | [INFO] [stdout] 196 | / if value.is_none() { [INFO] [stdout] 197 | | return None; [INFO] [stdout] 198 | | } [INFO] [stdout] | |_________^ help: replace it with: `value.as_ref()?;` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/evaluator/base.rs:5:5 [INFO] [stdout] | [INFO] [stdout] 5 | / return if obj.as_any().is::() { [INFO] [stdout] 6 | | true [INFO] [stdout] 7 | | } else { [INFO] [stdout] 8 | | false [INFO] [stdout] 9 | | }; [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] 5 ~ if obj.as_any().is::() { [INFO] [stdout] 6 + true [INFO] [stdout] 7 + } else { [INFO] [stdout] 8 + false [INFO] [stdout] 9 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/evaluator/base.rs:5:12 [INFO] [stdout] | [INFO] [stdout] 5 | return if obj.as_any().is::() { [INFO] [stdout] | ____________^ [INFO] [stdout] 6 | | true [INFO] [stdout] 7 | | } else { [INFO] [stdout] 8 | | false [INFO] [stdout] 9 | | }; [INFO] [stdout] | |_____^ help: you can reduce it to: `obj.as_any().is::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [INFO] [stdout] = note: `#[warn(clippy::needless_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/evaluator/base.rs:14:5 [INFO] [stdout] | [INFO] [stdout] 14 | / return if xx.is::() { [INFO] [stdout] 15 | | false [INFO] [stdout] 16 | | } else if xx.is::() { [INFO] [stdout] 17 | | xx.downcast_ref::().unwrap().value [INFO] [stdout] 18 | | } else { 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] 14 ~ if xx.is::() { [INFO] [stdout] 15 + false [INFO] [stdout] 16 + } else if xx.is::() { [INFO] [stdout] 17 + xx.downcast_ref::().unwrap().value [INFO] [stdout] 18 ~ } else { false } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/evaluator/builtins.rs:15:5 [INFO] [stdout] | [INFO] [stdout] 15 | / return if any.is::() { [INFO] [stdout] 16 | | let value = any.downcast_ref::().unwrap(); [INFO] [stdout] 17 | | Some(Rc::new(object::Integer { [INFO] [stdout] 18 | | value: value.elements.len() as i64, [INFO] [stdout] ... | [INFO] [stdout] 27 | | args[0].object_type())) [INFO] [stdout] 28 | | } [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] 15 ~ if any.is::() { [INFO] [stdout] 16 + let value = any.downcast_ref::().unwrap(); [INFO] [stdout] 17 + Some(Rc::new(object::Integer { [INFO] [stdout] 18 + value: value.elements.len() as i64, [INFO] [stdout] 19 + })) [INFO] [stdout] 20 + } else if any.is::() { [INFO] [stdout] 21 + let value = any.downcast_ref::().unwrap(); [INFO] [stdout] 22 + Some(Rc::new(object::Integer { [INFO] [stdout] 23 + value: value.value.len() as i64, [INFO] [stdout] 24 + })) [INFO] [stdout] 25 + } else { [INFO] [stdout] 26 + new_error(format!("argument to `len` not supported, got {}", [INFO] [stdout] 27 + args[0].object_type())) [INFO] [stdout] 28 + } [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/evaluator/builtins.rs:8:14 [INFO] [stdout] | [INFO] [stdout] 8 | fn len(args: &Vec>) -> 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] 8 - fn len(args: &Vec>) -> Option> { [INFO] [stdout] 8 + fn len(args: &[Rc]) -> Option> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/evaluator/builtins.rs:45:5 [INFO] [stdout] | [INFO] [stdout] 45 | / return if any.is::() { [INFO] [stdout] 46 | | let v = any.downcast_ref::().unwrap(); [INFO] [stdout] 47 | | if v.elements.len() > 0 { [INFO] [stdout] 48 | | Some(v.elements[0].clone()) [INFO] [stdout] ... | [INFO] [stdout] 54 | | args[0].object_type())) [INFO] [stdout] 55 | | }; [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 ~ if any.is::() { [INFO] [stdout] 46 + let v = any.downcast_ref::().unwrap(); [INFO] [stdout] 47 + if v.elements.len() > 0 { [INFO] [stdout] 48 + Some(v.elements[0].clone()) [INFO] [stdout] 49 + } else { [INFO] [stdout] 50 + None [INFO] [stdout] 51 + } [INFO] [stdout] 52 + } else { [INFO] [stdout] 53 + new_error(format!("argument to `first` must be ARRAY, got {}", [INFO] [stdout] 54 + args[0].object_type())) [INFO] [stdout] 55 ~ } [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/evaluator/builtins.rs:38:16 [INFO] [stdout] | [INFO] [stdout] 38 | fn first(args: &Vec>) -> 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] 38 - fn first(args: &Vec>) -> Option>{ [INFO] [stdout] 38 + fn first(args: &[Rc]) -> Option>{ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/evaluator/builtins.rs:47:12 [INFO] [stdout] | [INFO] [stdout] 47 | if v.elements.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!v.elements.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/evaluator/builtins.rs:65:5 [INFO] [stdout] | [INFO] [stdout] 65 | / return if any.is::() { [INFO] [stdout] 66 | | let v = any.downcast_ref::().unwrap(); [INFO] [stdout] 67 | | if v.elements.len() > 1 { [INFO] [stdout] 68 | | Some(v.elements[v.elements.len() - 1].clone()) [INFO] [stdout] ... | [INFO] [stdout] 74 | | args[0].object_type())) [INFO] [stdout] 75 | | }; [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] 65 ~ if any.is::() { [INFO] [stdout] 66 + let v = any.downcast_ref::().unwrap(); [INFO] [stdout] 67 + if v.elements.len() > 1 { [INFO] [stdout] 68 + Some(v.elements[v.elements.len() - 1].clone()) [INFO] [stdout] 69 + } else { [INFO] [stdout] 70 + None [INFO] [stdout] 71 + } [INFO] [stdout] 72 + } else { [INFO] [stdout] 73 + new_error(format!("argument to `last` must be ARRAY, got {}", [INFO] [stdout] 74 + args[0].object_type())) [INFO] [stdout] 75 ~ } [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/evaluator/builtins.rs:58:15 [INFO] [stdout] | [INFO] [stdout] 58 | fn last(args: &Vec>) -> 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] 58 - fn last(args: &Vec>) -> Option> { [INFO] [stdout] 58 + fn last(args: &[Rc]) -> Option> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/evaluator/builtins.rs:85:5 [INFO] [stdout] | [INFO] [stdout] 85 | / return if any.is::() { [INFO] [stdout] 86 | | let v = any.downcast_ref::().unwrap(); [INFO] [stdout] 87 | | let length = v.elements.len(); [INFO] [stdout] 88 | | if length > 0 { [INFO] [stdout] ... | [INFO] [stdout] 101 | | args[0].object_type())) [INFO] [stdout] 102 | | }; [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] 85 ~ if any.is::() { [INFO] [stdout] 86 + let v = any.downcast_ref::().unwrap(); [INFO] [stdout] 87 + let length = v.elements.len(); [INFO] [stdout] 88 + if length > 0 { [INFO] [stdout] 89 + let mut ary: Vec> = vec![]; [INFO] [stdout] 90 + for i in 1..length { [INFO] [stdout] 91 + ary.push(v.elements[i].clone()); [INFO] [stdout] 92 + } [INFO] [stdout] 93 + Some(Rc::new(object::Array { [INFO] [stdout] 94 + elements: ary, [INFO] [stdout] 95 + })) [INFO] [stdout] 96 + } else { [INFO] [stdout] 97 + None [INFO] [stdout] 98 + } [INFO] [stdout] 99 + } else { [INFO] [stdout] 100 + new_error(format!("argument to `first` must be ARRAY, got {}", [INFO] [stdout] 101 + args[0].object_type())) [INFO] [stdout] 102 ~ } [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/evaluator/builtins.rs:78:15 [INFO] [stdout] | [INFO] [stdout] 78 | fn rest(args: &Vec>) -> 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] 78 - fn rest(args: &Vec>) -> Option> { [INFO] [stdout] 78 + fn rest(args: &[Rc]) -> Option> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/evaluator/builtins.rs:112:5 [INFO] [stdout] | [INFO] [stdout] 112 | / return if any.is::() { [INFO] [stdout] 113 | | let v = any.downcast_ref::().unwrap(); [INFO] [stdout] 114 | | let mut ary: Vec> = vec![]; [INFO] [stdout] 115 | | for item in &v.elements { [INFO] [stdout] ... | [INFO] [stdout] 124 | | args[0].object_type())) [INFO] [stdout] 125 | | }; [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 ~ if any.is::() { [INFO] [stdout] 113 + let v = any.downcast_ref::().unwrap(); [INFO] [stdout] 114 + let mut ary: Vec> = vec![]; [INFO] [stdout] 115 + for item in &v.elements { [INFO] [stdout] 116 + ary.push(item.clone()); [INFO] [stdout] 117 + } [INFO] [stdout] 118 + ary.push(args[1].clone()); [INFO] [stdout] 119 + Some(Rc::new(object::Array { [INFO] [stdout] 120 + elements: ary, [INFO] [stdout] 121 + })) [INFO] [stdout] 122 + } else { [INFO] [stdout] 123 + new_error(format!("argument to `push` must be ARRAY, got {}", [INFO] [stdout] 124 + args[0].object_type())) [INFO] [stdout] 125 ~ } [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/evaluator/builtins.rs:105:15 [INFO] [stdout] | [INFO] [stdout] 105 | fn push(args: &Vec>) -> 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] 105 - fn push(args: &Vec>) -> Option> { [INFO] [stdout] 105 + fn push(args: &[Rc]) -> Option> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/evaluator/builtins.rs:149:9 [INFO] [stdout] | [INFO] [stdout] 149 | 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] 149 - return None; [INFO] [stdout] 149 + None [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/evaluator/builtins.rs:162:5 [INFO] [stdout] | [INFO] [stdout] 162 | return rlt; [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] 162 - return rlt; [INFO] [stdout] 162 + rlt [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `return_statement.return_value` after checking its variant with `is_some` [INFO] [stdout] --> src/evaluator/mod.rs:39:43 [INFO] [stdout] | [INFO] [stdout] 38 | if return_statement.return_value.is_some() { [INFO] [stdout] | ------------------------------------------ help: try: `if let Some() = &return_statement.return_value` [INFO] [stdout] 39 | if let Some(value) = eval(return_statement.return_value.as_ref().unwrap().upcast(), env) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `statement.value` after checking its variant with `is_some` [INFO] [stdout] --> src/evaluator/mod.rs:51:43 [INFO] [stdout] | [INFO] [stdout] 50 | if statement.value.is_some() { [INFO] [stdout] | ---------------------------- help: try: `if let Some() = &statement.value` [INFO] [stdout] 51 | if let Some(value) = eval(statement.value.as_ref().unwrap().upcast(), env) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `as_any_mut` is never used [INFO] [stdout] --> src/object/base.rs:32:8 [INFO] [stdout] | [INFO] [stdout] 30 | pub trait Downcast { [INFO] [stdout] | -------- method in this trait [INFO] [stdout] 31 | fn as_any(&self) -> &dyn Any; [INFO] [stdout] 32 | fn as_any_mut(&mut self) -> &mut dyn Any; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `as_any_mut` is never used [INFO] [stdout] --> src/ast/base.rs:9:8 [INFO] [stdout] | [INFO] [stdout] 3 | pub trait Node { [INFO] [stdout] | ---- method in this trait [INFO] [stdout] ... [INFO] [stdout] 9 | fn as_any_mut(&mut self) -> &mut dyn Any; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/evaluator/mod.rs:208:55 [INFO] [stdout] | [INFO] [stdout] 208 | if v.as_any().is::() { [INFO] [stdout] | _______________________________________________________^ [INFO] [stdout] 209 | | return rlt; [INFO] [stdout] 210 | | } else if v.as_any().is::() { [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/evaluator/mod.rs:210:56 [INFO] [stdout] | [INFO] [stdout] 210 | } else if v.as_any().is::() { [INFO] [stdout] | ________________________________________________________^ [INFO] [stdout] 211 | | return rlt; [INFO] [stdout] 212 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] = note: `#[warn(clippy::if_same_then_else)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/evaluator/mod.rs:219:5 [INFO] [stdout] | [INFO] [stdout] 219 | / return match operator { [INFO] [stdout] 220 | | [INFO] [stdout] 221 | | "!" => { [INFO] [stdout] 222 | | eval_bang_operator_expression(right) [INFO] [stdout] ... | [INFO] [stdout] 230 | | }; [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] 219 ~ match operator { [INFO] [stdout] 220 + [INFO] [stdout] 221 + "!" => { [INFO] [stdout] 222 + eval_bang_operator_expression(right) [INFO] [stdout] 223 + } [INFO] [stdout] 224 + "-" => { [INFO] [stdout] 225 + eval_minus_prefix_operator_expression(right) [INFO] [stdout] 226 + } [INFO] [stdout] 227 + _ => { [INFO] [stdout] 228 + new_error(format!("unknown operator: {}{}", operator, right.object_type())) [INFO] [stdout] 229 + } [INFO] [stdout] 230 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `statement_node` is never used [INFO] [stdout] --> src/ast/base.rs:13:8 [INFO] [stdout] | [INFO] [stdout] 12 | pub trait Statement: Node { [INFO] [stdout] | --------- method in this trait [INFO] [stdout] 13 | fn statement_node(&self); [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `expression_node` is never used [INFO] [stdout] --> src/ast/base.rs:18:8 [INFO] [stdout] | [INFO] [stdout] 17 | pub trait Expression: Node { [INFO] [stdout] | ---------- method in this trait [INFO] [stdout] 18 | fn expression_node(&self); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait `Upcast` is never used [INFO] [stdout] --> src/ast/base.rs:22:11 [INFO] [stdout] | [INFO] [stdout] 22 | pub trait Upcast { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/evaluator/mod.rs:234:5 [INFO] [stdout] | [INFO] [stdout] 234 | / return if left.object_type() == object::INTEGER_OBJ && right.object_type() == object::INTEGER_OBJ { [INFO] [stdout] 235 | | eval_integer_infix_expression(operator, left, right) [INFO] [stdout] 236 | | } else if left.object_type() == object::STRING_OBJ && right.object_type() == object::STRING_OBJ { [INFO] [stdout] 237 | | eval_string_infix_expression(operator, left, right) [INFO] [stdout] ... | [INFO] [stdout] 243 | | new_error(format!("unknown operator: {} {} {}", left.object_type(), operator, right.object_type())) [INFO] [stdout] 244 | | }; [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] 234 ~ if left.object_type() == object::INTEGER_OBJ && right.object_type() == object::INTEGER_OBJ { [INFO] [stdout] 235 + eval_integer_infix_expression(operator, left, right) [INFO] [stdout] 236 + } else if left.object_type() == object::STRING_OBJ && right.object_type() == object::STRING_OBJ { [INFO] [stdout] 237 + eval_string_infix_expression(operator, left, right) [INFO] [stdout] 238 + } else if left.object_type() == object::BOOLEAN_OBJ && right.object_type() == object::BOOLEAN_OBJ { [INFO] [stdout] 239 + eval_bool_infix_expression(operator, left, right) [INFO] [stdout] 240 + } else if left.object_type() != right.object_type() { [INFO] [stdout] 241 + new_error(format!("type mismatch: {} {} {}", left.object_type(), operator, right.object_type())) [INFO] [stdout] 242 + } else { [INFO] [stdout] 243 + new_error(format!("unknown operator: {} {} {}", left.object_type(), operator, right.object_type())) [INFO] [stdout] 244 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/evaluator/mod.rs:259:15 [INFO] [stdout] | [INFO] [stdout] 259 | } else if !expression.alternative.is_none() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `expression.alternative.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/evaluator/mod.rs:257:5 [INFO] [stdout] | [INFO] [stdout] 257 | / return if is_truthy(&condition) { [INFO] [stdout] 258 | | eval(expression.consequence.upcast(), env) [INFO] [stdout] 259 | | } else if !expression.alternative.is_none() { [INFO] [stdout] 260 | | eval(expression.alternative.as_ref().unwrap().upcast(), env) [INFO] [stdout] 261 | | } else { [INFO] [stdout] 262 | | Some(Rc::new(NULL)) [INFO] [stdout] 263 | | }; [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] 257 ~ if is_truthy(&condition) { [INFO] [stdout] 258 + eval(expression.consequence.upcast(), env) [INFO] [stdout] 259 + } else if !expression.alternative.is_none() { [INFO] [stdout] 260 + eval(expression.alternative.as_ref().unwrap().upcast(), env) [INFO] [stdout] 261 + } else { [INFO] [stdout] 262 + Some(Rc::new(NULL)) [INFO] [stdout] 263 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/evaluator/mod.rs:267:5 [INFO] [stdout] | [INFO] [stdout] 267 | / return match env.get(expression.value.as_str()) { [INFO] [stdout] 268 | | None => { [INFO] [stdout] 269 | | match get_builtin_fn(expression.value.as_str()) { [INFO] [stdout] 270 | | None => { [INFO] [stdout] ... | [INFO] [stdout] 284 | | }; [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] 267 ~ match env.get(expression.value.as_str()) { [INFO] [stdout] 268 + None => { [INFO] [stdout] 269 + match get_builtin_fn(expression.value.as_str()) { [INFO] [stdout] 270 + None => { [INFO] [stdout] 271 + new_error(format!("identifier not found: {}", expression.value)) [INFO] [stdout] 272 + } [INFO] [stdout] 273 + Some(v) => { [INFO] [stdout] 274 + Some(Rc::new(object::Builtin{ [INFO] [stdout] 275 + func: v, [INFO] [stdout] 276 + })) [INFO] [stdout] 277 + } [INFO] [stdout] 278 + } [INFO] [stdout] 279 + [INFO] [stdout] 280 + } [INFO] [stdout] 281 + Some(v) => { [INFO] [stdout] 282 + Some(v.clone()) [INFO] [stdout] 283 + } [INFO] [stdout] 284 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/evaluator/mod.rs:338:5 [INFO] [stdout] | [INFO] [stdout] 338 | / return if left.object_type() == object::ARRAY_OBJ && index.object_type() == object::INTEGER_OBJ { [INFO] [stdout] 339 | | eval_array_index_expression(left, index) [INFO] [stdout] 340 | | } else if left.object_type() == object::HASH_OBJ { [INFO] [stdout] 341 | | eval_hash_index_expression(left, index) [INFO] [stdout] 342 | | } else { [INFO] [stdout] 343 | | new_error(format!("index operator not supported: {}", left.object_type())) [INFO] [stdout] 344 | | }; [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] 338 ~ if left.object_type() == object::ARRAY_OBJ && index.object_type() == object::INTEGER_OBJ { [INFO] [stdout] 339 + eval_array_index_expression(left, index) [INFO] [stdout] 340 + } else if left.object_type() == object::HASH_OBJ { [INFO] [stdout] 341 + eval_hash_index_expression(left, index) [INFO] [stdout] 342 + } else { [INFO] [stdout] 343 + new_error(format!("index operator not supported: {}", left.object_type())) [INFO] [stdout] 344 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/evaluator/mod.rs:355:5 [INFO] [stdout] | [INFO] [stdout] 355 | return Some(ary_obj.elements[index].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] 355 - return Some(ary_obj.elements[index].clone()); [INFO] [stdout] 355 + Some(ary_obj.elements[index].clone()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/evaluator/mod.rs:365:5 [INFO] [stdout] | [INFO] [stdout] 365 | / return match index.hash_key() { [INFO] [stdout] 366 | | None => { new_error(format!("unusable as hash key: {}", index.object_type())) } [INFO] [stdout] 367 | | Some(v) => { [INFO] [stdout] 368 | | match hash_obj.pairs.get(&v) { [INFO] [stdout] ... | [INFO] [stdout] 373 | | }; [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 365 ~ match index.hash_key() { [INFO] [stdout] 366 + None => { new_error(format!("unusable as hash key: {}", index.object_type())) } [INFO] [stdout] 367 + Some(v) => { [INFO] [stdout] 368 + match hash_obj.pairs.get(&v) { [INFO] [stdout] 369 + None => { None } [INFO] [stdout] 370 + Some(v) => { Some(v.value.clone()) } [INFO] [stdout] 371 + } [INFO] [stdout] 372 + } [INFO] [stdout] 373 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/evaluator/mod.rs:380:5 [INFO] [stdout] | [INFO] [stdout] 380 | / return match operator { [INFO] [stdout] 381 | | "+" => { Some(Rc::new(object::Integer { value: left_value + right_value })) } [INFO] [stdout] 382 | | "-" => { Some(Rc::new(object::Integer { value: left_value - right_value })) } [INFO] [stdout] 383 | | "*" => { Some(Rc::new(object::Integer { value: left_value * right_value })) } [INFO] [stdout] ... | [INFO] [stdout] 389 | | _ => { new_error(format!("unknown operator: {} {} {}", operator, left.object_type(), right.object_type())) } [INFO] [stdout] 390 | | }; [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] 380 ~ match operator { [INFO] [stdout] 381 + "+" => { Some(Rc::new(object::Integer { value: left_value + right_value })) } [INFO] [stdout] 382 + "-" => { Some(Rc::new(object::Integer { value: left_value - right_value })) } [INFO] [stdout] 383 + "*" => { Some(Rc::new(object::Integer { value: left_value * right_value })) } [INFO] [stdout] 384 + "/" => { Some(Rc::new(object::Integer { value: left_value / right_value })) } [INFO] [stdout] 385 + "<" => { Some(Rc::new(object::Boolean { value: left_value < right_value })) } [INFO] [stdout] 386 + ">" => { Some(Rc::new(object::Boolean { value: left_value > right_value })) } [INFO] [stdout] 387 + "==" => { Some(Rc::new(object::Boolean { value: left_value == right_value })) } [INFO] [stdout] 388 + "!=" => { Some(Rc::new(object::Boolean { value: left_value != right_value })) } [INFO] [stdout] 389 + _ => { new_error(format!("unknown operator: {} {} {}", operator, left.object_type(), right.object_type())) } [INFO] [stdout] 390 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/evaluator/mod.rs:408:5 [INFO] [stdout] | [INFO] [stdout] 408 | / return match operator { [INFO] [stdout] 409 | | "==" => { Some(Rc::new(object::Boolean { value: left_value == right_value })) } [INFO] [stdout] 410 | | "!=" => { Some(Rc::new(object::Boolean { value: left_value != right_value })) } [INFO] [stdout] 411 | | _ => { new_error(format!("unknown operator: {} {} {}", left.object_type(), operator, right.object_type())) } [INFO] [stdout] 412 | | }; [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] 408 ~ match operator { [INFO] [stdout] 409 + "==" => { Some(Rc::new(object::Boolean { value: left_value == right_value })) } [INFO] [stdout] 410 + "!=" => { Some(Rc::new(object::Boolean { value: left_value != right_value })) } [INFO] [stdout] 411 + _ => { new_error(format!("unknown operator: {} {} {}", left.object_type(), operator, right.object_type())) } [INFO] [stdout] 412 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/evaluator/mod.rs:417:5 [INFO] [stdout] | [INFO] [stdout] 417 | / return if right.is::() { [INFO] [stdout] 418 | | let xx = right.downcast_ref::().unwrap(); [INFO] [stdout] 419 | | Some(Rc::new(object::Boolean { [INFO] [stdout] 420 | | value: !xx.value, [INFO] [stdout] ... | [INFO] [stdout] 425 | | })) [INFO] [stdout] 426 | | } [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] 417 ~ if right.is::() { [INFO] [stdout] 418 + let xx = right.downcast_ref::().unwrap(); [INFO] [stdout] 419 + Some(Rc::new(object::Boolean { [INFO] [stdout] 420 + value: !xx.value, [INFO] [stdout] 421 + })) [INFO] [stdout] 422 + } else { [INFO] [stdout] 423 + Some(Rc::new(object::Boolean { [INFO] [stdout] 424 + value: false, [INFO] [stdout] 425 + })) [INFO] [stdout] 426 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/evaluator/mod.rs:430:5 [INFO] [stdout] | [INFO] [stdout] 430 | / return if right.as_any().is::() { [INFO] [stdout] 431 | | let xx = right.as_any().downcast_ref::().unwrap(); [INFO] [stdout] 432 | | Some(Rc::new(object::Integer { [INFO] [stdout] 433 | | value: xx.value * (-1), [INFO] [stdout] ... | [INFO] [stdout] 436 | | new_error(format!("unknown operator: -{}", right.object_type())) [INFO] [stdout] 437 | | } [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] 430 ~ if right.as_any().is::() { [INFO] [stdout] 431 + let xx = right.as_any().downcast_ref::().unwrap(); [INFO] [stdout] 432 + Some(Rc::new(object::Integer { [INFO] [stdout] 433 + value: xx.value * (-1), [INFO] [stdout] 434 + })) [INFO] [stdout] 435 + } else { [INFO] [stdout] 436 + new_error(format!("unknown operator: -{}", right.object_type())) [INFO] [stdout] 437 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/token/mod.rs:87:28 [INFO] [stdout] | [INFO] [stdout] 87 | pub fn lookup_ident(ident: &String) -> TokenType { [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] 87 ~ pub fn lookup_ident(ident: &str) -> TokenType { [INFO] [stdout] 88 | // match KEYWORDS.get(ident.as_str()) { [INFO] [stdout] ... [INFO] [stdout] 95 | KEYWORDS.with(|val| { [INFO] [stdout] 96 ~ if let Some(v) = val.get(ident) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this multiplication by -1 can be written more succinctly [INFO] [stdout] --> src/evaluator/mod.rs:433:20 [INFO] [stdout] | [INFO] [stdout] 433 | value: xx.value * (-1), [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: consider using: `-xx.value` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#neg_multiply [INFO] [stdout] = note: `#[warn(clippy::neg_multiply)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/token/mod.rs:99:9 [INFO] [stdout] | [INFO] [stdout] 99 | return token::IDENT.to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 99 - return token::IDENT.to_string(); [INFO] [stdout] 99 + token::IDENT.to_string() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module has the same name as its containing module [INFO] [stdout] --> src/lexer/lexer_test.rs:2:1 [INFO] [stdout] | [INFO] [stdout] 2 | / mod lexer_test { [INFO] [stdout] 3 | | use crate::lexer::Lexer; [INFO] [stdout] 4 | | use crate::token; [INFO] [stdout] ... | [INFO] [stdout] 154 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception [INFO] [stdout] = note: `#[warn(clippy::module_inception)]` 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/evaluator/mod.rs:463:55 [INFO] [stdout] | [INFO] [stdout] 463 | fn extend_function_env(func: &object::Function, args: &Vec>) -> object::Environment { [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] 463 - fn extend_function_env(func: &object::Function, args: &Vec>) -> object::Environment { [INFO] [stdout] 463 + fn extend_function_env(func: &object::Function, args: &[Rc]) -> object::Environment { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/evaluator/mod.rs:464:65 [INFO] [stdout] | [INFO] [stdout] 464 | let mut env = object::Environment::new_enclosed_environment(&*func.env); [INFO] [stdout] | ^^^^^^^^^^ help: try: `&func.env` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] = note: `#[warn(clippy::explicit_auto_deref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/evaluator/mod.rs:469:9 [INFO] [stdout] | [INFO] [stdout] 469 | idx = idx + 1; [INFO] [stdout] | ^^^^^^^^^^^^^ help: replace it with: `idx += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/lexer/mod.rs:14:23 [INFO] [stdout] | [INFO] [stdout] 14 | pub fn new(input: &String) -> Self { [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] 14 ~ pub fn new(input: &str) -> Self { [INFO] [stdout] 15 | let mut l = Self { [INFO] [stdout] 16 ~ input: input.to_owned(), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/lexer/mod.rs:143:9 [INFO] [stdout] | [INFO] [stdout] 143 | / return if self.read_position >= self.input.len() { [INFO] [stdout] 144 | | '\0' [INFO] [stdout] 145 | | } else { [INFO] [stdout] 146 | | self.input.chars().nth(self.read_position).unwrap() [INFO] [stdout] 147 | | }; [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] 143 ~ if self.read_position >= self.input.len() { [INFO] [stdout] 144 + '\0' [INFO] [stdout] 145 + } else { [INFO] [stdout] 146 + self.input.chars().nth(self.read_position).unwrap() [INFO] [stdout] 147 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/lexer/mod.rs:179:9 [INFO] [stdout] | [INFO] [stdout] 179 | / return token::Token { [INFO] [stdout] 180 | | token_type: token_type.clone(), [INFO] [stdout] 181 | | literal: ch.to_string(), [INFO] [stdout] 182 | | }; [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] 179 ~ token::Token { [INFO] [stdout] 180 + token_type: token_type.clone(), [INFO] [stdout] 181 + literal: ch.to_string(), [INFO] [stdout] 182 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/lexer/mod.rs:186:9 [INFO] [stdout] | [INFO] [stdout] 186 | / return token::Token { [INFO] [stdout] 187 | | token_type: token_type.clone(), [INFO] [stdout] 188 | | literal: literal.clone(), [INFO] [stdout] 189 | | }; [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] 186 ~ token::Token { [INFO] [stdout] 187 + token_type: token_type.clone(), [INFO] [stdout] 188 + literal: literal.clone(), [INFO] [stdout] 189 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/lexer/mod.rs:185:61 [INFO] [stdout] | [INFO] [stdout] 185 | fn new_token_ex(token_type: &token::TokenType, literal: &String) -> token::Token { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 185 ~ fn new_token_ex(token_type: &token::TokenType, literal: &str) -> token::Token { [INFO] [stdout] 186 | return token::Token { [INFO] [stdout] 187 | token_type: token_type.clone(), [INFO] [stdout] 188 ~ literal: literal.to_owned(), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/lexer/mod.rs:193:9 [INFO] [stdout] | [INFO] [stdout] 193 | return 'a' <= ch && ch <= 'z' || 'A' <= ch && ch <= 'Z' || ch == '_'; [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] 193 - return 'a' <= ch && ch <= 'z' || 'A' <= ch && ch <= 'Z' || ch == '_'; [INFO] [stdout] 193 + 'a' <= ch && ch <= 'z' || 'A' <= ch && ch <= 'Z' || ch == '_' [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/lexer/mod.rs:193:16 [INFO] [stdout] | [INFO] [stdout] 193 | return 'a' <= ch && ch <= 'z' || 'A' <= ch && ch <= 'Z' || ch == '_'; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: use: `('a'..='z').contains(&ch)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] = note: `#[warn(clippy::manual_range_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/lexer/mod.rs:193:42 [INFO] [stdout] | [INFO] [stdout] 193 | return 'a' <= ch && ch <= 'z' || 'A' <= ch && ch <= 'Z' || ch == '_'; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: use: `('A'..='Z').contains(&ch)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/lexer/mod.rs:197:9 [INFO] [stdout] | [INFO] [stdout] 197 | return '0' <= ch && ch <= '9'; [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 '0' <= ch && ch <= '9'; [INFO] [stdout] 197 + '0' <= ch && ch <= '9' [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/lexer/mod.rs:197:16 [INFO] [stdout] | [INFO] [stdout] 197 | return '0' <= ch && ch <= '9'; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: use: `('0'..='9').contains(&ch)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/object/environment.rs:28:9 [INFO] [stdout] | [INFO] [stdout] 28 | / return match self.store.get(name) { [INFO] [stdout] 29 | | None => { [INFO] [stdout] 30 | | match &self.outer { [INFO] [stdout] 31 | | None => { None } [INFO] [stdout] ... | [INFO] [stdout] 37 | | Some(v) => { Some(v) } [INFO] [stdout] 38 | | }; [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] 28 ~ match self.store.get(name) { [INFO] [stdout] 29 + None => { [INFO] [stdout] 30 + match &self.outer { [INFO] [stdout] 31 + None => { None } [INFO] [stdout] 32 + Some(v) => { [INFO] [stdout] 33 + v.get(name) [INFO] [stdout] 34 + } [INFO] [stdout] 35 + } [INFO] [stdout] 36 + } [INFO] [stdout] 37 + Some(v) => { Some(v) } [INFO] [stdout] 38 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module has the same name as its containing module [INFO] [stdout] --> src/object/object_test.rs:2:1 [INFO] [stdout] | [INFO] [stdout] 2 | / mod object_test { [INFO] [stdout] 3 | | use crate::object::StringValue; [INFO] [stdout] 4 | | [INFO] [stdout] 5 | | #[allow(unused_variables)] [INFO] [stdout] ... | [INFO] [stdout] 16 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/object/mod.rs:41:9 [INFO] [stdout] | [INFO] [stdout] 41 | return INTEGER_OBJ; [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] 41 - return INTEGER_OBJ; [INFO] [stdout] 41 + INTEGER_OBJ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/object/mod.rs:66:9 [INFO] [stdout] | [INFO] [stdout] 66 | return BOOLEAN_OBJ; [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] 66 - return BOOLEAN_OBJ; [INFO] [stdout] 66 + BOOLEAN_OBJ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `NULL` contains a capitalized acronym [INFO] [stdout] --> src/object/mod.rs:83:12 [INFO] [stdout] | [INFO] [stdout] 83 | pub struct NULL {} [INFO] [stdout] | ^^^^ help: consider making the acronym lowercase, except the initial letter: `Null` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] = note: `#[warn(clippy::upper_case_acronyms)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/object/mod.rs:89:9 [INFO] [stdout] | [INFO] [stdout] 89 | return NULL_OBJ; [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] 89 - return NULL_OBJ; [INFO] [stdout] 89 + NULL_OBJ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/object/mod.rs:105:9 [INFO] [stdout] | [INFO] [stdout] 105 | return RETURN_VALUE_OBJ; [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] 105 - return RETURN_VALUE_OBJ; [INFO] [stdout] 105 + RETURN_VALUE_OBJ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/object/mod.rs:121:9 [INFO] [stdout] | [INFO] [stdout] 121 | return ERROR_OBJ; [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] 121 - return ERROR_OBJ; [INFO] [stdout] 121 + ERROR_OBJ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/object/mod.rs:139:9 [INFO] [stdout] | [INFO] [stdout] 139 | return FUNCTION_OBJ; [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] 139 - return FUNCTION_OBJ; [INFO] [stdout] 139 + FUNCTION_OBJ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/object/mod.rs:159:9 [INFO] [stdout] | [INFO] [stdout] 159 | return STRING_OBJ; [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] 159 - return STRING_OBJ; [INFO] [stdout] 159 + STRING_OBJ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/object/mod.rs:171:20 [INFO] [stdout] | [INFO] [stdout] 171 | value: format!("{}", self.value), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `self.value.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: unneeded `return` statement [INFO] [stdout] --> src/object/mod.rs:184:9 [INFO] [stdout] | [INFO] [stdout] 184 | return BUILTIN_OBJ; [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 BUILTIN_OBJ; [INFO] [stdout] 184 + BUILTIN_OBJ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/object/mod.rs:200:9 [INFO] [stdout] | [INFO] [stdout] 200 | return ARRAY_OBJ; [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 - return ARRAY_OBJ; [INFO] [stdout] 200 + ARRAY_OBJ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/object/mod.rs:226:9 [INFO] [stdout] | [INFO] [stdout] 226 | return HASH_OBJ; [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] 226 - return HASH_OBJ; [INFO] [stdout] 226 + HASH_OBJ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/util/mod.rs:31:9 [INFO] [stdout] | [INFO] [stdout] 31 | / return match self { [INFO] [stdout] 32 | | VariantValue::ValueInt(v) => { *v } [INFO] [stdout] 33 | | _ => { 0 } [INFO] [stdout] 34 | | }; [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] 31 ~ match self { [INFO] [stdout] 32 + VariantValue::ValueInt(v) => { *v } [INFO] [stdout] 33 + _ => { 0 } [INFO] [stdout] 34 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/util/mod.rs:38:9 [INFO] [stdout] | [INFO] [stdout] 38 | / return match self { [INFO] [stdout] 39 | | VariantValue::ValueString(v) => { v.clone() } [INFO] [stdout] 40 | | _ => { "".to_string() } [INFO] [stdout] 41 | | }; [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] 38 ~ match self { [INFO] [stdout] 39 + VariantValue::ValueString(v) => { v.clone() } [INFO] [stdout] 40 + _ => { "".to_string() } [INFO] [stdout] 41 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/util/mod.rs:45:9 [INFO] [stdout] | [INFO] [stdout] 45 | / return match self { [INFO] [stdout] 46 | | VariantValue::ValueBool(v) => { *v } [INFO] [stdout] 47 | | _ => { false } [INFO] [stdout] 48 | | }; [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 ~ match self { [INFO] [stdout] 46 + VariantValue::ValueBool(v) => { *v } [INFO] [stdout] 47 + _ => { false } [INFO] [stdout] 48 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/ast/expression.rs:22:36 [INFO] [stdout] | [INFO] [stdout] 22 | pub fn from_expression<'a>(expression: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] ... [INFO] [stdout] 46 | express_trait_impl!(Identifier); [INFO] [stdout] | ------------------------------- in this macro invocation [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: `#[warn(clippy::needless_lifetimes)]` on by default [INFO] [stdout] = note: this warning originates in the macro `express_trait_impl` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 22 - pub fn from_expression<'a>(expression: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] 22 + pub fn from_expression(expression: &Rc ) -> Option<& $impl_name> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/ast/expression.rs:22:36 [INFO] [stdout] | [INFO] [stdout] 22 | pub fn from_expression<'a>(expression: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] ... [INFO] [stdout] 62 | express_trait_impl!(Boolean); [INFO] [stdout] | ---------------------------- in this macro invocation [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: this warning originates in the macro `express_trait_impl` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 22 - pub fn from_expression<'a>(expression: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] 22 + pub fn from_expression(expression: &Rc ) -> Option<& $impl_name> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/ast/expression.rs:22:36 [INFO] [stdout] | [INFO] [stdout] 22 | pub fn from_expression<'a>(expression: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] ... [INFO] [stdout] 78 | express_trait_impl!(IntegerLiteral); [INFO] [stdout] | ----------------------------------- in this macro invocation [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: this warning originates in the macro `express_trait_impl` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 22 - pub fn from_expression<'a>(expression: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] 22 + pub fn from_expression(expression: &Rc ) -> Option<& $impl_name> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/ast/expression.rs:22:36 [INFO] [stdout] | [INFO] [stdout] 22 | pub fn from_expression<'a>(expression: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] ... [INFO] [stdout] 95 | express_trait_impl!(PrefixExpression); [INFO] [stdout] | ------------------------------------- in this macro invocation [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: this warning originates in the macro `express_trait_impl` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 22 - pub fn from_expression<'a>(expression: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] 22 + pub fn from_expression(expression: &Rc ) -> Option<& $impl_name> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/ast/expression.rs:22:36 [INFO] [stdout] | [INFO] [stdout] 22 | pub fn from_expression<'a>(expression: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] ... [INFO] [stdout] 113 | express_trait_impl!(InfixExpression); [INFO] [stdout] | ------------------------------------ in this macro invocation [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: this warning originates in the macro `express_trait_impl` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 22 - pub fn from_expression<'a>(expression: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] 22 + pub fn from_expression(expression: &Rc ) -> Option<& $impl_name> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/ast/expression.rs:22:36 [INFO] [stdout] | [INFO] [stdout] 22 | pub fn from_expression<'a>(expression: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] ... [INFO] [stdout] 138 | express_trait_impl!(IfExpression); [INFO] [stdout] | --------------------------------- in this macro invocation [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: this warning originates in the macro `express_trait_impl` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 22 - pub fn from_expression<'a>(expression: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] 22 + pub fn from_expression(expression: &Rc ) -> Option<& $impl_name> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/ast/expression.rs:22:36 [INFO] [stdout] | [INFO] [stdout] 22 | pub fn from_expression<'a>(expression: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] ... [INFO] [stdout] 159 | express_trait_impl!(FunctionLiteral); [INFO] [stdout] | ------------------------------------ in this macro invocation [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: this warning originates in the macro `express_trait_impl` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 22 - pub fn from_expression<'a>(expression: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] 22 + pub fn from_expression(expression: &Rc ) -> Option<& $impl_name> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/ast/expression.rs:22:36 [INFO] [stdout] | [INFO] [stdout] 22 | pub fn from_expression<'a>(expression: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] ... [INFO] [stdout] 179 | express_trait_impl!(CallExpression); [INFO] [stdout] | ----------------------------------- in this macro invocation [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: this warning originates in the macro `express_trait_impl` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 22 - pub fn from_expression<'a>(expression: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] 22 + pub fn from_expression(expression: &Rc ) -> Option<& $impl_name> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/ast/expression.rs:22:36 [INFO] [stdout] | [INFO] [stdout] 22 | pub fn from_expression<'a>(expression: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] ... [INFO] [stdout] 193 | express_trait_impl!(StringLiteral); [INFO] [stdout] | ---------------------------------- in this macro invocation [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: this warning originates in the macro `express_trait_impl` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 22 - pub fn from_expression<'a>(expression: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] 22 + pub fn from_expression(expression: &Rc ) -> Option<& $impl_name> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/ast/expression.rs:22:36 [INFO] [stdout] | [INFO] [stdout] 22 | pub fn from_expression<'a>(expression: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] ... [INFO] [stdout] 211 | express_trait_impl!(ArrayLiteral); [INFO] [stdout] | --------------------------------- in this macro invocation [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: this warning originates in the macro `express_trait_impl` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 22 - pub fn from_expression<'a>(expression: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] 22 + pub fn from_expression(expression: &Rc ) -> Option<& $impl_name> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/ast/expression.rs:22:36 [INFO] [stdout] | [INFO] [stdout] 22 | pub fn from_expression<'a>(expression: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] ... [INFO] [stdout] 226 | express_trait_impl!(IndexExpression); [INFO] [stdout] | ------------------------------------ in this macro invocation [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: this warning originates in the macro `express_trait_impl` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 22 - pub fn from_expression<'a>(expression: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] 22 + pub fn from_expression(expression: &Rc ) -> Option<& $impl_name> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/ast/expression.rs:22:36 [INFO] [stdout] | [INFO] [stdout] 22 | pub fn from_expression<'a>(expression: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] ... [INFO] [stdout] 245 | express_trait_impl!(HashLiteral); [INFO] [stdout] | -------------------------------- in this macro invocation [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: this warning originates in the macro `express_trait_impl` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 22 - pub fn from_expression<'a>(expression: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] 22 + pub fn from_expression(expression: &Rc ) -> Option<& $impl_name> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/ast/statement.rs:21:35 [INFO] [stdout] | [INFO] [stdout] 21 | pub fn from_statement<'a>(statement: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] ... [INFO] [stdout] 51 | macro_statement_trait_impl!(LetStatement); [INFO] [stdout] | ----------------------------------------- in this macro invocation [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: this warning originates in the macro `macro_statement_trait_impl` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 21 - pub fn from_statement<'a>(statement: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] 21 + pub fn from_statement(statement: &Rc ) -> Option<& $impl_name> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/ast/statement.rs:21:35 [INFO] [stdout] | [INFO] [stdout] 21 | pub fn from_statement<'a>(statement: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] ... [INFO] [stdout] 72 | macro_statement_trait_impl!(ReturnStatement); [INFO] [stdout] | -------------------------------------------- in this macro invocation [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: this warning originates in the macro `macro_statement_trait_impl` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 21 - pub fn from_statement<'a>(statement: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] 21 + pub fn from_statement(statement: &Rc ) -> Option<& $impl_name> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/ast/statement.rs:21:35 [INFO] [stdout] | [INFO] [stdout] 21 | pub fn from_statement<'a>(statement: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] ... [INFO] [stdout] 86 | macro_statement_trait_impl!(ExpressionStatement); [INFO] [stdout] | ------------------------------------------------ in this macro invocation [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: this warning originates in the macro `macro_statement_trait_impl` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 21 - pub fn from_statement<'a>(statement: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] 21 + pub fn from_statement(statement: &Rc ) -> Option<& $impl_name> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/ast/statement.rs:98:13 [INFO] [stdout] | [INFO] [stdout] 98 | rlt = rlt + v.string().as_str(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `rlt += v.string().as_str()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/ast/statement.rs:21:35 [INFO] [stdout] | [INFO] [stdout] 21 | pub fn from_statement<'a>(statement: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] ... [INFO] [stdout] 105 | macro_statement_trait_impl!(BlockStatement); [INFO] [stdout] | ------------------------------------------- in this macro invocation [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: this warning originates in the macro `macro_statement_trait_impl` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 21 - pub fn from_statement<'a>(statement: &'a Rc ) -> Option<& 'a $impl_name> { [INFO] [stdout] 21 + pub fn from_statement(statement: &Rc ) -> Option<& $impl_name> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/ast/program.rs:32:13 [INFO] [stdout] | [INFO] [stdout] 32 | rlt = rlt + v.string().as_str(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `rlt += v.string().as_str()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module has the same name as its containing module [INFO] [stdout] --> src/ast/ast_test.rs:2:1 [INFO] [stdout] | [INFO] [stdout] 2 | / mod ast_test { [INFO] [stdout] 3 | | #[test] [INFO] [stdout] 4 | | fn test_ast() { [INFO] [stdout] 5 | | } [INFO] [stdout] 6 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/repl/mod.rs:18:12 [INFO] [stdout] | [INFO] [stdout] 18 | if p.errors().len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!p.errors().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: literal with an empty format string [INFO] [stdout] --> src/repl/mod.rs:48:20 [INFO] [stdout] | [INFO] [stdout] 48 | println!("{}", "Woops! We ran into some monkey business here!"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_literal [INFO] [stdout] = note: `#[warn(clippy::print_literal)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 48 - println!("{}", "Woops! We ran into some monkey business here!"); [INFO] [stdout] 48 + println!("Woops! We ran into some monkey business here!"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: literal with an empty format string [INFO] [stdout] --> src/repl/mod.rs:49:20 [INFO] [stdout] | [INFO] [stdout] 49 | println!("{}", " parser errors:"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_literal [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 49 - println!("{}", " parser errors:"); [INFO] [stdout] 49 + println!(" parser errors:"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `LOWEST` contains a capitalized acronym [INFO] [stdout] --> src/parser/base.rs:11:5 [INFO] [stdout] | [INFO] [stdout] 11 | LOWEST = 1, [INFO] [stdout] | ^^^^^^ help: consider making the acronym lowercase, except the initial letter: `Lowest` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `EQUALS` contains a capitalized acronym [INFO] [stdout] --> src/parser/base.rs:12:5 [INFO] [stdout] | [INFO] [stdout] 12 | EQUALS, [INFO] [stdout] | ^^^^^^ help: consider making the acronym lowercase, except the initial letter: `Equals` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `LESSGREATER` contains a capitalized acronym [INFO] [stdout] --> src/parser/base.rs:14:5 [INFO] [stdout] | [INFO] [stdout] 14 | LESSGREATER, [INFO] [stdout] | ^^^^^^^^^^^ help: consider making the acronym lowercase, except the initial letter: `Lessgreater` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `SUM` contains a capitalized acronym [INFO] [stdout] --> src/parser/base.rs:16:5 [INFO] [stdout] | [INFO] [stdout] 16 | SUM, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Sum` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `PRODUCT` contains a capitalized acronym [INFO] [stdout] --> src/parser/base.rs:18:5 [INFO] [stdout] | [INFO] [stdout] 18 | PRODUCT, [INFO] [stdout] | ^^^^^^^ help: consider making the acronym lowercase, except the initial letter: `Product` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `PREFIX` contains a capitalized acronym [INFO] [stdout] --> src/parser/base.rs:20:5 [INFO] [stdout] | [INFO] [stdout] 20 | PREFIX, [INFO] [stdout] | ^^^^^^ help: consider making the acronym lowercase, except the initial letter: `Prefix` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `CALL` contains a capitalized acronym [INFO] [stdout] --> src/parser/base.rs:22:5 [INFO] [stdout] | [INFO] [stdout] 22 | CALL, [INFO] [stdout] | ^^^^ help: consider making the acronym lowercase, except the initial letter: `Call` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `INDEX` contains a capitalized acronym [INFO] [stdout] --> src/parser/base.rs:24:5 [INFO] [stdout] | [INFO] [stdout] 24 | INDEX, // array[index] [INFO] [stdout] | ^^^^^ help: consider making the acronym lowercase, except the initial letter: `Index` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `statement` after checking its variant with `is_some` [INFO] [stdout] --> src/parser/func.rs:16:37 [INFO] [stdout] | [INFO] [stdout] 15 | if statement.is_some() { [INFO] [stdout] | ---------------------- help: try: `if let Some() = statement` [INFO] [stdout] 16 | program.statements.push(statement.unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `expression` after checking its variant with `is_some` [INFO] [stdout] --> src/parser/func_base.rs:91:30 [INFO] [stdout] | [INFO] [stdout] 90 | if expression.is_some() { [INFO] [stdout] | ----------------------- help: try: `if let Some() = expression` [INFO] [stdout] 91 | expressions.push(expression.unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this block may be rewritten with the `?` operator [INFO] [stdout] --> src/parser/func_prefix.rs:184:9 [INFO] [stdout] | [INFO] [stdout] 184 | / if key.is_none() { [INFO] [stdout] 185 | | return None; [INFO] [stdout] 186 | | } [INFO] [stdout] | |_________^ help: replace it with: `key.as_ref()?;` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] = note: `#[warn(clippy::question_mark)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this block may be rewritten with the `?` operator [INFO] [stdout] --> src/parser/func_prefix.rs:196:9 [INFO] [stdout] | [INFO] [stdout] 196 | / if value.is_none() { [INFO] [stdout] 197 | | return None; [INFO] [stdout] 198 | | } [INFO] [stdout] | |_________^ help: replace it with: `value.as_ref()?;` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module has the same name as its containing module [INFO] [stdout] --> src/parser/parse_test.rs:2:1 [INFO] [stdout] | [INFO] [stdout] 2 | / mod parse_test { [INFO] [stdout] 3 | | use std::rc::Rc; [INFO] [stdout] 4 | | use crate::ast; [INFO] [stdout] 5 | | use crate::ast::{Boolean, Identifier, IntegerLiteral, LetStatement, Node}; [INFO] [stdout] ... | [INFO] [stdout] 502 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/parser/parse_test.rs:345:13 [INFO] [stdout] | [INFO] [stdout] 345 | 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] 344 - if !check_identifier(&alternative.expression, "y") { [INFO] [stdout] 345 - return; [INFO] [stdout] 344 + if !check_identifier(&alternative.expression, "y") { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/parser/parse_test.rs:406:12 [INFO] [stdout] | [INFO] [stdout] 406 | if errors.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `errors.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: literal with an empty format string [INFO] [stdout] --> src/parser/parse_test.rs:409:24 [INFO] [stdout] | [INFO] [stdout] 409 | println!("{}", " parser errors:"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_literal [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 409 - println!("{}", " parser errors:"); [INFO] [stdout] 409 + println!(" parser errors:"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/parser/parse_test.rs:430:9 [INFO] [stdout] | [INFO] [stdout] 430 | / return match value { [INFO] [stdout] 431 | | VariantValue::ValueInt(v) => { [INFO] [stdout] 432 | | check_integer_literal(expression, *v) [INFO] [stdout] ... | [INFO] [stdout] 440 | | _ => {false} [INFO] [stdout] 441 | | }; [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] 430 ~ match value { [INFO] [stdout] 431 + VariantValue::ValueInt(v) => { [INFO] [stdout] 432 + check_integer_literal(expression, *v) [INFO] [stdout] 433 + } [INFO] [stdout] 434 + VariantValue::ValueBool(v) => { [INFO] [stdout] 435 + check_boolean_literal(expression, *v) [INFO] [stdout] 436 + } [INFO] [stdout] 437 + VariantValue::ValueString(v) => { [INFO] [stdout] 438 + check_identifier(expression, v) [INFO] [stdout] 439 + } [INFO] [stdout] 440 + _ => {false} [INFO] [stdout] 441 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/parser/parse_test.rs:463:40 [INFO] [stdout] | [INFO] [stdout] 463 | if expression.token.literal != format!("{}", value) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `value.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: module has the same name as its containing module [INFO] [stdout] --> src/evaluator/evaluator_test.rs:3:1 [INFO] [stdout] | [INFO] [stdout] 3 | / mod evaluator_test { [INFO] [stdout] 4 | | use std::rc::Rc; [INFO] [stdout] 5 | | use crate::ast::Node; [INFO] [stdout] ... | [INFO] [stdout] 583 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/evaluator/evaluator_test.rs:271:17 [INFO] [stdout] | [INFO] [stdout] 271 | 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] 270 - println!("body is not {}. got={}", expected, v.body.string()); [INFO] [stdout] 271 - return; [INFO] [stdout] 270 + println!("body is not {}. got={}", expected, v.body.string()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `v` [INFO] [stdout] --> src/evaluator/evaluator_test.rs:402:34 [INFO] [stdout] | [INFO] [stdout] 402 | for i in 0..v.len() { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 402 - for i in 0..v.len() { [INFO] [stdout] 402 + for (i, ) in v.iter().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/evaluator/evaluator_test.rs:518:9 [INFO] [stdout] | [INFO] [stdout] 518 | return eval(&*program, &mut env); [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] 518 - return eval(&*program, &mut env); [INFO] [stdout] 518 + eval(&*program, &mut env) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/evaluator/evaluator_test.rs:530:9 [INFO] [stdout] | [INFO] [stdout] 530 | / return match value.downcast_ref::() { [INFO] [stdout] 531 | | None => { [INFO] [stdout] 532 | | println!("not Integer: {}", obj.object_type()); [INFO] [stdout] 533 | | false [INFO] [stdout] ... | [INFO] [stdout] 541 | | }; [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] 530 ~ match value.downcast_ref::() { [INFO] [stdout] 531 + None => { [INFO] [stdout] 532 + println!("not Integer: {}", obj.object_type()); [INFO] [stdout] 533 + false [INFO] [stdout] 534 + } [INFO] [stdout] 535 + Some(v) => { [INFO] [stdout] 536 + if v.value == expected { true } else { [INFO] [stdout] 537 + println!("object has wrong value. got={}, want={}", v.value, expected); [INFO] [stdout] 538 + false [INFO] [stdout] 539 + } [INFO] [stdout] 540 + } [INFO] [stdout] 541 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/evaluator/evaluator_test.rs:552:9 [INFO] [stdout] | [INFO] [stdout] 552 | / return if obj.is::() { [INFO] [stdout] 553 | | true [INFO] [stdout] 554 | | } else { [INFO] [stdout] 555 | | println!("object is not NULL"); [INFO] [stdout] 556 | | false [INFO] [stdout] 557 | | } [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] 552 ~ if obj.is::() { [INFO] [stdout] 553 + true [INFO] [stdout] 554 + } else { [INFO] [stdout] 555 + println!("object is not NULL"); [INFO] [stdout] 556 + false [INFO] [stdout] 557 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/evaluator/evaluator_test.rs:569:9 [INFO] [stdout] | [INFO] [stdout] 569 | / return match obj.downcast_ref::() { [INFO] [stdout] 570 | | None => { [INFO] [stdout] 571 | | println!("not Integer"); [INFO] [stdout] 572 | | false [INFO] [stdout] ... | [INFO] [stdout] 580 | | }; [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] 569 ~ match obj.downcast_ref::() { [INFO] [stdout] 570 + None => { [INFO] [stdout] 571 + println!("not Integer"); [INFO] [stdout] 572 + false [INFO] [stdout] 573 + } [INFO] [stdout] 574 + Some(v) => { [INFO] [stdout] 575 + if v.value == expected { true } else { [INFO] [stdout] 576 + println!("object has wrong value. got={}, want={}", v.value, expected); [INFO] [stdout] 577 + false [INFO] [stdout] 578 + } [INFO] [stdout] 579 + } [INFO] [stdout] 580 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/evaluator/base.rs:5:5 [INFO] [stdout] | [INFO] [stdout] 5 | / return if obj.as_any().is::() { [INFO] [stdout] 6 | | true [INFO] [stdout] 7 | | } else { [INFO] [stdout] 8 | | false [INFO] [stdout] 9 | | }; [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] 5 ~ if obj.as_any().is::() { [INFO] [stdout] 6 + true [INFO] [stdout] 7 + } else { [INFO] [stdout] 8 + false [INFO] [stdout] 9 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/evaluator/base.rs:5:12 [INFO] [stdout] | [INFO] [stdout] 5 | return if obj.as_any().is::() { [INFO] [stdout] | ____________^ [INFO] [stdout] 6 | | true [INFO] [stdout] 7 | | } else { [INFO] [stdout] 8 | | false [INFO] [stdout] 9 | | }; [INFO] [stdout] | |_____^ help: you can reduce it to: `obj.as_any().is::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [INFO] [stdout] = note: `#[warn(clippy::needless_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/evaluator/base.rs:14:5 [INFO] [stdout] | [INFO] [stdout] 14 | / return if xx.is::() { [INFO] [stdout] 15 | | false [INFO] [stdout] 16 | | } else if xx.is::() { [INFO] [stdout] 17 | | xx.downcast_ref::().unwrap().value [INFO] [stdout] 18 | | } else { 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] 14 ~ if xx.is::() { [INFO] [stdout] 15 + false [INFO] [stdout] 16 + } else if xx.is::() { [INFO] [stdout] 17 + xx.downcast_ref::().unwrap().value [INFO] [stdout] 18 ~ } else { false } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/evaluator/builtins.rs:15:5 [INFO] [stdout] | [INFO] [stdout] 15 | / return if any.is::() { [INFO] [stdout] 16 | | let value = any.downcast_ref::().unwrap(); [INFO] [stdout] 17 | | Some(Rc::new(object::Integer { [INFO] [stdout] 18 | | value: value.elements.len() as i64, [INFO] [stdout] ... | [INFO] [stdout] 27 | | args[0].object_type())) [INFO] [stdout] 28 | | } [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] 15 ~ if any.is::() { [INFO] [stdout] 16 + let value = any.downcast_ref::().unwrap(); [INFO] [stdout] 17 + Some(Rc::new(object::Integer { [INFO] [stdout] 18 + value: value.elements.len() as i64, [INFO] [stdout] 19 + })) [INFO] [stdout] 20 + } else if any.is::() { [INFO] [stdout] 21 + let value = any.downcast_ref::().unwrap(); [INFO] [stdout] 22 + Some(Rc::new(object::Integer { [INFO] [stdout] 23 + value: value.value.len() as i64, [INFO] [stdout] 24 + })) [INFO] [stdout] 25 + } else { [INFO] [stdout] 26 + new_error(format!("argument to `len` not supported, got {}", [INFO] [stdout] 27 + args[0].object_type())) [INFO] [stdout] 28 + } [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/evaluator/builtins.rs:8:14 [INFO] [stdout] | [INFO] [stdout] 8 | fn len(args: &Vec>) -> 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] 8 - fn len(args: &Vec>) -> Option> { [INFO] [stdout] 8 + fn len(args: &[Rc]) -> Option> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/evaluator/builtins.rs:45:5 [INFO] [stdout] | [INFO] [stdout] 45 | / return if any.is::() { [INFO] [stdout] 46 | | let v = any.downcast_ref::().unwrap(); [INFO] [stdout] 47 | | if v.elements.len() > 0 { [INFO] [stdout] 48 | | Some(v.elements[0].clone()) [INFO] [stdout] ... | [INFO] [stdout] 54 | | args[0].object_type())) [INFO] [stdout] 55 | | }; [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 ~ if any.is::() { [INFO] [stdout] 46 + let v = any.downcast_ref::().unwrap(); [INFO] [stdout] 47 + if v.elements.len() > 0 { [INFO] [stdout] 48 + Some(v.elements[0].clone()) [INFO] [stdout] 49 + } else { [INFO] [stdout] 50 + None [INFO] [stdout] 51 + } [INFO] [stdout] 52 + } else { [INFO] [stdout] 53 + new_error(format!("argument to `first` must be ARRAY, got {}", [INFO] [stdout] 54 + args[0].object_type())) [INFO] [stdout] 55 ~ } [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/evaluator/builtins.rs:38:16 [INFO] [stdout] | [INFO] [stdout] 38 | fn first(args: &Vec>) -> 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] 38 - fn first(args: &Vec>) -> Option>{ [INFO] [stdout] 38 + fn first(args: &[Rc]) -> Option>{ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/evaluator/builtins.rs:47:12 [INFO] [stdout] | [INFO] [stdout] 47 | if v.elements.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!v.elements.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/evaluator/builtins.rs:65:5 [INFO] [stdout] | [INFO] [stdout] 65 | / return if any.is::() { [INFO] [stdout] 66 | | let v = any.downcast_ref::().unwrap(); [INFO] [stdout] 67 | | if v.elements.len() > 1 { [INFO] [stdout] 68 | | Some(v.elements[v.elements.len() - 1].clone()) [INFO] [stdout] ... | [INFO] [stdout] 74 | | args[0].object_type())) [INFO] [stdout] 75 | | }; [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] 65 ~ if any.is::() { [INFO] [stdout] 66 + let v = any.downcast_ref::().unwrap(); [INFO] [stdout] 67 + if v.elements.len() > 1 { [INFO] [stdout] 68 + Some(v.elements[v.elements.len() - 1].clone()) [INFO] [stdout] 69 + } else { [INFO] [stdout] 70 + None [INFO] [stdout] 71 + } [INFO] [stdout] 72 + } else { [INFO] [stdout] 73 + new_error(format!("argument to `last` must be ARRAY, got {}", [INFO] [stdout] 74 + args[0].object_type())) [INFO] [stdout] 75 ~ } [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/evaluator/builtins.rs:58:15 [INFO] [stdout] | [INFO] [stdout] 58 | fn last(args: &Vec>) -> 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] 58 - fn last(args: &Vec>) -> Option> { [INFO] [stdout] 58 + fn last(args: &[Rc]) -> Option> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/evaluator/builtins.rs:85:5 [INFO] [stdout] | [INFO] [stdout] 85 | / return if any.is::() { [INFO] [stdout] 86 | | let v = any.downcast_ref::().unwrap(); [INFO] [stdout] 87 | | let length = v.elements.len(); [INFO] [stdout] 88 | | if length > 0 { [INFO] [stdout] ... | [INFO] [stdout] 101 | | args[0].object_type())) [INFO] [stdout] 102 | | }; [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] 85 ~ if any.is::() { [INFO] [stdout] 86 + let v = any.downcast_ref::().unwrap(); [INFO] [stdout] 87 + let length = v.elements.len(); [INFO] [stdout] 88 + if length > 0 { [INFO] [stdout] 89 + let mut ary: Vec> = vec![]; [INFO] [stdout] 90 + for i in 1..length { [INFO] [stdout] 91 + ary.push(v.elements[i].clone()); [INFO] [stdout] 92 + } [INFO] [stdout] 93 + Some(Rc::new(object::Array { [INFO] [stdout] 94 + elements: ary, [INFO] [stdout] 95 + })) [INFO] [stdout] 96 + } else { [INFO] [stdout] 97 + None [INFO] [stdout] 98 + } [INFO] [stdout] 99 + } else { [INFO] [stdout] 100 + new_error(format!("argument to `first` must be ARRAY, got {}", [INFO] [stdout] 101 + args[0].object_type())) [INFO] [stdout] 102 ~ } [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/evaluator/builtins.rs:78:15 [INFO] [stdout] | [INFO] [stdout] 78 | fn rest(args: &Vec>) -> 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] 78 - fn rest(args: &Vec>) -> Option> { [INFO] [stdout] 78 + fn rest(args: &[Rc]) -> Option> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/evaluator/builtins.rs:112:5 [INFO] [stdout] | [INFO] [stdout] 112 | / return if any.is::() { [INFO] [stdout] 113 | | let v = any.downcast_ref::().unwrap(); [INFO] [stdout] 114 | | let mut ary: Vec> = vec![]; [INFO] [stdout] 115 | | for item in &v.elements { [INFO] [stdout] ... | [INFO] [stdout] 124 | | args[0].object_type())) [INFO] [stdout] 125 | | }; [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 ~ if any.is::() { [INFO] [stdout] 113 + let v = any.downcast_ref::().unwrap(); [INFO] [stdout] 114 + let mut ary: Vec> = vec![]; [INFO] [stdout] 115 + for item in &v.elements { [INFO] [stdout] 116 + ary.push(item.clone()); [INFO] [stdout] 117 + } [INFO] [stdout] 118 + ary.push(args[1].clone()); [INFO] [stdout] 119 + Some(Rc::new(object::Array { [INFO] [stdout] 120 + elements: ary, [INFO] [stdout] 121 + })) [INFO] [stdout] 122 + } else { [INFO] [stdout] 123 + new_error(format!("argument to `push` must be ARRAY, got {}", [INFO] [stdout] 124 + args[0].object_type())) [INFO] [stdout] 125 ~ } [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/evaluator/builtins.rs:105:15 [INFO] [stdout] | [INFO] [stdout] 105 | fn push(args: &Vec>) -> 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] 105 - fn push(args: &Vec>) -> Option> { [INFO] [stdout] 105 + fn push(args: &[Rc]) -> Option> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/evaluator/builtins.rs:149:9 [INFO] [stdout] | [INFO] [stdout] 149 | 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] 149 - return None; [INFO] [stdout] 149 + None [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/evaluator/builtins.rs:162:5 [INFO] [stdout] | [INFO] [stdout] 162 | return rlt; [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] 162 - return rlt; [INFO] [stdout] 162 + rlt [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `return_statement.return_value` after checking its variant with `is_some` [INFO] [stdout] --> src/evaluator/mod.rs:39:43 [INFO] [stdout] | [INFO] [stdout] 38 | if return_statement.return_value.is_some() { [INFO] [stdout] | ------------------------------------------ help: try: `if let Some() = &return_statement.return_value` [INFO] [stdout] 39 | if let Some(value) = eval(return_statement.return_value.as_ref().unwrap().upcast(), env) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `statement.value` after checking its variant with `is_some` [INFO] [stdout] --> src/evaluator/mod.rs:51:43 [INFO] [stdout] | [INFO] [stdout] 50 | if statement.value.is_some() { [INFO] [stdout] | ---------------------------- help: try: `if let Some() = &statement.value` [INFO] [stdout] 51 | if let Some(value) = eval(statement.value.as_ref().unwrap().upcast(), env) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/evaluator/mod.rs:208:55 [INFO] [stdout] | [INFO] [stdout] 208 | if v.as_any().is::() { [INFO] [stdout] | _______________________________________________________^ [INFO] [stdout] 209 | | return rlt; [INFO] [stdout] 210 | | } else if v.as_any().is::() { [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/evaluator/mod.rs:210:56 [INFO] [stdout] | [INFO] [stdout] 210 | } else if v.as_any().is::() { [INFO] [stdout] | ________________________________________________________^ [INFO] [stdout] 211 | | return rlt; [INFO] [stdout] 212 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] = note: `#[warn(clippy::if_same_then_else)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/evaluator/mod.rs:219:5 [INFO] [stdout] | [INFO] [stdout] 219 | / return match operator { [INFO] [stdout] 220 | | [INFO] [stdout] 221 | | "!" => { [INFO] [stdout] 222 | | eval_bang_operator_expression(right) [INFO] [stdout] ... | [INFO] [stdout] 230 | | }; [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] 219 ~ match operator { [INFO] [stdout] 220 + [INFO] [stdout] 221 + "!" => { [INFO] [stdout] 222 + eval_bang_operator_expression(right) [INFO] [stdout] 223 + } [INFO] [stdout] 224 + "-" => { [INFO] [stdout] 225 + eval_minus_prefix_operator_expression(right) [INFO] [stdout] 226 + } [INFO] [stdout] 227 + _ => { [INFO] [stdout] 228 + new_error(format!("unknown operator: {}{}", operator, right.object_type())) [INFO] [stdout] 229 + } [INFO] [stdout] 230 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/evaluator/mod.rs:234:5 [INFO] [stdout] | [INFO] [stdout] 234 | / return if left.object_type() == object::INTEGER_OBJ && right.object_type() == object::INTEGER_OBJ { [INFO] [stdout] 235 | | eval_integer_infix_expression(operator, left, right) [INFO] [stdout] 236 | | } else if left.object_type() == object::STRING_OBJ && right.object_type() == object::STRING_OBJ { [INFO] [stdout] 237 | | eval_string_infix_expression(operator, left, right) [INFO] [stdout] ... | [INFO] [stdout] 243 | | new_error(format!("unknown operator: {} {} {}", left.object_type(), operator, right.object_type())) [INFO] [stdout] 244 | | }; [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] 234 ~ if left.object_type() == object::INTEGER_OBJ && right.object_type() == object::INTEGER_OBJ { [INFO] [stdout] 235 + eval_integer_infix_expression(operator, left, right) [INFO] [stdout] 236 + } else if left.object_type() == object::STRING_OBJ && right.object_type() == object::STRING_OBJ { [INFO] [stdout] 237 + eval_string_infix_expression(operator, left, right) [INFO] [stdout] 238 + } else if left.object_type() == object::BOOLEAN_OBJ && right.object_type() == object::BOOLEAN_OBJ { [INFO] [stdout] 239 + eval_bool_infix_expression(operator, left, right) [INFO] [stdout] 240 + } else if left.object_type() != right.object_type() { [INFO] [stdout] 241 + new_error(format!("type mismatch: {} {} {}", left.object_type(), operator, right.object_type())) [INFO] [stdout] 242 + } else { [INFO] [stdout] 243 + new_error(format!("unknown operator: {} {} {}", left.object_type(), operator, right.object_type())) [INFO] [stdout] 244 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/evaluator/mod.rs:259:15 [INFO] [stdout] | [INFO] [stdout] 259 | } else if !expression.alternative.is_none() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `expression.alternative.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/evaluator/mod.rs:257:5 [INFO] [stdout] | [INFO] [stdout] 257 | / return if is_truthy(&condition) { [INFO] [stdout] 258 | | eval(expression.consequence.upcast(), env) [INFO] [stdout] 259 | | } else if !expression.alternative.is_none() { [INFO] [stdout] 260 | | eval(expression.alternative.as_ref().unwrap().upcast(), env) [INFO] [stdout] 261 | | } else { [INFO] [stdout] 262 | | Some(Rc::new(NULL)) [INFO] [stdout] 263 | | }; [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] 257 ~ if is_truthy(&condition) { [INFO] [stdout] 258 + eval(expression.consequence.upcast(), env) [INFO] [stdout] 259 + } else if !expression.alternative.is_none() { [INFO] [stdout] 260 + eval(expression.alternative.as_ref().unwrap().upcast(), env) [INFO] [stdout] 261 + } else { [INFO] [stdout] 262 + Some(Rc::new(NULL)) [INFO] [stdout] 263 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/evaluator/mod.rs:267:5 [INFO] [stdout] | [INFO] [stdout] 267 | / return match env.get(expression.value.as_str()) { [INFO] [stdout] 268 | | None => { [INFO] [stdout] 269 | | match get_builtin_fn(expression.value.as_str()) { [INFO] [stdout] 270 | | None => { [INFO] [stdout] ... | [INFO] [stdout] 284 | | }; [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] 267 ~ match env.get(expression.value.as_str()) { [INFO] [stdout] 268 + None => { [INFO] [stdout] 269 + match get_builtin_fn(expression.value.as_str()) { [INFO] [stdout] 270 + None => { [INFO] [stdout] 271 + new_error(format!("identifier not found: {}", expression.value)) [INFO] [stdout] 272 + } [INFO] [stdout] 273 + Some(v) => { [INFO] [stdout] 274 + Some(Rc::new(object::Builtin{ [INFO] [stdout] 275 + func: v, [INFO] [stdout] 276 + })) [INFO] [stdout] 277 + } [INFO] [stdout] 278 + } [INFO] [stdout] 279 + [INFO] [stdout] 280 + } [INFO] [stdout] 281 + Some(v) => { [INFO] [stdout] 282 + Some(v.clone()) [INFO] [stdout] 283 + } [INFO] [stdout] 284 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/evaluator/mod.rs:338:5 [INFO] [stdout] | [INFO] [stdout] 338 | / return if left.object_type() == object::ARRAY_OBJ && index.object_type() == object::INTEGER_OBJ { [INFO] [stdout] 339 | | eval_array_index_expression(left, index) [INFO] [stdout] 340 | | } else if left.object_type() == object::HASH_OBJ { [INFO] [stdout] 341 | | eval_hash_index_expression(left, index) [INFO] [stdout] 342 | | } else { [INFO] [stdout] 343 | | new_error(format!("index operator not supported: {}", left.object_type())) [INFO] [stdout] 344 | | }; [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] 338 ~ if left.object_type() == object::ARRAY_OBJ && index.object_type() == object::INTEGER_OBJ { [INFO] [stdout] 339 + eval_array_index_expression(left, index) [INFO] [stdout] 340 + } else if left.object_type() == object::HASH_OBJ { [INFO] [stdout] 341 + eval_hash_index_expression(left, index) [INFO] [stdout] 342 + } else { [INFO] [stdout] 343 + new_error(format!("index operator not supported: {}", left.object_type())) [INFO] [stdout] 344 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/evaluator/mod.rs:355:5 [INFO] [stdout] | [INFO] [stdout] 355 | return Some(ary_obj.elements[index].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] 355 - return Some(ary_obj.elements[index].clone()); [INFO] [stdout] 355 + Some(ary_obj.elements[index].clone()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/evaluator/mod.rs:365:5 [INFO] [stdout] | [INFO] [stdout] 365 | / return match index.hash_key() { [INFO] [stdout] 366 | | None => { new_error(format!("unusable as hash key: {}", index.object_type())) } [INFO] [stdout] 367 | | Some(v) => { [INFO] [stdout] 368 | | match hash_obj.pairs.get(&v) { [INFO] [stdout] ... | [INFO] [stdout] 373 | | }; [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 365 ~ match index.hash_key() { [INFO] [stdout] 366 + None => { new_error(format!("unusable as hash key: {}", index.object_type())) } [INFO] [stdout] 367 + Some(v) => { [INFO] [stdout] 368 + match hash_obj.pairs.get(&v) { [INFO] [stdout] 369 + None => { None } [INFO] [stdout] 370 + Some(v) => { Some(v.value.clone()) } [INFO] [stdout] 371 + } [INFO] [stdout] 372 + } [INFO] [stdout] 373 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/evaluator/mod.rs:380:5 [INFO] [stdout] | [INFO] [stdout] 380 | / return match operator { [INFO] [stdout] 381 | | "+" => { Some(Rc::new(object::Integer { value: left_value + right_value })) } [INFO] [stdout] 382 | | "-" => { Some(Rc::new(object::Integer { value: left_value - right_value })) } [INFO] [stdout] 383 | | "*" => { Some(Rc::new(object::Integer { value: left_value * right_value })) } [INFO] [stdout] ... | [INFO] [stdout] 389 | | _ => { new_error(format!("unknown operator: {} {} {}", operator, left.object_type(), right.object_type())) } [INFO] [stdout] 390 | | }; [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] 380 ~ match operator { [INFO] [stdout] 381 + "+" => { Some(Rc::new(object::Integer { value: left_value + right_value })) } [INFO] [stdout] 382 + "-" => { Some(Rc::new(object::Integer { value: left_value - right_value })) } [INFO] [stdout] 383 + "*" => { Some(Rc::new(object::Integer { value: left_value * right_value })) } [INFO] [stdout] 384 + "/" => { Some(Rc::new(object::Integer { value: left_value / right_value })) } [INFO] [stdout] 385 + "<" => { Some(Rc::new(object::Boolean { value: left_value < right_value })) } [INFO] [stdout] 386 + ">" => { Some(Rc::new(object::Boolean { value: left_value > right_value })) } [INFO] [stdout] 387 + "==" => { Some(Rc::new(object::Boolean { value: left_value == right_value })) } [INFO] [stdout] 388 + "!=" => { Some(Rc::new(object::Boolean { value: left_value != right_value })) } [INFO] [stdout] 389 + _ => { new_error(format!("unknown operator: {} {} {}", operator, left.object_type(), right.object_type())) } [INFO] [stdout] 390 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/evaluator/mod.rs:408:5 [INFO] [stdout] | [INFO] [stdout] 408 | / return match operator { [INFO] [stdout] 409 | | "==" => { Some(Rc::new(object::Boolean { value: left_value == right_value })) } [INFO] [stdout] 410 | | "!=" => { Some(Rc::new(object::Boolean { value: left_value != right_value })) } [INFO] [stdout] 411 | | _ => { new_error(format!("unknown operator: {} {} {}", left.object_type(), operator, right.object_type())) } [INFO] [stdout] 412 | | }; [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] 408 ~ match operator { [INFO] [stdout] 409 + "==" => { Some(Rc::new(object::Boolean { value: left_value == right_value })) } [INFO] [stdout] 410 + "!=" => { Some(Rc::new(object::Boolean { value: left_value != right_value })) } [INFO] [stdout] 411 + _ => { new_error(format!("unknown operator: {} {} {}", left.object_type(), operator, right.object_type())) } [INFO] [stdout] 412 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/evaluator/mod.rs:417:5 [INFO] [stdout] | [INFO] [stdout] 417 | / return if right.is::() { [INFO] [stdout] 418 | | let xx = right.downcast_ref::().unwrap(); [INFO] [stdout] 419 | | Some(Rc::new(object::Boolean { [INFO] [stdout] 420 | | value: !xx.value, [INFO] [stdout] ... | [INFO] [stdout] 425 | | })) [INFO] [stdout] 426 | | } [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] 417 ~ if right.is::() { [INFO] [stdout] 418 + let xx = right.downcast_ref::().unwrap(); [INFO] [stdout] 419 + Some(Rc::new(object::Boolean { [INFO] [stdout] 420 + value: !xx.value, [INFO] [stdout] 421 + })) [INFO] [stdout] 422 + } else { [INFO] [stdout] 423 + Some(Rc::new(object::Boolean { [INFO] [stdout] 424 + value: false, [INFO] [stdout] 425 + })) [INFO] [stdout] 426 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/evaluator/mod.rs:430:5 [INFO] [stdout] | [INFO] [stdout] 430 | / return if right.as_any().is::() { [INFO] [stdout] 431 | | let xx = right.as_any().downcast_ref::().unwrap(); [INFO] [stdout] 432 | | Some(Rc::new(object::Integer { [INFO] [stdout] 433 | | value: xx.value * (-1), [INFO] [stdout] ... | [INFO] [stdout] 436 | | new_error(format!("unknown operator: -{}", right.object_type())) [INFO] [stdout] 437 | | } [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] 430 ~ if right.as_any().is::() { [INFO] [stdout] 431 + let xx = right.as_any().downcast_ref::().unwrap(); [INFO] [stdout] 432 + Some(Rc::new(object::Integer { [INFO] [stdout] 433 + value: xx.value * (-1), [INFO] [stdout] 434 + })) [INFO] [stdout] 435 + } else { [INFO] [stdout] 436 + new_error(format!("unknown operator: -{}", right.object_type())) [INFO] [stdout] 437 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this multiplication by -1 can be written more succinctly [INFO] [stdout] --> src/evaluator/mod.rs:433:20 [INFO] [stdout] | [INFO] [stdout] 433 | value: xx.value * (-1), [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: consider using: `-xx.value` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#neg_multiply [INFO] [stdout] = note: `#[warn(clippy::neg_multiply)]` 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/evaluator/mod.rs:463:55 [INFO] [stdout] | [INFO] [stdout] 463 | fn extend_function_env(func: &object::Function, args: &Vec>) -> object::Environment { [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] 463 - fn extend_function_env(func: &object::Function, args: &Vec>) -> object::Environment { [INFO] [stdout] 463 + fn extend_function_env(func: &object::Function, args: &[Rc]) -> object::Environment { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/evaluator/mod.rs:464:65 [INFO] [stdout] | [INFO] [stdout] 464 | let mut env = object::Environment::new_enclosed_environment(&*func.env); [INFO] [stdout] | ^^^^^^^^^^ help: try: `&func.env` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] = note: `#[warn(clippy::explicit_auto_deref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/evaluator/mod.rs:469:9 [INFO] [stdout] | [INFO] [stdout] 469 | idx = idx + 1; [INFO] [stdout] | ^^^^^^^^^^^^^ help: replace it with: `idx += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 7.80s [INFO] running `Command { std: "docker" "inspect" "3f7ba356ec93a47057f40e32d4309adb695e94d8d9c86830146b73e4a110c397", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "3f7ba356ec93a47057f40e32d4309adb695e94d8d9c86830146b73e4a110c397", kill_on_drop: false }` [INFO] [stdout] 3f7ba356ec93a47057f40e32d4309adb695e94d8d9c86830146b73e4a110c397