[INFO] fetching crate ailang 0.2.1... [INFO] linting ailang-0.2.1 against nightly for clippy-nonminimal_bool-denied [INFO] extracting crate ailang 0.2.1 into /workspace/builds/worker-3-tc1/source [INFO] started tweaking crates.io crate ailang 0.2.1 [INFO] finished tweaking crates.io crate ailang 0.2.1 [INFO] tweaked toml for crates.io crate ailang 0.2.1 written to /workspace/builds/worker-3-tc1/source/Cargo.toml [INFO] validating manifest of crates.io crate ailang 0.2.1 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 crates.io crate ailang 0.2.1 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] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-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] 3be6ec84d3c9480d5472ea3d5670c4d3d430331786e57c5803ce162dafed576b [INFO] running `Command { std: "docker" "start" "-a" "3be6ec84d3c9480d5472ea3d5670c4d3d430331786e57c5803ce162dafed576b", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "3be6ec84d3c9480d5472ea3d5670c4d3d430331786e57c5803ce162dafed576b", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "3be6ec84d3c9480d5472ea3d5670c4d3d430331786e57c5803ce162dafed576b", kill_on_drop: false }` [INFO] [stdout] 3be6ec84d3c9480d5472ea3d5670c4d3d430331786e57c5803ce162dafed576b [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-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] fde8ec0ac8bfe257c73e1d193378bdce2e4a2564c9b1abdb457b3397fc83977d [INFO] running `Command { std: "docker" "start" "-a" "fde8ec0ac8bfe257c73e1d193378bdce2e4a2564c9b1abdb457b3397fc83977d", kill_on_drop: false }` [INFO] [stderr] Compiling proc-macro2 v1.0.101 [INFO] [stderr] Compiling quote v1.0.41 [INFO] [stderr] Checking memchr v2.7.6 [INFO] [stderr] Checking either v1.15.0 [INFO] [stderr] Compiling pastey v0.1.1 [INFO] [stderr] Checking shlex v1.3.0 [INFO] [stderr] Checking unicode-segmentation v1.12.0 [INFO] [stderr] Checking itertools v0.14.0 [INFO] [stderr] Checking aho-corasick v1.1.3 [INFO] [stderr] Compiling syn v2.0.106 [INFO] [stderr] Checking regex-automata v0.4.13 [INFO] [stderr] Compiling thiserror-impl v2.0.17 [INFO] [stderr] Checking regex v1.12.2 [INFO] [stderr] Checking thiserror v2.0.17 [INFO] [stderr] Checking ailang v0.2.1 (/opt/rustwide/workdir) [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/lexer.rs:85:13 [INFO] [stdout] | [INFO] [stdout] 85 | source: source, [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace it with: `source` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/lexer.rs:85:13 [INFO] [stdout] | [INFO] [stdout] 85 | source: source, [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace it with: `source` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/lexer.rs:19:25 [INFO] [stdout] | [INFO] [stdout] 19 | ...ce(g) || (&["(", ")", "|", "{", "}", "-", "+", "*", "/", "%", "^", "!", "=", "<", ">", "#", "$", "\"", "'", ";"][..]).contains(&g) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["(", ")", "|", "{", "}", "-", "+", "*", "/", "%", "^", "!", "=", "<", ">", "#", "$", "\"", "'", ";"][..]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/lexer.rs:154:17 [INFO] [stdout] | [INFO] [stdout] 154 | return self._scan(); [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] 154 - return self._scan(); [INFO] [stdout] 154 + self._scan() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/lexer.rs:179:36 [INFO] [stdout] | [INFO] [stdout] 179 | let _ = self.advance_while(|g| is_digit(g)); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `is_digit` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/lexer.rs:183:32 [INFO] [stdout] | [INFO] [stdout] 183 | self.advance_while(|g| is_digit(g)); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `is_digit` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/lexer.rs:241:25 [INFO] [stdout] | [INFO] [stdout] 241 | let (i, g) = if self.peek_buf.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.peek_buf.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: needless call to `as_bytes` [INFO] [stdout] --> src/lexer.rs:247:28 [INFO] [stdout] | [INFO] [stdout] 247 | self.current = i + g.as_bytes().len(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: `len()` can be called directly on strings: `g.len()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_as_bytes [INFO] [stdout] = note: `#[warn(clippy::needless_as_bytes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods with the following characteristics: (`to_*` and `self` type is `Copy`) usually take `self` by value [INFO] [stdout] --> src/token.rs:25:21 [INFO] [stdout] | [INFO] [stdout] 25 | pub fn to_owned(&self) -> OwnedLiteral { [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] = note: `#[warn(clippy::wrong_self_convention)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `&str` [INFO] [stdout] --> src/parser.rs:243:69 [INFO] [stdout] | [INFO] [stdout] 243 | self.error(Some(op.to_owned(self.tokens.source())), "Expected assignment operator".into())?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `"Expected assignment operator"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/parser.rs:389:9 [INFO] [stdout] | [INFO] [stdout] 388 | let out = self.tokens.peek(); [INFO] [stdout] | ----------------------------- unnecessary `let` binding [INFO] [stdout] 389 | out [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 388 ~ [INFO] [stdout] 389 ~ self.tokens.peek() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_none()` [INFO] [stdout] --> src/parser.rs:403:16 [INFO] [stdout] | [INFO] [stdout] 403 | if let None = self.peek() { [INFO] [stdout] | -------^^^^-------------- help: try: `if self.peek().is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/lexer.rs:19:25 [INFO] [stdout] | [INFO] [stdout] 19 | ...ce(g) || (&["(", ")", "|", "{", "}", "-", "+", "*", "/", "%", "^", "!", "=", "<", ">", "#", "$", "\"", "'", ";"][..]).contains(&g) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["(", ")", "|", "{", "}", "-", "+", "*", "/", "%", "^", "!", "=", "<", ">", "#", "$", "\"", "'", ";"][..]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/lexer.rs:154:17 [INFO] [stdout] | [INFO] [stdout] 154 | return self._scan(); [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] 154 - return self._scan(); [INFO] [stdout] 154 + self._scan() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/compiler.rs:26:33 [INFO] [stdout] | [INFO] [stdout] 26 | Value::String(s) => s.len() > 0, [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!s.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `if let .. else` expression looks like `matches!` macro [INFO] [stdout] --> src/compiler.rs:33:9 [INFO] [stdout] | [INFO] [stdout] 33 | if let Value::Number(_) = self {true} else {false} [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] = note: `#[warn(clippy::match_like_matches_macro)]` on by default [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 33 - if let Value::Number(_) = self {true} else {false} [INFO] [stdout] 33 + matches!(self, Value::Number(_)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `if let .. else` expression looks like `matches!` macro [INFO] [stdout] --> src/compiler.rs:37:9 [INFO] [stdout] | [INFO] [stdout] 37 | if let Value::String(_) = self {true} else {false} [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 37 - if let Value::String(_) = self {true} else {false} [INFO] [stdout] 37 + matches!(self, Value::String(_)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/lexer.rs:179:36 [INFO] [stdout] | [INFO] [stdout] 179 | let _ = self.advance_while(|g| is_digit(g)); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `is_digit` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/lexer.rs:183:32 [INFO] [stdout] | [INFO] [stdout] 183 | self.advance_while(|g| is_digit(g)); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `is_digit` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/compiler.rs:58:31 [INFO] [stdout] | [INFO] [stdout] 58 | value.parse().map(|n| Value::Number(n)).map_err(|_| Error::IRParse { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Value::Number` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/lexer.rs:241:25 [INFO] [stdout] | [INFO] [stdout] 241 | let (i, g) = if self.peek_buf.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.peek_buf.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: needless call to `as_bytes` [INFO] [stdout] --> src/lexer.rs:247:28 [INFO] [stdout] | [INFO] [stdout] 247 | self.current = i + g.as_bytes().len(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: `len()` can be called directly on strings: `g.len()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_as_bytes [INFO] [stdout] = note: `#[warn(clippy::needless_as_bytes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/compiler.rs:123:9 [INFO] [stdout] | [INFO] [stdout] 123 | / match self { [INFO] [stdout] 124 | | Op::Call(_, _) | Op::CallParallel(_) | Op::CallRace(_) => true, [INFO] [stdout] 125 | | _ => false, [INFO] [stdout] 126 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 123 - match self { [INFO] [stdout] 124 - Op::Call(_, _) | Op::CallParallel(_) | Op::CallRace(_) => true, [INFO] [stdout] 125 - _ => false, [INFO] [stdout] 126 - } [INFO] [stdout] 123 + matches!(self, Op::Call(_, _) | Op::CallParallel(_) | Op::CallRace(_)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods with the following characteristics: (`to_*` and `self` type is `Copy`) usually take `self` by value [INFO] [stdout] --> src/token.rs:25:21 [INFO] [stdout] | [INFO] [stdout] 25 | pub fn to_owned(&self) -> OwnedLiteral { [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] = note: `#[warn(clippy::wrong_self_convention)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/compiler.rs:212:8 [INFO] [stdout] | [INFO] [stdout] 212 | if rest.len() != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!rest.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: useless use of `format!` [INFO] [stdout] --> src/compiler.rs:213:49 [INFO] [stdout] | [INFO] [stdout] 213 | return Err(Error::IRParse{line: 0, msg: format!("Every call in parallel call requires an arity")}); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Every call in parallel call requires an arity".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: length comparison to zero [INFO] [stdout] --> src/compiler.rs:266:12 [INFO] [stdout] | [INFO] [stdout] 266 | if parts.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `parts.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: redundant closure [INFO] [stdout] --> src/compiler.rs:273:65 [INFO] [stdout] | [INFO] [stdout] 273 | "load" => expect_len!(parts, 1, "load").parse().map(|a| Op::Load(a)).map_err(|_| Error::IRParse { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Op::Load` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/compiler.rs:277:67 [INFO] [stdout] | [INFO] [stdout] 277 | "store" => expect_len!(parts, 1, "store").parse().map(|a| Op::Store(a)).map_err(|_| Error::IRParse { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Op::Store` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/compiler.rs:283:65 [INFO] [stdout] | [INFO] [stdout] 283 | "push" => expect_len!(parts, 1, "push").parse().map(|v| Op::Push(v)), [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Op::Push` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/compiler.rs:284:65 [INFO] [stdout] | [INFO] [stdout] 284 | "jump" => expect_len!(parts, 1, "jump").parse().map(|a| Op::Jump(a)).map_err(|_| Error::IRParse { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Op::Jump` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/compiler.rs:288:79 [INFO] [stdout] | [INFO] [stdout] 288 | "jump_unless" => expect_len!(parts, 1, "jump_unless").parse().map(|a| Op::JumpUnless(a)).map_err(|_| Error::IRParse { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Op::JumpUnless` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/compiler.rs:292:71 [INFO] [stdout] | [INFO] [stdout] 292 | "jump_if" => expect_len!(parts, 1, "jump_if").parse().map(|a| Op::JumpIf(a)).map_err(|_| Error::IRParse { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Op::JumpIf` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `&str` [INFO] [stdout] --> src/parser.rs:243:69 [INFO] [stdout] | [INFO] [stdout] 243 | self.error(Some(op.to_owned(self.tokens.source())), "Expected assignment operator".into())?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `"Expected assignment operator"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `if let .. else` expression looks like `matches!` macro [INFO] [stdout] --> src/compiler.rs:368:9 [INFO] [stdout] | [INFO] [stdout] 368 | / if let Arg::Value = self { [INFO] [stdout] 369 | | true [INFO] [stdout] 370 | | } else { [INFO] [stdout] 371 | | false [INFO] [stdout] 372 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 368 - if let Arg::Value = self { [INFO] [stdout] 369 - true [INFO] [stdout] 370 - } else { [INFO] [stdout] 371 - false [INFO] [stdout] 372 - } [INFO] [stdout] 368 + matches!(self, Arg::Value) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/compiler.rs:377:18 [INFO] [stdout] | [INFO] [stdout] 377 | Some(&s) [INFO] [stdout] | ^^ help: change this to: `s` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Compiler` [INFO] [stdout] --> src/compiler.rs:463:5 [INFO] [stdout] | [INFO] [stdout] 463 | / pub fn new() -> Compiler { [INFO] [stdout] 464 | | Compiler { [INFO] [stdout] 465 | | groups: HashMap::new(), [INFO] [stdout] 466 | | instructions: Vec::new(), [INFO] [stdout] ... | [INFO] [stdout] 474 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 462 + impl<'a> Default for Compiler { [INFO] [stdout] 463 + fn default() -> Self { [INFO] [stdout] 464 + Self::new() [INFO] [stdout] 465 + } [INFO] [stdout] 466 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `if let .. else` expression looks like `matches!` macro [INFO] [stdout] --> src/compiler.rs:488:13 [INFO] [stdout] | [INFO] [stdout] 488 | if let Stmt::Use(_) = stmt {true} else {false} [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 488 - if let Stmt::Use(_) = stmt {true} else {false} [INFO] [stdout] 488 + matches!(stmt, Stmt::Use(_)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `extend` instead of `append` for adding the full range of a second vector [INFO] [stdout] --> src/compiler.rs:503:17 [INFO] [stdout] | [INFO] [stdout] 503 | this.instructions.extend(group.code.drain(..)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `this.instructions.append(&mut group.code)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extend_with_drain [INFO] [stdout] = note: `#[warn(clippy::extend_with_drain)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/parser.rs:389:9 [INFO] [stdout] | [INFO] [stdout] 388 | let out = self.tokens.peek(); [INFO] [stdout] | ----------------------------- unnecessary `let` binding [INFO] [stdout] 389 | out [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 388 ~ [INFO] [stdout] 389 ~ self.tokens.peek() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_none()` [INFO] [stdout] --> src/parser.rs:403:16 [INFO] [stdout] | [INFO] [stdout] 403 | if let None = self.peek() { [INFO] [stdout] | -------^^^^-------------- help: try: `if self.peek().is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/compiler.rs:578:9 [INFO] [stdout] | [INFO] [stdout] 578 | scope.get(name).map(|i| *i).ok_or(Error::Compile{line: 0, msg: format!("Variable '{}' used before it was declared", name)}) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `scope.get(name).copied()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] = note: `#[warn(clippy::map_clone)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/compiler.rs:586:9 [INFO] [stdout] | [INFO] [stdout] 585 | let sub_program = std::mem::replace(&mut self.instructions, current_program); [INFO] [stdout] | ----------------------------------------------------------------------------- unnecessary `let` binding [INFO] [stdout] 586 | sub_program [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 585 ~ [INFO] [stdout] 586 ~ std::mem::replace(&mut self.instructions, current_program) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `if let .. else` expression looks like `matches!` macro [INFO] [stdout] --> src/compiler.rs:798:53 [INFO] [stdout] | [INFO] [stdout] 798 | let arity = call.args.iter().filter(|a| if let AstArg::Value(_) = a {true} else {false}).count(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 798 - let arity = call.args.iter().filter(|a| if let AstArg::Value(_) = a {true} else {false}).count(); [INFO] [stdout] 798 + let arity = call.args.iter().filter(|a| matches!(a, AstArg::Value(_))).count(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/compiler.rs:959:13 [INFO] [stdout] | [INFO] [stdout] 959 | / if let Op::Jump(a) = inst { [INFO] [stdout] 960 | | if *a == 0 { [INFO] [stdout] 961 | | *a = (sofar - i) as isize; [INFO] [stdout] 962 | | } [INFO] [stdout] 963 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 959 ~ if let Op::Jump(a) = inst [INFO] [stdout] 960 ~ && *a == 0 { [INFO] [stdout] 961 | *a = (sofar - i) as isize; [INFO] [stdout] 962 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/compiler.rs:26:33 [INFO] [stdout] | [INFO] [stdout] 26 | Value::String(s) => s.len() > 0, [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!s.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `if let .. else` expression looks like `matches!` macro [INFO] [stdout] --> src/compiler.rs:33:9 [INFO] [stdout] | [INFO] [stdout] 33 | if let Value::Number(_) = self {true} else {false} [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] = note: `#[warn(clippy::match_like_matches_macro)]` on by default [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 33 - if let Value::Number(_) = self {true} else {false} [INFO] [stdout] 33 + matches!(self, Value::Number(_)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `if let .. else` expression looks like `matches!` macro [INFO] [stdout] --> src/compiler.rs:37:9 [INFO] [stdout] | [INFO] [stdout] 37 | if let Value::String(_) = self {true} else {false} [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 37 - if let Value::String(_) = self {true} else {false} [INFO] [stdout] 37 + matches!(self, Value::String(_)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/compiler.rs:58:31 [INFO] [stdout] | [INFO] [stdout] 58 | value.parse().map(|n| Value::Number(n)).map_err(|_| Error::IRParse { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Value::Number` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/compiler.rs:123:9 [INFO] [stdout] | [INFO] [stdout] 123 | / match self { [INFO] [stdout] 124 | | Op::Call(_, _) | Op::CallParallel(_) | Op::CallRace(_) => true, [INFO] [stdout] 125 | | _ => false, [INFO] [stdout] 126 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 123 - match self { [INFO] [stdout] 124 - Op::Call(_, _) | Op::CallParallel(_) | Op::CallRace(_) => true, [INFO] [stdout] 125 - _ => false, [INFO] [stdout] 126 - } [INFO] [stdout] 123 + matches!(self, Op::Call(_, _) | Op::CallParallel(_) | Op::CallRace(_)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/interpreter.rs:168:16 [INFO] [stdout] | [INFO] [stdout] 168 | if line.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/compiler.rs:212:8 [INFO] [stdout] | [INFO] [stdout] 212 | if rest.len() != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!rest.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: useless use of `format!` [INFO] [stdout] --> src/compiler.rs:213:49 [INFO] [stdout] | [INFO] [stdout] 213 | return Err(Error::IRParse{line: 0, msg: format!("Every call in parallel call requires an arity")}); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Every call in parallel call requires an arity".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: this `if` statement can be collapsed [INFO] [stdout] --> src/interpreter.rs:270:17 [INFO] [stdout] | [INFO] [stdout] 270 | / if (*ctx).dependencies.is_empty() { [INFO] [stdout] 271 | | if let Some(id) = (*ctx).current_callable { [INFO] [stdout] 272 | | if (*ctx).active { [INFO] [stdout] 273 | | self.active_callables.get_mut(&id).unwrap().terminate()?; [INFO] [stdout] ... | [INFO] [stdout] 277 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 270 ~ if (*ctx).dependencies.is_empty() [INFO] [stdout] 271 ~ && let Some(id) = (*ctx).current_callable { [INFO] [stdout] 272 | if (*ctx).active { [INFO] [stdout] ... [INFO] [stdout] 275 | self.active_callables.remove(&id); [INFO] [stdout] 276 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/compiler.rs:266:12 [INFO] [stdout] | [INFO] [stdout] 266 | if parts.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `parts.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: redundant closure [INFO] [stdout] --> src/compiler.rs:273:65 [INFO] [stdout] | [INFO] [stdout] 273 | "load" => expect_len!(parts, 1, "load").parse().map(|a| Op::Load(a)).map_err(|_| Error::IRParse { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Op::Load` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/compiler.rs:277:67 [INFO] [stdout] | [INFO] [stdout] 277 | "store" => expect_len!(parts, 1, "store").parse().map(|a| Op::Store(a)).map_err(|_| Error::IRParse { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Op::Store` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/interpreter.rs:330:20 [INFO] [stdout] | [INFO] [stdout] 330 | if (*ctx).dependencies.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `(*ctx).dependencies.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/interpreter.rs:369:33 [INFO] [stdout] | [INFO] [stdout] 369 | / ... if let Some(parent) = (*ctx).parent { [INFO] [stdout] 370 | | ... if (*parent).dependency_type == GroupKind::Race { [INFO] [stdout] 371 | | ... for dep in (*parent).dependencies.iter_mut() { [INFO] [stdout] 372 | | ... if dep.current_callable.is_some() { [INFO] [stdout] ... | [INFO] [stdout] 388 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 369 ~ if let Some(parent) = (*ctx).parent [INFO] [stdout] 370 ~ && (*parent).dependency_type == GroupKind::Race { [INFO] [stdout] 371 | for dep in (*parent).dependencies.iter_mut() { [INFO] [stdout] ... [INFO] [stdout] 386 | queue.push_back(parent); [INFO] [stdout] 387 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/compiler.rs:283:65 [INFO] [stdout] | [INFO] [stdout] 283 | "push" => expect_len!(parts, 1, "push").parse().map(|v| Op::Push(v)), [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Op::Push` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/compiler.rs:284:65 [INFO] [stdout] | [INFO] [stdout] 284 | "jump" => expect_len!(parts, 1, "jump").parse().map(|a| Op::Jump(a)).map_err(|_| Error::IRParse { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Op::Jump` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/compiler.rs:288:79 [INFO] [stdout] | [INFO] [stdout] 288 | "jump_unless" => expect_len!(parts, 1, "jump_unless").parse().map(|a| Op::JumpUnless(a)).map_err(|_| Error::IRParse { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Op::JumpUnless` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/compiler.rs:292:71 [INFO] [stdout] | [INFO] [stdout] 292 | "jump_if" => expect_len!(parts, 1, "jump_if").parse().map(|a| Op::JumpIf(a)).map_err(|_| Error::IRParse { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Op::JumpIf` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `if let .. else` expression looks like `matches!` macro [INFO] [stdout] --> src/compiler.rs:368:9 [INFO] [stdout] | [INFO] [stdout] 368 | / if let Arg::Value = self { [INFO] [stdout] 369 | | true [INFO] [stdout] 370 | | } else { [INFO] [stdout] 371 | | false [INFO] [stdout] 372 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 368 - if let Arg::Value = self { [INFO] [stdout] 369 - true [INFO] [stdout] 370 - } else { [INFO] [stdout] 371 - false [INFO] [stdout] 372 - } [INFO] [stdout] 368 + matches!(self, Arg::Value) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/compiler.rs:377:18 [INFO] [stdout] | [INFO] [stdout] 377 | Some(&s) [INFO] [stdout] | ^^ help: change this to: `s` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Compiler` [INFO] [stdout] --> src/compiler.rs:463:5 [INFO] [stdout] | [INFO] [stdout] 463 | / pub fn new() -> Compiler { [INFO] [stdout] 464 | | Compiler { [INFO] [stdout] 465 | | groups: HashMap::new(), [INFO] [stdout] 466 | | instructions: Vec::new(), [INFO] [stdout] ... | [INFO] [stdout] 474 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 462 + impl<'a> Default for Compiler { [INFO] [stdout] 463 + fn default() -> Self { [INFO] [stdout] 464 + Self::new() [INFO] [stdout] 465 + } [INFO] [stdout] 466 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `if let .. else` expression looks like `matches!` macro [INFO] [stdout] --> src/compiler.rs:488:13 [INFO] [stdout] | [INFO] [stdout] 488 | if let Stmt::Use(_) = stmt {true} else {false} [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 488 - if let Stmt::Use(_) = stmt {true} else {false} [INFO] [stdout] 488 + matches!(stmt, Stmt::Use(_)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `extend` instead of `append` for adding the full range of a second vector [INFO] [stdout] --> src/compiler.rs:503:17 [INFO] [stdout] | [INFO] [stdout] 503 | this.instructions.extend(group.code.drain(..)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `this.instructions.append(&mut group.code)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extend_with_drain [INFO] [stdout] = note: `#[warn(clippy::extend_with_drain)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/interpreter.rs:595:20 [INFO] [stdout] | [INFO] [stdout] 595 | if calls.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!calls.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/interpreter.rs:619:20 [INFO] [stdout] | [INFO] [stdout] 619 | if calls.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!calls.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/compiler.rs:578:9 [INFO] [stdout] | [INFO] [stdout] 578 | scope.get(name).map(|i| *i).ok_or(Error::Compile{line: 0, msg: format!("Variable '{}' used before it was declared", name)}) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `scope.get(name).copied()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] = note: `#[warn(clippy::map_clone)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/interpreter.rs:688:24 [INFO] [stdout] | [INFO] [stdout] 688 | if !(self.callables.contains_key(name) || self.groups.contains_key(name)) && !seen.contains(name) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!(self.callables.contains_key(name) || self.groups.contains_key(name) || seen.contains(name))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/interpreter.rs:696:28 [INFO] [stdout] | [INFO] [stdout] 696 | if !(self.callables.contains_key(name) || self.groups.contains_key(name)) && !seen.contains(name) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!(self.callables.contains_key(name) || self.groups.contains_key(name) || seen.contains(name))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/interpreter.rs:661:21 [INFO] [stdout] | [INFO] [stdout] 661 | / if !seen.contains(name) && !self.props.contains_key(name) { [INFO] [stdout] 662 | | seen.insert(name.clone()); [INFO] [stdout] 663 | | errors.push(Error::UnregisteredProperty(i, name.into())); [INFO] [stdout] 664 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 660 ~ Op::Get(name) [INFO] [stdout] 661 ~ if !seen.contains(name) && !self.props.contains_key(name) => { [INFO] [stdout] 662 | seen.insert(name.clone()); [INFO] [stdout] 663 | errors.push(Error::UnregisteredProperty(i, name.into())); [INFO] [stdout] 664 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/compiler.rs:586:9 [INFO] [stdout] | [INFO] [stdout] 585 | let sub_program = std::mem::replace(&mut self.instructions, current_program); [INFO] [stdout] | ----------------------------------------------------------------------------- unnecessary `let` binding [INFO] [stdout] 586 | sub_program [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 585 ~ [INFO] [stdout] 586 ~ std::mem::replace(&mut self.instructions, current_program) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/interpreter.rs:688:21 [INFO] [stdout] | [INFO] [stdout] 688 | / if !(self.callables.contains_key(name) || self.groups.contains_key(name)) && !seen.contains(name) { [INFO] [stdout] 689 | | seen.insert(name.clone()); [INFO] [stdout] 690 | | errors.push(Error::UnregisteredCallable(i, name.into())); [INFO] [stdout] 691 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 687 ~ Op::Call(name, _) [INFO] [stdout] 688 ~ if !(self.callables.contains_key(name) || self.groups.contains_key(name)) && !seen.contains(name) => { [INFO] [stdout] 689 | seen.insert(name.clone()); [INFO] [stdout] 690 | errors.push(Error::UnregisteredCallable(i, name.into())); [INFO] [stdout] 691 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/interpreter.rs:670:33 [INFO] [stdout] | [INFO] [stdout] 670 | / ... if !seen.contains(name) { [INFO] [stdout] 671 | | ... seen.insert(name.clone()); [INFO] [stdout] 672 | | ... errors.push(Error::UnsettableProperty(i, name.into())); [INFO] [stdout] 673 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 669 ~ Ok(false) [INFO] [stdout] 670 ~ if !seen.contains(name) => { [INFO] [stdout] 671 | seen.insert(name.clone()); [INFO] [stdout] 672 | errors.push(Error::UnsettableProperty(i, name.into())); [INFO] [stdout] 673 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `AiCompiler` [INFO] [stdout] --> src/lib.rs:23:5 [INFO] [stdout] | [INFO] [stdout] 23 | / pub fn new() -> AiCompiler { [INFO] [stdout] 24 | | AiCompiler { [INFO] [stdout] 25 | | compiler: None, [INFO] [stdout] 26 | | } [INFO] [stdout] 27 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 21 + impl Default for AiCompiler { [INFO] [stdout] 22 + fn default() -> Self { [INFO] [stdout] 23 + Self::new() [INFO] [stdout] 24 + } [INFO] [stdout] 25 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/lib.rs:52:60 [INFO] [stdout] | [INFO] [stdout] 52 | let compiler = self.compiler.take().unwrap_or_else(|| Compiler::new()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `Compiler::new` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `if let .. else` expression looks like `matches!` macro [INFO] [stdout] --> src/compiler.rs:798:53 [INFO] [stdout] | [INFO] [stdout] 798 | let arity = call.args.iter().filter(|a| if let AstArg::Value(_) = a {true} else {false}).count(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 798 - let arity = call.args.iter().filter(|a| if let AstArg::Value(_) = a {true} else {false}).count(); [INFO] [stdout] 798 + let arity = call.args.iter().filter(|a| matches!(a, AstArg::Value(_))).count(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/compiler.rs:959:13 [INFO] [stdout] | [INFO] [stdout] 959 | / if let Op::Jump(a) = inst { [INFO] [stdout] 960 | | if *a == 0 { [INFO] [stdout] 961 | | *a = (sofar - i) as isize; [INFO] [stdout] 962 | | } [INFO] [stdout] 963 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 959 ~ if let Op::Jump(a) = inst [INFO] [stdout] 960 ~ && *a == 0 { [INFO] [stdout] 961 | *a = (sofar - i) as isize; [INFO] [stdout] 962 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/interpreter.rs:168:16 [INFO] [stdout] | [INFO] [stdout] 168 | if line.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/interpreter.rs:270:17 [INFO] [stdout] | [INFO] [stdout] 270 | / if (*ctx).dependencies.is_empty() { [INFO] [stdout] 271 | | if let Some(id) = (*ctx).current_callable { [INFO] [stdout] 272 | | if (*ctx).active { [INFO] [stdout] 273 | | self.active_callables.get_mut(&id).unwrap().terminate()?; [INFO] [stdout] ... | [INFO] [stdout] 277 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 270 ~ if (*ctx).dependencies.is_empty() [INFO] [stdout] 271 ~ && let Some(id) = (*ctx).current_callable { [INFO] [stdout] 272 | if (*ctx).active { [INFO] [stdout] ... [INFO] [stdout] 275 | self.active_callables.remove(&id); [INFO] [stdout] 276 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/interpreter.rs:330:20 [INFO] [stdout] | [INFO] [stdout] 330 | if (*ctx).dependencies.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `(*ctx).dependencies.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/interpreter.rs:369:33 [INFO] [stdout] | [INFO] [stdout] 369 | / ... if let Some(parent) = (*ctx).parent { [INFO] [stdout] 370 | | ... if (*parent).dependency_type == GroupKind::Race { [INFO] [stdout] 371 | | ... for dep in (*parent).dependencies.iter_mut() { [INFO] [stdout] 372 | | ... if dep.current_callable.is_some() { [INFO] [stdout] ... | [INFO] [stdout] 388 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 369 ~ if let Some(parent) = (*ctx).parent [INFO] [stdout] 370 ~ && (*parent).dependency_type == GroupKind::Race { [INFO] [stdout] 371 | for dep in (*parent).dependencies.iter_mut() { [INFO] [stdout] ... [INFO] [stdout] 386 | queue.push_back(parent); [INFO] [stdout] 387 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/interpreter.rs:595:20 [INFO] [stdout] | [INFO] [stdout] 595 | if calls.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!calls.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/interpreter.rs:619:20 [INFO] [stdout] | [INFO] [stdout] 619 | if calls.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!calls.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/interpreter.rs:688:24 [INFO] [stdout] | [INFO] [stdout] 688 | if !(self.callables.contains_key(name) || self.groups.contains_key(name)) && !seen.contains(name) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!(self.callables.contains_key(name) || self.groups.contains_key(name) || seen.contains(name))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/interpreter.rs:696:28 [INFO] [stdout] | [INFO] [stdout] 696 | if !(self.callables.contains_key(name) || self.groups.contains_key(name)) && !seen.contains(name) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!(self.callables.contains_key(name) || self.groups.contains_key(name) || seen.contains(name))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/interpreter.rs:661:21 [INFO] [stdout] | [INFO] [stdout] 661 | / if !seen.contains(name) && !self.props.contains_key(name) { [INFO] [stdout] 662 | | seen.insert(name.clone()); [INFO] [stdout] 663 | | errors.push(Error::UnregisteredProperty(i, name.into())); [INFO] [stdout] 664 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 660 ~ Op::Get(name) [INFO] [stdout] 661 ~ if !seen.contains(name) && !self.props.contains_key(name) => { [INFO] [stdout] 662 | seen.insert(name.clone()); [INFO] [stdout] 663 | errors.push(Error::UnregisteredProperty(i, name.into())); [INFO] [stdout] 664 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/interpreter.rs:688:21 [INFO] [stdout] | [INFO] [stdout] 688 | / if !(self.callables.contains_key(name) || self.groups.contains_key(name)) && !seen.contains(name) { [INFO] [stdout] 689 | | seen.insert(name.clone()); [INFO] [stdout] 690 | | errors.push(Error::UnregisteredCallable(i, name.into())); [INFO] [stdout] 691 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 687 ~ Op::Call(name, _) [INFO] [stdout] 688 ~ if !(self.callables.contains_key(name) || self.groups.contains_key(name)) && !seen.contains(name) => { [INFO] [stdout] 689 | seen.insert(name.clone()); [INFO] [stdout] 690 | errors.push(Error::UnregisteredCallable(i, name.into())); [INFO] [stdout] 691 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/interpreter.rs:670:33 [INFO] [stdout] | [INFO] [stdout] 670 | / ... if !seen.contains(name) { [INFO] [stdout] 671 | | ... seen.insert(name.clone()); [INFO] [stdout] 672 | | ... errors.push(Error::UnsettableProperty(i, name.into())); [INFO] [stdout] 673 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 669 ~ Ok(false) [INFO] [stdout] 670 ~ if !seen.contains(name) => { [INFO] [stdout] 671 | seen.insert(name.clone()); [INFO] [stdout] 672 | errors.push(Error::UnsettableProperty(i, name.into())); [INFO] [stdout] 673 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `AiCompiler` [INFO] [stdout] --> src/lib.rs:23:5 [INFO] [stdout] | [INFO] [stdout] 23 | / pub fn new() -> AiCompiler { [INFO] [stdout] 24 | | AiCompiler { [INFO] [stdout] 25 | | compiler: None, [INFO] [stdout] 26 | | } [INFO] [stdout] 27 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 21 + impl Default for AiCompiler { [INFO] [stdout] 22 + fn default() -> Self { [INFO] [stdout] 23 + Self::new() [INFO] [stdout] 24 + } [INFO] [stdout] 25 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/lib.rs:52:60 [INFO] [stdout] | [INFO] [stdout] 52 | let compiler = self.compiler.take().unwrap_or_else(|| Compiler::new()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `Compiler::new` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/lexer.rs:85:13 [INFO] [stdout] | [INFO] [stdout] 85 | source: source, [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace it with: `source` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/lexer.rs:85:13 [INFO] [stdout] | [INFO] [stdout] 85 | source: source, [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace it with: `source` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/lexer.rs:19:25 [INFO] [stdout] | [INFO] [stdout] 19 | ...ce(g) || (&["(", ")", "|", "{", "}", "-", "+", "*", "/", "%", "^", "!", "=", "<", ">", "#", "$", "\"", "'", ";"][..]).contains(&g) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["(", ")", "|", "{", "}", "-", "+", "*", "/", "%", "^", "!", "=", "<", ">", "#", "$", "\"", "'", ";"][..]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/lexer.rs:154:17 [INFO] [stdout] | [INFO] [stdout] 154 | return self._scan(); [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] 154 - return self._scan(); [INFO] [stdout] 154 + self._scan() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/lexer.rs:179:36 [INFO] [stdout] | [INFO] [stdout] 179 | let _ = self.advance_while(|g| is_digit(g)); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `is_digit` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/lexer.rs:183:32 [INFO] [stdout] | [INFO] [stdout] 183 | self.advance_while(|g| is_digit(g)); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `is_digit` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/lexer.rs:241:25 [INFO] [stdout] | [INFO] [stdout] 241 | let (i, g) = if self.peek_buf.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.peek_buf.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: needless call to `as_bytes` [INFO] [stdout] --> src/lexer.rs:247:28 [INFO] [stdout] | [INFO] [stdout] 247 | self.current = i + g.as_bytes().len(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: `len()` can be called directly on strings: `g.len()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_as_bytes [INFO] [stdout] = note: `#[warn(clippy::needless_as_bytes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods with the following characteristics: (`to_*` and `self` type is `Copy`) usually take `self` by value [INFO] [stdout] --> src/token.rs:25:21 [INFO] [stdout] | [INFO] [stdout] 25 | pub fn to_owned(&self) -> OwnedLiteral { [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] = note: `#[warn(clippy::wrong_self_convention)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `&str` [INFO] [stdout] --> src/parser.rs:243:69 [INFO] [stdout] | [INFO] [stdout] 243 | self.error(Some(op.to_owned(self.tokens.source())), "Expected assignment operator".into())?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `"Expected assignment operator"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/parser.rs:389:9 [INFO] [stdout] | [INFO] [stdout] 388 | let out = self.tokens.peek(); [INFO] [stdout] | ----------------------------- unnecessary `let` binding [INFO] [stdout] 389 | out [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 388 ~ [INFO] [stdout] 389 ~ self.tokens.peek() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_none()` [INFO] [stdout] --> src/parser.rs:403:16 [INFO] [stdout] | [INFO] [stdout] 403 | if let None = self.peek() { [INFO] [stdout] | -------^^^^-------------- help: try: `if self.peek().is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variant name ends with the enum's name [INFO] [stdout] --> src/error.rs:55:5 [INFO] [stdout] | [INFO] [stdout] 55 | ThreadingError, [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#enum_variant_names [INFO] [stdout] = note: `#[warn(clippy::enum_variant_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/lexer.rs:19:25 [INFO] [stdout] | [INFO] [stdout] 19 | ...ce(g) || (&["(", ")", "|", "{", "}", "-", "+", "*", "/", "%", "^", "!", "=", "<", ">", "#", "$", "\"", "'", ";"][..]).contains(&g) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["(", ")", "|", "{", "}", "-", "+", "*", "/", "%", "^", "!", "=", "<", ">", "#", "$", "\"", "'", ";"][..]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/lexer.rs:154:17 [INFO] [stdout] | [INFO] [stdout] 154 | return self._scan(); [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] 154 - return self._scan(); [INFO] [stdout] 154 + self._scan() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/lexer.rs:179:36 [INFO] [stdout] | [INFO] [stdout] 179 | let _ = self.advance_while(|g| is_digit(g)); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `is_digit` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/compiler.rs:26:33 [INFO] [stdout] | [INFO] [stdout] 26 | Value::String(s) => s.len() > 0, [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!s.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/lexer.rs:183:32 [INFO] [stdout] | [INFO] [stdout] 183 | self.advance_while(|g| is_digit(g)); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `is_digit` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `if let .. else` expression looks like `matches!` macro [INFO] [stdout] --> src/compiler.rs:33:9 [INFO] [stdout] | [INFO] [stdout] 33 | if let Value::Number(_) = self {true} else {false} [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] = note: `#[warn(clippy::match_like_matches_macro)]` on by default [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 33 - if let Value::Number(_) = self {true} else {false} [INFO] [stdout] 33 + matches!(self, Value::Number(_)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `if let .. else` expression looks like `matches!` macro [INFO] [stdout] --> src/compiler.rs:37:9 [INFO] [stdout] | [INFO] [stdout] 37 | if let Value::String(_) = self {true} else {false} [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 37 - if let Value::String(_) = self {true} else {false} [INFO] [stdout] 37 + matches!(self, Value::String(_)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/compiler.rs:58:31 [INFO] [stdout] | [INFO] [stdout] 58 | value.parse().map(|n| Value::Number(n)).map_err(|_| Error::IRParse { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Value::Number` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/lexer.rs:241:25 [INFO] [stdout] | [INFO] [stdout] 241 | let (i, g) = if self.peek_buf.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.peek_buf.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: needless call to `as_bytes` [INFO] [stdout] --> src/lexer.rs:247:28 [INFO] [stdout] | [INFO] [stdout] 247 | self.current = i + g.as_bytes().len(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: `len()` can be called directly on strings: `g.len()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_as_bytes [INFO] [stdout] = note: `#[warn(clippy::needless_as_bytes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/compiler.rs:123:9 [INFO] [stdout] | [INFO] [stdout] 123 | / match self { [INFO] [stdout] 124 | | Op::Call(_, _) | Op::CallParallel(_) | Op::CallRace(_) => true, [INFO] [stdout] 125 | | _ => false, [INFO] [stdout] 126 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 123 - match self { [INFO] [stdout] 124 - Op::Call(_, _) | Op::CallParallel(_) | Op::CallRace(_) => true, [INFO] [stdout] 125 - _ => false, [INFO] [stdout] 126 - } [INFO] [stdout] 123 + matches!(self, Op::Call(_, _) | Op::CallParallel(_) | Op::CallRace(_)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods with the following characteristics: (`to_*` and `self` type is `Copy`) usually take `self` by value [INFO] [stdout] --> src/token.rs:25:21 [INFO] [stdout] | [INFO] [stdout] 25 | pub fn to_owned(&self) -> OwnedLiteral { [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] = note: `#[warn(clippy::wrong_self_convention)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/compiler.rs:212:8 [INFO] [stdout] | [INFO] [stdout] 212 | if rest.len() != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!rest.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: useless use of `format!` [INFO] [stdout] --> src/compiler.rs:213:49 [INFO] [stdout] | [INFO] [stdout] 213 | return Err(Error::IRParse{line: 0, msg: format!("Every call in parallel call requires an arity")}); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Every call in parallel call requires an arity".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: length comparison to zero [INFO] [stdout] --> src/compiler.rs:266:12 [INFO] [stdout] | [INFO] [stdout] 266 | if parts.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `parts.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: redundant closure [INFO] [stdout] --> src/compiler.rs:273:65 [INFO] [stdout] | [INFO] [stdout] 273 | "load" => expect_len!(parts, 1, "load").parse().map(|a| Op::Load(a)).map_err(|_| Error::IRParse { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Op::Load` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/compiler.rs:277:67 [INFO] [stdout] | [INFO] [stdout] 277 | "store" => expect_len!(parts, 1, "store").parse().map(|a| Op::Store(a)).map_err(|_| Error::IRParse { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Op::Store` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/compiler.rs:283:65 [INFO] [stdout] | [INFO] [stdout] 283 | "push" => expect_len!(parts, 1, "push").parse().map(|v| Op::Push(v)), [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Op::Push` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/compiler.rs:284:65 [INFO] [stdout] | [INFO] [stdout] 284 | "jump" => expect_len!(parts, 1, "jump").parse().map(|a| Op::Jump(a)).map_err(|_| Error::IRParse { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Op::Jump` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/compiler.rs:288:79 [INFO] [stdout] | [INFO] [stdout] 288 | "jump_unless" => expect_len!(parts, 1, "jump_unless").parse().map(|a| Op::JumpUnless(a)).map_err(|_| Error::IRParse { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Op::JumpUnless` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `&str` [INFO] [stdout] --> src/parser.rs:243:69 [INFO] [stdout] | [INFO] [stdout] 243 | self.error(Some(op.to_owned(self.tokens.source())), "Expected assignment operator".into())?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `"Expected assignment operator"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/compiler.rs:292:71 [INFO] [stdout] | [INFO] [stdout] 292 | "jump_if" => expect_len!(parts, 1, "jump_if").parse().map(|a| Op::JumpIf(a)).map_err(|_| Error::IRParse { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Op::JumpIf` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `if let .. else` expression looks like `matches!` macro [INFO] [stdout] --> src/compiler.rs:368:9 [INFO] [stdout] | [INFO] [stdout] 368 | / if let Arg::Value = self { [INFO] [stdout] 369 | | true [INFO] [stdout] 370 | | } else { [INFO] [stdout] 371 | | false [INFO] [stdout] 372 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 368 - if let Arg::Value = self { [INFO] [stdout] 369 - true [INFO] [stdout] 370 - } else { [INFO] [stdout] 371 - false [INFO] [stdout] 372 - } [INFO] [stdout] 368 + matches!(self, Arg::Value) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/compiler.rs:377:18 [INFO] [stdout] | [INFO] [stdout] 377 | Some(&s) [INFO] [stdout] | ^^ help: change this to: `s` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/parser.rs:389:9 [INFO] [stdout] | [INFO] [stdout] 388 | let out = self.tokens.peek(); [INFO] [stdout] | ----------------------------- unnecessary `let` binding [INFO] [stdout] 389 | out [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 388 ~ [INFO] [stdout] 389 ~ self.tokens.peek() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `if let .. else` expression looks like `matches!` macro [INFO] [stdout] --> src/compiler.rs:488:13 [INFO] [stdout] | [INFO] [stdout] 488 | if let Stmt::Use(_) = stmt {true} else {false} [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 488 - if let Stmt::Use(_) = stmt {true} else {false} [INFO] [stdout] 488 + matches!(stmt, Stmt::Use(_)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_none()` [INFO] [stdout] --> src/parser.rs:403:16 [INFO] [stdout] | [INFO] [stdout] 403 | if let None = self.peek() { [INFO] [stdout] | -------^^^^-------------- help: try: `if self.peek().is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `extend` instead of `append` for adding the full range of a second vector [INFO] [stdout] --> src/compiler.rs:503:17 [INFO] [stdout] | [INFO] [stdout] 503 | this.instructions.extend(group.code.drain(..)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `this.instructions.append(&mut group.code)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extend_with_drain [INFO] [stdout] = note: `#[warn(clippy::extend_with_drain)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/compiler.rs:578:9 [INFO] [stdout] | [INFO] [stdout] 578 | scope.get(name).map(|i| *i).ok_or(Error::Compile{line: 0, msg: format!("Variable '{}' used before it was declared", name)}) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `scope.get(name).copied()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] = note: `#[warn(clippy::map_clone)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/compiler.rs:586:9 [INFO] [stdout] | [INFO] [stdout] 585 | let sub_program = std::mem::replace(&mut self.instructions, current_program); [INFO] [stdout] | ----------------------------------------------------------------------------- unnecessary `let` binding [INFO] [stdout] 586 | sub_program [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 585 ~ [INFO] [stdout] 586 ~ std::mem::replace(&mut self.instructions, current_program) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variant name ends with the enum's name [INFO] [stdout] --> src/error.rs:55:5 [INFO] [stdout] | [INFO] [stdout] 55 | ThreadingError, [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#enum_variant_names [INFO] [stdout] = note: `#[warn(clippy::enum_variant_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `if let .. else` expression looks like `matches!` macro [INFO] [stdout] --> src/compiler.rs:798:53 [INFO] [stdout] | [INFO] [stdout] 798 | let arity = call.args.iter().filter(|a| if let AstArg::Value(_) = a {true} else {false}).count(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 798 - let arity = call.args.iter().filter(|a| if let AstArg::Value(_) = a {true} else {false}).count(); [INFO] [stdout] 798 + let arity = call.args.iter().filter(|a| matches!(a, AstArg::Value(_))).count(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/compiler.rs:26:33 [INFO] [stdout] | [INFO] [stdout] 26 | Value::String(s) => s.len() > 0, [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!s.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `if let .. else` expression looks like `matches!` macro [INFO] [stdout] --> src/compiler.rs:33:9 [INFO] [stdout] | [INFO] [stdout] 33 | if let Value::Number(_) = self {true} else {false} [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] = note: `#[warn(clippy::match_like_matches_macro)]` on by default [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 33 - if let Value::Number(_) = self {true} else {false} [INFO] [stdout] 33 + matches!(self, Value::Number(_)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `if let .. else` expression looks like `matches!` macro [INFO] [stdout] --> src/compiler.rs:37:9 [INFO] [stdout] | [INFO] [stdout] 37 | if let Value::String(_) = self {true} else {false} [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 37 - if let Value::String(_) = self {true} else {false} [INFO] [stdout] 37 + matches!(self, Value::String(_)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/compiler.rs:58:31 [INFO] [stdout] | [INFO] [stdout] 58 | value.parse().map(|n| Value::Number(n)).map_err(|_| Error::IRParse { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Value::Number` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/compiler.rs:959:13 [INFO] [stdout] | [INFO] [stdout] 959 | / if let Op::Jump(a) = inst { [INFO] [stdout] 960 | | if *a == 0 { [INFO] [stdout] 961 | | *a = (sofar - i) as isize; [INFO] [stdout] 962 | | } [INFO] [stdout] 963 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 959 ~ if let Op::Jump(a) = inst [INFO] [stdout] 960 ~ && *a == 0 { [INFO] [stdout] 961 | *a = (sofar - i) as isize; [INFO] [stdout] 962 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/compiler.rs:123:9 [INFO] [stdout] | [INFO] [stdout] 123 | / match self { [INFO] [stdout] 124 | | Op::Call(_, _) | Op::CallParallel(_) | Op::CallRace(_) => true, [INFO] [stdout] 125 | | _ => false, [INFO] [stdout] 126 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 123 - match self { [INFO] [stdout] 124 - Op::Call(_, _) | Op::CallParallel(_) | Op::CallRace(_) => true, [INFO] [stdout] 125 - _ => false, [INFO] [stdout] 126 - } [INFO] [stdout] 123 + matches!(self, Op::Call(_, _) | Op::CallParallel(_) | Op::CallRace(_)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/interpreter.rs:168:16 [INFO] [stdout] | [INFO] [stdout] 168 | if line.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/compiler.rs:212:8 [INFO] [stdout] | [INFO] [stdout] 212 | if rest.len() != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!rest.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: useless use of `format!` [INFO] [stdout] --> src/compiler.rs:213:49 [INFO] [stdout] | [INFO] [stdout] 213 | return Err(Error::IRParse{line: 0, msg: format!("Every call in parallel call requires an arity")}); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Every call in parallel call requires an arity".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: length comparison to zero [INFO] [stdout] --> src/compiler.rs:266:12 [INFO] [stdout] | [INFO] [stdout] 266 | if parts.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `parts.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: redundant closure [INFO] [stdout] --> src/compiler.rs:273:65 [INFO] [stdout] | [INFO] [stdout] 273 | "load" => expect_len!(parts, 1, "load").parse().map(|a| Op::Load(a)).map_err(|_| Error::IRParse { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Op::Load` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/compiler.rs:277:67 [INFO] [stdout] | [INFO] [stdout] 277 | "store" => expect_len!(parts, 1, "store").parse().map(|a| Op::Store(a)).map_err(|_| Error::IRParse { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Op::Store` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/interpreter.rs:270:17 [INFO] [stdout] | [INFO] [stdout] 270 | / if (*ctx).dependencies.is_empty() { [INFO] [stdout] 271 | | if let Some(id) = (*ctx).current_callable { [INFO] [stdout] 272 | | if (*ctx).active { [INFO] [stdout] 273 | | self.active_callables.get_mut(&id).unwrap().terminate()?; [INFO] [stdout] ... | [INFO] [stdout] 277 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 270 ~ if (*ctx).dependencies.is_empty() [INFO] [stdout] 271 ~ && let Some(id) = (*ctx).current_callable { [INFO] [stdout] 272 | if (*ctx).active { [INFO] [stdout] ... [INFO] [stdout] 275 | self.active_callables.remove(&id); [INFO] [stdout] 276 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/interpreter.rs:330:20 [INFO] [stdout] | [INFO] [stdout] 330 | if (*ctx).dependencies.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `(*ctx).dependencies.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/interpreter.rs:369:33 [INFO] [stdout] | [INFO] [stdout] 369 | / ... if let Some(parent) = (*ctx).parent { [INFO] [stdout] 370 | | ... if (*parent).dependency_type == GroupKind::Race { [INFO] [stdout] 371 | | ... for dep in (*parent).dependencies.iter_mut() { [INFO] [stdout] 372 | | ... if dep.current_callable.is_some() { [INFO] [stdout] ... | [INFO] [stdout] 388 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 369 ~ if let Some(parent) = (*ctx).parent [INFO] [stdout] 370 ~ && (*parent).dependency_type == GroupKind::Race { [INFO] [stdout] 371 | for dep in (*parent).dependencies.iter_mut() { [INFO] [stdout] ... [INFO] [stdout] 386 | queue.push_back(parent); [INFO] [stdout] 387 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/compiler.rs:283:65 [INFO] [stdout] | [INFO] [stdout] 283 | "push" => expect_len!(parts, 1, "push").parse().map(|v| Op::Push(v)), [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Op::Push` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/compiler.rs:284:65 [INFO] [stdout] | [INFO] [stdout] 284 | "jump" => expect_len!(parts, 1, "jump").parse().map(|a| Op::Jump(a)).map_err(|_| Error::IRParse { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Op::Jump` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/compiler.rs:288:79 [INFO] [stdout] | [INFO] [stdout] 288 | "jump_unless" => expect_len!(parts, 1, "jump_unless").parse().map(|a| Op::JumpUnless(a)).map_err(|_| Error::IRParse { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Op::JumpUnless` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/compiler.rs:292:71 [INFO] [stdout] | [INFO] [stdout] 292 | "jump_if" => expect_len!(parts, 1, "jump_if").parse().map(|a| Op::JumpIf(a)).map_err(|_| Error::IRParse { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Op::JumpIf` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `if let .. else` expression looks like `matches!` macro [INFO] [stdout] --> src/compiler.rs:368:9 [INFO] [stdout] | [INFO] [stdout] 368 | / if let Arg::Value = self { [INFO] [stdout] 369 | | true [INFO] [stdout] 370 | | } else { [INFO] [stdout] 371 | | false [INFO] [stdout] 372 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 368 - if let Arg::Value = self { [INFO] [stdout] 369 - true [INFO] [stdout] 370 - } else { [INFO] [stdout] 371 - false [INFO] [stdout] 372 - } [INFO] [stdout] 368 + matches!(self, Arg::Value) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/compiler.rs:377:18 [INFO] [stdout] | [INFO] [stdout] 377 | Some(&s) [INFO] [stdout] | ^^ help: change this to: `s` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `if let .. else` expression looks like `matches!` macro [INFO] [stdout] --> src/compiler.rs:488:13 [INFO] [stdout] | [INFO] [stdout] 488 | if let Stmt::Use(_) = stmt {true} else {false} [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 488 - if let Stmt::Use(_) = stmt {true} else {false} [INFO] [stdout] 488 + matches!(stmt, Stmt::Use(_)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `extend` instead of `append` for adding the full range of a second vector [INFO] [stdout] --> src/compiler.rs:503:17 [INFO] [stdout] | [INFO] [stdout] 503 | this.instructions.extend(group.code.drain(..)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `this.instructions.append(&mut group.code)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extend_with_drain [INFO] [stdout] = note: `#[warn(clippy::extend_with_drain)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/compiler.rs:578:9 [INFO] [stdout] | [INFO] [stdout] 578 | scope.get(name).map(|i| *i).ok_or(Error::Compile{line: 0, msg: format!("Variable '{}' used before it was declared", name)}) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `scope.get(name).copied()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] = note: `#[warn(clippy::map_clone)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/compiler.rs:586:9 [INFO] [stdout] | [INFO] [stdout] 585 | let sub_program = std::mem::replace(&mut self.instructions, current_program); [INFO] [stdout] | ----------------------------------------------------------------------------- unnecessary `let` binding [INFO] [stdout] 586 | sub_program [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 585 ~ [INFO] [stdout] 586 ~ std::mem::replace(&mut self.instructions, current_program) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/interpreter.rs:595:20 [INFO] [stdout] | [INFO] [stdout] 595 | if calls.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!calls.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/interpreter.rs:619:20 [INFO] [stdout] | [INFO] [stdout] 619 | if calls.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!calls.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/interpreter.rs:688:24 [INFO] [stdout] | [INFO] [stdout] 688 | if !(self.callables.contains_key(name) || self.groups.contains_key(name)) && !seen.contains(name) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!(self.callables.contains_key(name) || self.groups.contains_key(name) || seen.contains(name))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/interpreter.rs:696:28 [INFO] [stdout] | [INFO] [stdout] 696 | if !(self.callables.contains_key(name) || self.groups.contains_key(name)) && !seen.contains(name) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!(self.callables.contains_key(name) || self.groups.contains_key(name) || seen.contains(name))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/interpreter.rs:661:21 [INFO] [stdout] | [INFO] [stdout] 661 | / if !seen.contains(name) && !self.props.contains_key(name) { [INFO] [stdout] 662 | | seen.insert(name.clone()); [INFO] [stdout] 663 | | errors.push(Error::UnregisteredProperty(i, name.into())); [INFO] [stdout] 664 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 660 ~ Op::Get(name) [INFO] [stdout] 661 ~ if !seen.contains(name) && !self.props.contains_key(name) => { [INFO] [stdout] 662 | seen.insert(name.clone()); [INFO] [stdout] 663 | errors.push(Error::UnregisteredProperty(i, name.into())); [INFO] [stdout] 664 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/interpreter.rs:688:21 [INFO] [stdout] | [INFO] [stdout] 688 | / if !(self.callables.contains_key(name) || self.groups.contains_key(name)) && !seen.contains(name) { [INFO] [stdout] 689 | | seen.insert(name.clone()); [INFO] [stdout] 690 | | errors.push(Error::UnregisteredCallable(i, name.into())); [INFO] [stdout] 691 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 687 ~ Op::Call(name, _) [INFO] [stdout] 688 ~ if !(self.callables.contains_key(name) || self.groups.contains_key(name)) && !seen.contains(name) => { [INFO] [stdout] 689 | seen.insert(name.clone()); [INFO] [stdout] 690 | errors.push(Error::UnregisteredCallable(i, name.into())); [INFO] [stdout] 691 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/interpreter.rs:670:33 [INFO] [stdout] | [INFO] [stdout] 670 | / ... if !seen.contains(name) { [INFO] [stdout] 671 | | ... seen.insert(name.clone()); [INFO] [stdout] 672 | | ... errors.push(Error::UnsettableProperty(i, name.into())); [INFO] [stdout] 673 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 669 ~ Ok(false) [INFO] [stdout] 670 ~ if !seen.contains(name) => { [INFO] [stdout] 671 | seen.insert(name.clone()); [INFO] [stdout] 672 | errors.push(Error::UnsettableProperty(i, name.into())); [INFO] [stdout] 673 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this lifetime isn't used in the impl [INFO] [stdout] --> src/main.rs:31:6 [INFO] [stdout] | [INFO] [stdout] 31 | impl<'a> AstPrinter { [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes [INFO] [stdout] = note: `#[warn(clippy::extra_unused_lifetimes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice` [INFO] [stdout] --> src/main.rs:40:39 [INFO] [stdout] | [INFO] [stdout] 40 | format!("({} {})", name, args.into_iter().map(|exp| { [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] = note: `#[warn(clippy::into_iter_on_ref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/main.rs:52:9 [INFO] [stdout] | [INFO] [stdout] 52 | format!("{}", self.parenthesize(&expr.op.lexeme, &[&expr.left, &expr.right])) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `self.parenthesize(&expr.op.lexeme, &[&expr.left, &expr.right]).to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:52:41 [INFO] [stdout] | [INFO] [stdout] 52 | format!("{}", self.parenthesize(&expr.op.lexeme, &[&expr.left, &expr.right])) [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: change this to: `expr.op.lexeme` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `if let .. else` expression looks like `matches!` macro [INFO] [stdout] --> src/compiler.rs:798:53 [INFO] [stdout] | [INFO] [stdout] 798 | let arity = call.args.iter().filter(|a| if let AstArg::Value(_) = a {true} else {false}).count(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 798 - let arity = call.args.iter().filter(|a| if let AstArg::Value(_) = a {true} else {false}).count(); [INFO] [stdout] 798 + let arity = call.args.iter().filter(|a| matches!(a, AstArg::Value(_))).count(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/main.rs:56:9 [INFO] [stdout] | [INFO] [stdout] 56 | format!("{}", self.parenthesize(if expr.abs {"abs"} else {"group"}, &[&expr.expression])) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `self.parenthesize(if expr.abs {"abs"} else {"group"}, &[&expr.expression]).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: useless use of `format!` [INFO] [stdout] --> src/main.rs:64:9 [INFO] [stdout] | [INFO] [stdout] 64 | format!("{}", self.parenthesize(&expr.op.lexeme, &[&expr.left, &expr.right])) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `self.parenthesize(&expr.op.lexeme, &[&expr.left, &expr.right]).to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:64:41 [INFO] [stdout] | [INFO] [stdout] 64 | format!("{}", self.parenthesize(&expr.op.lexeme, &[&expr.left, &expr.right])) [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: change this to: `expr.op.lexeme` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/main.rs:68:9 [INFO] [stdout] | [INFO] [stdout] 68 | format!("{}", self.parenthesize(&expr.op.lexeme, &[&expr.right])) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `self.parenthesize(&expr.op.lexeme, &[&expr.right]).to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:68:41 [INFO] [stdout] | [INFO] [stdout] 68 | format!("{}", self.parenthesize(&expr.op.lexeme, &[&expr.right])) [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: change this to: `expr.op.lexeme` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/main.rs:72:9 [INFO] [stdout] | [INFO] [stdout] 72 | format!("{}", expr.name.lexeme) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `expr.name.lexeme.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: length comparison to zero [INFO] [stdout] --> src/main.rs:106:12 [INFO] [stdout] | [INFO] [stdout] 106 | if stmt.else_branch.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `stmt.else_branch.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/compiler.rs:959:13 [INFO] [stdout] | [INFO] [stdout] 959 | / if let Op::Jump(a) = inst { [INFO] [stdout] 960 | | if *a == 0 { [INFO] [stdout] 961 | | *a = (sofar - i) as isize; [INFO] [stdout] 962 | | } [INFO] [stdout] 963 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 959 ~ if let Op::Jump(a) = inst [INFO] [stdout] 960 ~ && *a == 0 { [INFO] [stdout] 961 | *a = (sofar - i) as isize; [INFO] [stdout] 962 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/main.rs:151:9 [INFO] [stdout] | [INFO] [stdout] 151 | format!("(return)") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"(return)".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: useless use of `format!` [INFO] [stdout] --> src/main.rs:155:9 [INFO] [stdout] | [INFO] [stdout] 155 | format!("(yield)") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"(yield)".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: useless use of `format!` [INFO] [stdout] --> src/main.rs:159:9 [INFO] [stdout] | [INFO] [stdout] 159 | format!("(break)") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"(break)".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: length comparison to zero [INFO] [stdout] --> src/interpreter.rs:168:16 [INFO] [stdout] | [INFO] [stdout] 168 | if line.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/main.rs:197:12 [INFO] [stdout] | [INFO] [stdout] 197 | if args.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!args.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/main.rs:236:12 [INFO] [stdout] | [INFO] [stdout] 236 | if args.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!args.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/interpreter.rs:270:17 [INFO] [stdout] | [INFO] [stdout] 270 | / if (*ctx).dependencies.is_empty() { [INFO] [stdout] 271 | | if let Some(id) = (*ctx).current_callable { [INFO] [stdout] 272 | | if (*ctx).active { [INFO] [stdout] 273 | | self.active_callables.get_mut(&id).unwrap().terminate()?; [INFO] [stdout] ... | [INFO] [stdout] 277 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 270 ~ if (*ctx).dependencies.is_empty() [INFO] [stdout] 271 ~ && let Some(id) = (*ctx).current_callable { [INFO] [stdout] 272 | if (*ctx).active { [INFO] [stdout] ... [INFO] [stdout] 275 | self.active_callables.remove(&id); [INFO] [stdout] 276 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/interpreter.rs:330:20 [INFO] [stdout] | [INFO] [stdout] 330 | if (*ctx).dependencies.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `(*ctx).dependencies.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/interpreter.rs:369:33 [INFO] [stdout] | [INFO] [stdout] 369 | / ... if let Some(parent) = (*ctx).parent { [INFO] [stdout] 370 | | ... if (*parent).dependency_type == GroupKind::Race { [INFO] [stdout] 371 | | ... for dep in (*parent).dependencies.iter_mut() { [INFO] [stdout] 372 | | ... if dep.current_callable.is_some() { [INFO] [stdout] ... | [INFO] [stdout] 388 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 369 ~ if let Some(parent) = (*ctx).parent [INFO] [stdout] 370 ~ && (*parent).dependency_type == GroupKind::Race { [INFO] [stdout] 371 | for dep in (*parent).dependencies.iter_mut() { [INFO] [stdout] ... [INFO] [stdout] 386 | queue.push_back(parent); [INFO] [stdout] 387 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/interpreter.rs:595:20 [INFO] [stdout] | [INFO] [stdout] 595 | if calls.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!calls.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/interpreter.rs:619:20 [INFO] [stdout] | [INFO] [stdout] 619 | if calls.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!calls.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/interpreter.rs:688:24 [INFO] [stdout] | [INFO] [stdout] 688 | if !(self.callables.contains_key(name) || self.groups.contains_key(name)) && !seen.contains(name) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!(self.callables.contains_key(name) || self.groups.contains_key(name) || seen.contains(name))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/interpreter.rs:696:28 [INFO] [stdout] | [INFO] [stdout] 696 | if !(self.callables.contains_key(name) || self.groups.contains_key(name)) && !seen.contains(name) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!(self.callables.contains_key(name) || self.groups.contains_key(name) || seen.contains(name))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/interpreter.rs:661:21 [INFO] [stdout] | [INFO] [stdout] 661 | / if !seen.contains(name) && !self.props.contains_key(name) { [INFO] [stdout] 662 | | seen.insert(name.clone()); [INFO] [stdout] 663 | | errors.push(Error::UnregisteredProperty(i, name.into())); [INFO] [stdout] 664 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 660 ~ Op::Get(name) [INFO] [stdout] 661 ~ if !seen.contains(name) && !self.props.contains_key(name) => { [INFO] [stdout] 662 | seen.insert(name.clone()); [INFO] [stdout] 663 | errors.push(Error::UnregisteredProperty(i, name.into())); [INFO] [stdout] 664 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/interpreter.rs:688:21 [INFO] [stdout] | [INFO] [stdout] 688 | / if !(self.callables.contains_key(name) || self.groups.contains_key(name)) && !seen.contains(name) { [INFO] [stdout] 689 | | seen.insert(name.clone()); [INFO] [stdout] 690 | | errors.push(Error::UnregisteredCallable(i, name.into())); [INFO] [stdout] 691 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 687 ~ Op::Call(name, _) [INFO] [stdout] 688 ~ if !(self.callables.contains_key(name) || self.groups.contains_key(name)) && !seen.contains(name) => { [INFO] [stdout] 689 | seen.insert(name.clone()); [INFO] [stdout] 690 | errors.push(Error::UnregisteredCallable(i, name.into())); [INFO] [stdout] 691 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/interpreter.rs:670:33 [INFO] [stdout] | [INFO] [stdout] 670 | / ... if !seen.contains(name) { [INFO] [stdout] 671 | | ... seen.insert(name.clone()); [INFO] [stdout] 672 | | ... errors.push(Error::UnsettableProperty(i, name.into())); [INFO] [stdout] 673 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 669 ~ Ok(false) [INFO] [stdout] 670 ~ if !seen.contains(name) => { [INFO] [stdout] 671 | seen.insert(name.clone()); [INFO] [stdout] 672 | errors.push(Error::UnsettableProperty(i, name.into())); [INFO] [stdout] 673 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this lifetime isn't used in the impl [INFO] [stdout] --> src/main.rs:31:6 [INFO] [stdout] | [INFO] [stdout] 31 | impl<'a> AstPrinter { [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes [INFO] [stdout] = note: `#[warn(clippy::extra_unused_lifetimes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice` [INFO] [stdout] --> src/main.rs:40:39 [INFO] [stdout] | [INFO] [stdout] 40 | format!("({} {})", name, args.into_iter().map(|exp| { [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] = note: `#[warn(clippy::into_iter_on_ref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/main.rs:52:9 [INFO] [stdout] | [INFO] [stdout] 52 | format!("{}", self.parenthesize(&expr.op.lexeme, &[&expr.left, &expr.right])) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `self.parenthesize(&expr.op.lexeme, &[&expr.left, &expr.right]).to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:52:41 [INFO] [stdout] | [INFO] [stdout] 52 | format!("{}", self.parenthesize(&expr.op.lexeme, &[&expr.left, &expr.right])) [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: change this to: `expr.op.lexeme` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/main.rs:56:9 [INFO] [stdout] | [INFO] [stdout] 56 | format!("{}", self.parenthesize(if expr.abs {"abs"} else {"group"}, &[&expr.expression])) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `self.parenthesize(if expr.abs {"abs"} else {"group"}, &[&expr.expression]).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: useless use of `format!` [INFO] [stdout] --> src/main.rs:64:9 [INFO] [stdout] | [INFO] [stdout] 64 | format!("{}", self.parenthesize(&expr.op.lexeme, &[&expr.left, &expr.right])) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `self.parenthesize(&expr.op.lexeme, &[&expr.left, &expr.right]).to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:64:41 [INFO] [stdout] | [INFO] [stdout] 64 | format!("{}", self.parenthesize(&expr.op.lexeme, &[&expr.left, &expr.right])) [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: change this to: `expr.op.lexeme` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/main.rs:68:9 [INFO] [stdout] | [INFO] [stdout] 68 | format!("{}", self.parenthesize(&expr.op.lexeme, &[&expr.right])) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `self.parenthesize(&expr.op.lexeme, &[&expr.right]).to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:68:41 [INFO] [stdout] | [INFO] [stdout] 68 | format!("{}", self.parenthesize(&expr.op.lexeme, &[&expr.right])) [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: change this to: `expr.op.lexeme` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/main.rs:72:9 [INFO] [stdout] | [INFO] [stdout] 72 | format!("{}", expr.name.lexeme) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `expr.name.lexeme.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: length comparison to zero [INFO] [stdout] --> src/main.rs:106:12 [INFO] [stdout] | [INFO] [stdout] 106 | if stmt.else_branch.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `stmt.else_branch.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: useless use of `format!` [INFO] [stdout] --> src/main.rs:151:9 [INFO] [stdout] | [INFO] [stdout] 151 | format!("(return)") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"(return)".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: useless use of `format!` [INFO] [stdout] --> src/main.rs:155:9 [INFO] [stdout] | [INFO] [stdout] 155 | format!("(yield)") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"(yield)".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: useless use of `format!` [INFO] [stdout] --> src/main.rs:159:9 [INFO] [stdout] | [INFO] [stdout] 159 | format!("(break)") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"(break)".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: length comparison to zero [INFO] [stdout] --> src/main.rs:197:12 [INFO] [stdout] | [INFO] [stdout] 197 | if args.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!args.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/main.rs:236:12 [INFO] [stdout] | [INFO] [stdout] 236 | if args.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!args.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] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 9.93s [INFO] running `Command { std: "docker" "inspect" "fde8ec0ac8bfe257c73e1d193378bdce2e4a2564c9b1abdb457b3397fc83977d", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "fde8ec0ac8bfe257c73e1d193378bdce2e4a2564c9b1abdb457b3397fc83977d", kill_on_drop: false }` [INFO] [stdout] fde8ec0ac8bfe257c73e1d193378bdce2e4a2564c9b1abdb457b3397fc83977d