[INFO] cloning repository https://github.com/adrianhelvik/funlang [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/adrianhelvik/funlang" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fadrianhelvik%2Ffunlang", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fadrianhelvik%2Ffunlang'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 076cbb6a1eeb945582d5849ac3c9061672b95c94 [INFO] linting adrianhelvik/funlang against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fadrianhelvik%2Ffunlang" "/workspace/builds/worker-3-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-3-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/adrianhelvik/funlang [INFO] finished tweaking git repo https://github.com/adrianhelvik/funlang [INFO] tweaked toml for git repo https://github.com/adrianhelvik/funlang written to /workspace/builds/worker-3-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/adrianhelvik/funlang on toolchain nightly [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] crate git repo https://github.com/adrianhelvik/funlang already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Blocking waiting for file lock on package cache [INFO] [stderr] Updating crates.io index [INFO] [stderr] Blocking waiting for file lock on package cache [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded resolve-path v0.1.0 [INFO] [stderr] Downloaded darrentsung_debug_parser v0.3.1 [INFO] [stderr] Downloaded colorful v0.2.2 [INFO] [stderr] Downloaded pretty_assertions_sorted v1.2.3 [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] f666ed52e80eeea04e95d6fb194f39a324812f6a8c8eebc817ccac6d1e7788c7 [INFO] running `Command { std: "docker" "start" "-a" "f666ed52e80eeea04e95d6fb194f39a324812f6a8c8eebc817ccac6d1e7788c7", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "f666ed52e80eeea04e95d6fb194f39a324812f6a8c8eebc817ccac6d1e7788c7", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "f666ed52e80eeea04e95d6fb194f39a324812f6a8c8eebc817ccac6d1e7788c7", kill_on_drop: false }` [INFO] [stdout] f666ed52e80eeea04e95d6fb194f39a324812f6a8c8eebc817ccac6d1e7788c7 [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] 2e6464ec47cd5853ed8f19b745031af4901e30667342ffc389c987322953a59f [INFO] running `Command { std: "docker" "start" "-a" "2e6464ec47cd5853ed8f19b745031af4901e30667342ffc389c987322953a59f", kill_on_drop: false }` [INFO] [stderr] Compiling libc v0.2.168 [INFO] [stderr] Checking utf8-width v0.1.6 [INFO] [stderr] Checking bytes v1.9.0 [INFO] [stderr] Checking colorful v0.2.2 [INFO] [stderr] Checking unescape v0.1.0 [INFO] [stderr] Compiling num-traits v0.2.16 [INFO] [stderr] Checking pretty_assertions v1.4.1 [INFO] [stderr] Checking nom v7.1.3 [INFO] [stderr] Checking html-escape v0.2.13 [INFO] [stderr] Checking http v1.2.0 [INFO] [stderr] Checking dirs-sys v0.3.7 [INFO] [stderr] Checking dirs v4.0.0 [INFO] [stderr] Checking resolve-path v0.1.0 [INFO] [stderr] Checking fun v0.1.0 (/opt/rustwide/workdir) [INFO] [stderr] Checking ordered-float v2.10.0 [INFO] [stderr] Checking darrentsung_debug_parser v0.3.1 [INFO] [stdout] warning: associated function `from` is never used [INFO] [stdout] --> src/parser.rs:155:12 [INFO] [stdout] | [INFO] [stdout] 147 | impl State { [INFO] [stdout] | ---------- associated function in this implementation [INFO] [stdout] ... [INFO] [stdout] 155 | pub fn from(tokens: &Tokens) -> Self { [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `args.get(0)` [INFO] [stdout] --> src/builtins.rs:58:19 [INFO] [stdout] | [INFO] [stdout] 58 | let mut sum = args [INFO] [stdout] | ___________________^ [INFO] [stdout] 59 | | .get(0) [INFO] [stdout] | |_______________^ help: try: `args.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `args` [INFO] [stdout] --> src/builtins.rs:63:14 [INFO] [stdout] | [INFO] [stdout] 63 | for i in 1..args.len() { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 63 - for i in 1..args.len() { [INFO] [stdout] 63 + for in args.iter().skip(1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `args.get(0)` [INFO] [stdout] --> src/builtins.rs:76:19 [INFO] [stdout] | [INFO] [stdout] 76 | let mut sum = args [INFO] [stdout] | ___________________^ [INFO] [stdout] 77 | | .get(0) [INFO] [stdout] | |_______________^ help: try: `args.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `args` [INFO] [stdout] --> src/builtins.rs:81:14 [INFO] [stdout] | [INFO] [stdout] 81 | for i in 1..args.len() { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 81 - for i in 1..args.len() { [INFO] [stdout] 81 + for in args.iter().skip(1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/builtins.rs:145:16 [INFO] [stdout] | [INFO] [stdout] 145 | if !(first <= second) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `(first > second)` [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: length comparison to zero [INFO] [stdout] --> src/builtins.rs:135:8 [INFO] [stdout] | [INFO] [stdout] 135 | if values.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!values.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: the loop variable `i` is only used to index `values` [INFO] [stdout] --> src/builtins.rs:140:18 [INFO] [stdout] | [INFO] [stdout] 140 | for i in 1..values.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 140 - for i in 1..values.len() { [INFO] [stdout] 140 + for in values.iter().skip(1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/builtins.rs:171:16 [INFO] [stdout] | [INFO] [stdout] 171 | if !(first < second) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `(first >= second)` [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: length comparison to zero [INFO] [stdout] --> src/builtins.rs:161:8 [INFO] [stdout] | [INFO] [stdout] 161 | if values.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!values.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: the loop variable `i` is only used to index `values` [INFO] [stdout] --> src/builtins.rs:166:18 [INFO] [stdout] | [INFO] [stdout] 166 | for i in 1..values.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 166 - for i in 1..values.len() { [INFO] [stdout] 166 + for in values.iter().skip(1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/builtins.rs:197:16 [INFO] [stdout] | [INFO] [stdout] 197 | if !(first >= second) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `(first < second)` [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: length comparison to zero [INFO] [stdout] --> src/builtins.rs:187:8 [INFO] [stdout] | [INFO] [stdout] 187 | if values.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!values.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: the loop variable `i` is only used to index `values` [INFO] [stdout] --> src/builtins.rs:192:18 [INFO] [stdout] | [INFO] [stdout] 192 | for i in 1..values.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 192 - for i in 1..values.len() { [INFO] [stdout] 192 + for in values.iter().skip(1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/builtins.rs:223:16 [INFO] [stdout] | [INFO] [stdout] 223 | if !(first > second) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `(first <= second)` [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: length comparison to zero [INFO] [stdout] --> src/builtins.rs:213:8 [INFO] [stdout] | [INFO] [stdout] 213 | if values.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!values.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: the loop variable `i` is only used to index `values` [INFO] [stdout] --> src/builtins.rs:218:18 [INFO] [stdout] | [INFO] [stdout] 218 | for i in 1..values.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 218 - for i in 1..values.len() { [INFO] [stdout] 218 + for in values.iter().skip(1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/builtins.rs:285:5 [INFO] [stdout] | [INFO] [stdout] 285 | return Ok(func_call.expr(Expression::Bool(false))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 285 - return Ok(func_call.expr(Expression::Bool(false))); [INFO] [stdout] 285 + Ok(func_call.expr(Expression::Bool(false))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to one [INFO] [stdout] --> src/builtins.rs:273:8 [INFO] [stdout] | [INFO] [stdout] 273 | if expressions.len() < 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `expressions.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/builtins.rs:306:5 [INFO] [stdout] | [INFO] [stdout] 306 | return Ok(func_call.expr(Expression::Bool(true))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 306 - return Ok(func_call.expr(Expression::Bool(true))); [INFO] [stdout] 306 + Ok(func_call.expr(Expression::Bool(true))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to one [INFO] [stdout] --> src/builtins.rs:294:8 [INFO] [stdout] | [INFO] [stdout] 294 | if expressions.len() < 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `expressions.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/builtins.rs:326:5 [INFO] [stdout] | [INFO] [stdout] 326 | return Ok(func_call.expr(Expression::Int(first % second))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 326 - return Ok(func_call.expr(Expression::Int(first % second))); [INFO] [stdout] 326 + Ok(func_call.expr(Expression::Int(first % second))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/builtins.rs:368:38 [INFO] [stdout] | [INFO] [stdout] 368 | if let Expression::List(list) = &(*func_call.this).expr { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `func_call.this` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] = note: `#[warn(clippy::explicit_auto_deref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/builtins.rs:378:8 [INFO] [stdout] | [INFO] [stdout] 378 | 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: deref which would be done by auto-deref [INFO] [stdout] --> src/builtins.rs:386:38 [INFO] [stdout] | [INFO] [stdout] 386 | if let Expression::List(list) = &(*func_call.this).expr { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `func_call.this` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/interpreter.rs:112:66 [INFO] [stdout] | [INFO] [stdout] 112 | Expression::FuncExpr(func_expr) => call_func(&func_expr, &func_call, ctx, ctx), [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `func_call` [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: accessing first element with `chars.get(0)` [INFO] [stdout] --> src/interpreter.rs:255:27 [INFO] [stdout] | [INFO] [stdout] 255 | if let Some(ch) = chars.get(0) { [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `chars.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/interpreter.rs:292:42 [INFO] [stdout] | [INFO] [stdout] 292 | let value = remote_scope.get(&ident).map_err(|_| { [INFO] [stdout] | ^^^^^^ help: change this to: `ident` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter.rs:353:9 [INFO] [stdout] | [INFO] [stdout] 353 | return expr_list_debug_str("\n", &self.expressions); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 353 - return expr_list_debug_str("\n", &self.expressions); [INFO] [stdout] 353 + expr_list_debug_str("\n", &self.expressions) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/interpreter.rs:374:54 [INFO] [stdout] | [INFO] [stdout] 374 | fn expr_list_debug_str(delimiter: &str, expressions: &Vec) -> String { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 374 - fn expr_list_debug_str(delimiter: &str, expressions: &Vec) -> String { [INFO] [stdout] 374 + fn expr_list_debug_str(delimiter: &str, expressions: &[LocExpr]) -> String { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/interpreter.rs:383:9 [INFO] [stdout] | [INFO] [stdout] 383 | / match self.expr { [INFO] [stdout] 384 | | Expression::Touple(_) => true, [INFO] [stdout] 385 | | _ => false, [INFO] [stdout] 386 | | } [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] 383 - match self.expr { [INFO] [stdout] 384 - Expression::Touple(_) => true, [INFO] [stdout] 385 - _ => false, [INFO] [stdout] 386 - } [INFO] [stdout] 383 + matches!(self.expr, Expression::Touple(_)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `i64` which implements the `Copy` trait [INFO] [stdout] --> src/interpreter.rs:408:40 [INFO] [stdout] | [INFO] [stdout] 408 | Expression::Int(int) => Ok(int.clone()), [INFO] [stdout] | ^^^^^^^^^^^ help: try dereferencing it: `*int` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter.rs:560:17 [INFO] [stdout] | [INFO] [stdout] 560 | return Ok(last); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 560 - return Ok(last); [INFO] [stdout] 560 + Ok(last) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter.rs:577:17 [INFO] [stdout] | [INFO] [stdout] 577 | return Ok(last); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 577 - return Ok(last); [INFO] [stdout] 577 + Ok(last) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter.rs:591:17 [INFO] [stdout] | [INFO] [stdout] 591 | return Ok(self.loc.wrap(Expression::Return(Box::new(inner)))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 591 - return Ok(self.loc.wrap(Expression::Return(Box::new(inner)))); [INFO] [stdout] 591 + Ok(self.loc.wrap(Expression::Return(Box::new(inner)))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/interpreter.rs:510:40 [INFO] [stdout] | [INFO] [stdout] 510 | ctx.scope.reassign(&var, reassignment.expr.eval(ctx)?) [INFO] [stdout] | ^^^^ help: change this to: `var` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enclosing `Ok` and `?` operator are unneeded [INFO] [stdout] --> src/interpreter.rs:516:28 [INFO] [stdout] | [INFO] [stdout] 516 | return Ok(value[0].clone().eval(ctx)?); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark [INFO] [stdout] = note: `#[warn(clippy::needless_question_mark)]` on by default [INFO] [stdout] help: remove the enclosing `Ok` and `?` operator [INFO] [stdout] | [INFO] [stdout] 516 - return Ok(value[0].clone().eval(ctx)?); [INFO] [stdout] 516 + return value[0].clone().eval(ctx); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/interpreter.rs:531:31 [INFO] [stdout] | [INFO] [stdout] 531 | ctx.scope.get(&var) [INFO] [stdout] | ^^^^ help: change this to: `var` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/interpreter.rs:557:54 [INFO] [stdout] | [INFO] [stdout] 557 | last = eval_expr_list(&self.loc, &body, &child_ctx)?; [INFO] [stdout] | ^^^^^ help: change this to: `body` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/interpreter.rs:574:54 [INFO] [stdout] | [INFO] [stdout] 574 | last = eval_expr_list(&self.loc, &body, &child_ctx)?; [INFO] [stdout] | ^^^^^ help: change this to: `body` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/interpreter.rs:584:55 [INFO] [stdout] | [INFO] [stdout] 584 | eval_expr_and_call_returned_block(&else_expr, ctx) [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `else_expr` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `bool` which implements the `Copy` trait [INFO] [stdout] --> src/interpreter.rs:593:74 [INFO] [stdout] | [INFO] [stdout] 593 | Expression::Bool(value) => Ok(self.loc.wrap(Expression::Bool(value.clone()))), [INFO] [stdout] | ^^^^^^^^^^^^^ help: try dereferencing it: `*value` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/interpreter.rs:637:56 [INFO] [stdout] | [INFO] [stdout] 637 | Expression::Variable(var) => ctx.scope.get(&var)?.as_string(ctx), [INFO] [stdout] | ^^^^ help: change this to: `var` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `bool` which implements the `Copy` trait [INFO] [stdout] --> src/interpreter.rs:652:43 [INFO] [stdout] | [INFO] [stdout] 652 | Expression::Bool(value) => Ok(value.clone()), [INFO] [stdout] | ^^^^^^^^^^^^^ help: try removing the `clone` call: `value` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter.rs:690:9 [INFO] [stdout] | [INFO] [stdout] 690 | return Ok(format!("[{}]", join(", ", stringified_items))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 690 - return Ok(format!("[{}]", join(", ", stringified_items))); [INFO] [stdout] 690 + Ok(format!("[{}]", join(", ", stringified_items))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/interpreter.rs:694:42 [INFO] [stdout] | [INFO] [stdout] 694 | fn expressions_to_debug_str(expressions: &Vec) -> String { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 694 - fn expressions_to_debug_str(expressions: &Vec) -> String { [INFO] [stdout] 694 + fn expressions_to_debug_str(expressions: &[LocExpr]) -> String { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this call to `as_ref` does nothing [INFO] [stdout] --> src/interpreter.rs:700:15 [INFO] [stdout] | [INFO] [stdout] 700 | match key.as_ref() { [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_asref [INFO] [stdout] = note: `#[warn(clippy::useless_asref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter.rs:767:17 [INFO] [stdout] | [INFO] [stdout] 767 | / return format!( [INFO] [stdout] 768 | | "from \"{}\" import {}", [INFO] [stdout] 769 | | import_expr.path, [INFO] [stdout] 770 | | join(", ", imported) [INFO] [stdout] 771 | | ); [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 767 ~ format!( [INFO] [stdout] 768 + "from \"{}\" import {}", [INFO] [stdout] 769 + import_expr.path, [INFO] [stdout] 770 + join(", ", imported) [INFO] [stdout] 771 ~ ) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter.rs:828:17 [INFO] [stdout] | [INFO] [stdout] 828 | / return format!( [INFO] [stdout] 829 | | "{{\n{}\n}}", [INFO] [stdout] 830 | | closure [INFO] [stdout] 831 | | .func_expr [INFO] [stdout] ... | [INFO] [stdout] 835 | | .fold(String::new(), |a, b| format!("{}\n{}", a, b)) [INFO] [stdout] 836 | | ); [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 828 ~ format!( [INFO] [stdout] 829 + "{{\n{}\n}}", [INFO] [stdout] 830 + closure [INFO] [stdout] 831 + .func_expr [INFO] [stdout] 832 + .expressions [INFO] [stdout] 833 + .iter() [INFO] [stdout] 834 + .map(|it| it.debug_str()) [INFO] [stdout] 835 + .fold(String::new(), |a, b| format!("{}\n{}", a, b)) [INFO] [stdout] 836 ~ ) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter.rs:840:21 [INFO] [stdout] | [INFO] [stdout] 840 | / return format!( [INFO] [stdout] 841 | | "if {} {} else {}", [INFO] [stdout] 842 | | if_expr.condition.debug_str(), [INFO] [stdout] 843 | | if_expr.then_expr.debug_str(), [INFO] [stdout] 844 | | else_expr.debug_str() [INFO] [stdout] 845 | | ); [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 840 ~ format!( [INFO] [stdout] 841 + "if {} {} else {}", [INFO] [stdout] 842 + if_expr.condition.debug_str(), [INFO] [stdout] 843 + if_expr.then_expr.debug_str(), [INFO] [stdout] 844 + else_expr.debug_str() [INFO] [stdout] 845 ~ ) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter.rs:847:21 [INFO] [stdout] | [INFO] [stdout] 847 | / return format!( [INFO] [stdout] 848 | | "if {} {}", [INFO] [stdout] 849 | | if_expr.condition.debug_str(), [INFO] [stdout] 850 | | if_expr.then_expr.debug_str() [INFO] [stdout] 851 | | ); [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 847 ~ format!( [INFO] [stdout] 848 + "if {} {}", [INFO] [stdout] 849 + if_expr.condition.debug_str(), [INFO] [stdout] 850 + if_expr.then_expr.debug_str() [INFO] [stdout] 851 ~ ) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/interpreter.rs:802:58 [INFO] [stdout] | [INFO] [stdout] 802 | format!("({})", expressions_to_debug_str(&expressions)) [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `expressions` [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 are using an explicit closure for cloning elements [INFO] [stdout] --> src/interpreter.rs:818:43 [INFO] [stdout] | [INFO] [stdout] 818 | let args_str = join(", ", func_expr.args.iter().map(|it| it.clone()).collect()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `cloned` method: `func_expr.args.iter().cloned()` [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: unneeded `return` statement [INFO] [stdout] --> src/interpreter.rs:867:25 [INFO] [stdout] | [INFO] [stdout] 867 | return format!("{} = {}", k, v.debug_str()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 867 - return format!("{} = {}", k, v.debug_str()); [INFO] [stdout] 867 + format!("{} = {}", k, v.debug_str()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Scope` [INFO] [stdout] --> src/scope.rs:12:5 [INFO] [stdout] | [INFO] [stdout] 12 | / pub fn new() -> Self { [INFO] [stdout] 13 | | Scope { [INFO] [stdout] 14 | | values: Box::new(RefCell::new(HashMap::new())), [INFO] [stdout] 15 | | parent: None, [INFO] [stdout] 16 | | } [INFO] [stdout] 17 | | } [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] 11 + impl Default for Scope { [INFO] [stdout] 12 + fn default() -> Self { [INFO] [stdout] 13 + Self::new() [INFO] [stdout] 14 + } [INFO] [stdout] 15 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/scope.rs:71:13 [INFO] [stdout] | [INFO] [stdout] 71 | return Ok(expr); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 71 - return Ok(expr); [INFO] [stdout] 71 + Ok(expr) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/lexer.rs:24:12 [INFO] [stdout] | [INFO] [stdout] 24 | if self.word.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.word.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: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/lexer.rs:31:26 [INFO] [stdout] | [INFO] [stdout] 31 | Loc::new(self.line.clone(), self.column.clone()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/lexer.rs:31:45 [INFO] [stdout] | [INFO] [stdout] 31 | Loc::new(self.line.clone(), self.column.clone()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.column` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/lexer.rs:52:43 [INFO] [stdout] | [INFO] [stdout] 52 | for (_i, c) in self.source.chars().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index [INFO] [stdout] = note: `#[warn(clippy::unused_enumerate_index)]` on by default [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 52 - for (_i, c) in self.source.chars().enumerate() { [INFO] [stdout] 52 + for c in self.source.chars() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/parser.rs:107:5 [INFO] [stdout] | [INFO] [stdout] 107 | return Err(None); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 107 - return Err(None); [INFO] [stdout] 107 + Err(None) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/parser.rs:198:9 [INFO] [stdout] | [INFO] [stdout] 198 | / return Ok(( [INFO] [stdout] 199 | | first, [INFO] [stdout] 200 | | State { [INFO] [stdout] 201 | | tokens, [INFO] [stdout] ... | [INFO] [stdout] 204 | | }, [INFO] [stdout] 205 | | )); [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 198 ~ Ok(( [INFO] [stdout] 199 + first, [INFO] [stdout] 200 + State { [INFO] [stdout] 201 + tokens, [INFO] [stdout] 202 + final_loc: self.final_loc.clone(), [INFO] [stdout] 203 + is_in_block_arg: self.is_in_block_arg, [INFO] [stdout] 204 + }, [INFO] [stdout] 205 ~ )) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/parser.rs:192:12 [INFO] [stdout] | [INFO] [stdout] 192 | if self.tokens.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.tokens.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: accessing first element with `self.tokens.get(0)` [INFO] [stdout] --> src/parser.rs:211:24 [INFO] [stdout] | [INFO] [stdout] 211 | loc: match self.tokens.get(0) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `self.tokens.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/parser.rs:219:9 [INFO] [stdout] | [INFO] [stdout] 219 | / return match self.tokens.first() { [INFO] [stdout] 220 | | Some(token) => token.value == expected, [INFO] [stdout] 221 | | None => false, [INFO] [stdout] 222 | | }; [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 219 ~ match self.tokens.first() { [INFO] [stdout] 220 + Some(token) => token.value == expected, [INFO] [stdout] 221 + None => false, [INFO] [stdout] 222 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `self.tokens.get(0)` [INFO] [stdout] --> src/parser.rs:242:9 [INFO] [stdout] | [INFO] [stdout] 242 | self.tokens.get(0).map(|t| t.loc.clone()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `self.tokens.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/parser.rs:313:42 [INFO] [stdout] | [INFO] [stdout] 313 | let (let_token, state) = pick("let", &state)?; [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/parser.rs:408:52 [INFO] [stdout] | [INFO] [stdout] 408 | let (start_expr, state) = parse_block_arg_expr(&state)?; [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/parser.rs:438:5 [INFO] [stdout] | [INFO] [stdout] 438 | return Ok((for_kw.loc.wrap(Expression::ForExpr(for_expr)), state)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 438 - return Ok((for_kw.loc.wrap(Expression::ForExpr(for_expr)), state)); [INFO] [stdout] 438 + Ok((for_kw.loc.wrap(Expression::ForExpr(for_expr)), state)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/parser.rs:421:39 [INFO] [stdout] | [INFO] [stdout] 421 | let (for_kw, state) = pick("for", &state)?; [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/parser.rs:442:37 [INFO] [stdout] | [INFO] [stdout] 442 | let (kw, state) = pick("while", &state)?; [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/parser.rs:635:5 [INFO] [stdout] | [INFO] [stdout] 635 | return true; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 635 - return true; [INFO] [stdout] 635 + true [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `token.value.chars().collect::>().get(0)` [INFO] [stdout] --> src/parser.rs:642:31 [INFO] [stdout] | [INFO] [stdout] 642 | if let Some(first_char) = token.value.chars().collect::>().get(0) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `token.value.chars().collect::>().first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/parser.rs:647:5 [INFO] [stdout] | [INFO] [stdout] 647 | / match token.value.as_ref() { [INFO] [stdout] 648 | | "\n" | "(" | ")" | "{" | "}" | "[" | "]" | "," | ".." | "=" | "." => false, [INFO] [stdout] 649 | | _ => true, [INFO] [stdout] 650 | | } [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] 647 - match token.value.as_ref() { [INFO] [stdout] 648 - "\n" | "(" | ")" | "{" | "}" | "[" | "]" | "," | ".." | "=" | "." => false, [INFO] [stdout] 649 - _ => true, [INFO] [stdout] 650 - } [INFO] [stdout] 647 + !matches!(token.value.as_ref(), "\n" | "(" | ")" | "{" | "}" | "[" | "]" | "," | ".." | "=" | ".") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `i64` is unnecessary [INFO] [stdout] --> src/parser.rs:676:28 [INFO] [stdout] | [INFO] [stdout] 676 | sum += digit * (10 as i64).pow(exponent); [INFO] [stdout] | ^^^^^^^^^^^ help: try: `10_i64` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/parser.rs:804:5 [INFO] [stdout] | [INFO] [stdout] 804 | / return Ok(( [INFO] [stdout] 805 | | LocExpr { [INFO] [stdout] 806 | | loc: var.loc.clone(), [INFO] [stdout] 807 | | expr: Expression::Variable(var), [INFO] [stdout] 808 | | }, [INFO] [stdout] 809 | | state, [INFO] [stdout] 810 | | )); [INFO] [stdout] | |______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 804 ~ Ok(( [INFO] [stdout] 805 + LocExpr { [INFO] [stdout] 806 + loc: var.loc.clone(), [INFO] [stdout] 807 + expr: Expression::Variable(var), [INFO] [stdout] 808 + }, [INFO] [stdout] 809 + state, [INFO] [stdout] 810 ~ )) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/parser.rs:823:5 [INFO] [stdout] | [INFO] [stdout] 823 | / return Ok(( [INFO] [stdout] 824 | | LocExpr { [INFO] [stdout] 825 | | expr, [INFO] [stdout] 826 | | loc: opening_bracket.loc.clone(), [INFO] [stdout] 827 | | }, [INFO] [stdout] 828 | | state, [INFO] [stdout] 829 | | )); [INFO] [stdout] | |______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 823 ~ Ok(( [INFO] [stdout] 824 + LocExpr { [INFO] [stdout] 825 + expr, [INFO] [stdout] 826 + loc: opening_bracket.loc.clone(), [INFO] [stdout] 827 + }, [INFO] [stdout] 828 + state, [INFO] [stdout] 829 ~ )) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/parser.rs:909:5 [INFO] [stdout] | [INFO] [stdout] 909 | return Ok((vars, state)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 909 - return Ok((vars, state)); [INFO] [stdout] 909 + Ok((vars, state)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/types.rs:27:9 [INFO] [stdout] | [INFO] [stdout] 27 | / return FuncCall { [INFO] [stdout] 28 | | target: self.target.clone(), [INFO] [stdout] 29 | | arg: self.arg.clone(), [INFO] [stdout] 30 | | this: Box::new(this), [INFO] [stdout] 31 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 27 ~ FuncCall { [INFO] [stdout] 28 + target: self.target.clone(), [INFO] [stdout] 29 + arg: self.arg.clone(), [INFO] [stdout] 30 + this: Box::new(this), [INFO] [stdout] 31 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/types.rs:385:25 [INFO] [stdout] | [INFO] [stdout] 385 | message_line += format!("{}", format!("^ [{}:{}] ", err.loc.line, err.loc.column)).as_str(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `format!("^ [{}:{}] ", err.loc.line, err.loc.column).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: `format!` in `format!` args [INFO] [stdout] --> src/types.rs:385:25 [INFO] [stdout] | [INFO] [stdout] 385 | message_line += format!("{}", format!("^ [{}:{}] ", err.loc.line, err.loc.column)).as_str(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: combine the `format!(..)` arguments with the outer `format!(..)` call [INFO] [stdout] = help: or consider changing `format!` to `format_args!` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_in_format_args [INFO] [stdout] = note: `#[warn(clippy::format_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `values.get(0)` [INFO] [stdout] --> src/util.rs:8:22 [INFO] [stdout] | [INFO] [stdout] 8 | if let Some(s) = values.get(0) { [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `values.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/util.rs:12:29 [INFO] [stdout] | [INFO] [stdout] 12 | result.push_str(&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: useless conversion to the same type: `std::vec::Vec` [INFO] [stdout] --> src/main.rs:31:30 [INFO] [stdout] | [INFO] [stdout] 31 | expressions: program.expressions.into(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `program.expressions` [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: the borrowed expression implements the required traits [INFO] [stdout] --> src/main.rs:90:47 [INFO] [stdout] | [INFO] [stdout] 90 | let contents = fs::read_to_string(&filename).expect("Failed to read file"); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `filename` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:92:38 [INFO] [stdout] | [INFO] [stdout] 92 | eval_or_panic(&contents, &filename); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `filename` [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] [stderr] Checking pretty_assertions_sorted v1.2.3 [INFO] [stdout] warning: function `it_optimizes_tail_calls` is never used [INFO] [stdout] --> src/main.rs:931:8 [INFO] [stdout] | [INFO] [stdout] 931 | fn it_optimizes_tail_calls() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `you_can_check_if_something_has_a_key_using_in` is never used [INFO] [stdout] --> src/main.rs:1228:8 [INFO] [stdout] | [INFO] [stdout] 1228 | fn you_can_check_if_something_has_a_key_using_in() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `it_can_do_for_in_list` is never used [INFO] [stdout] --> src/main.rs:854:12 [INFO] [stdout] | [INFO] [stdout] 854 | fn it_can_do_for_in_list() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `args.get(0)` [INFO] [stdout] --> src/builtins.rs:58:19 [INFO] [stdout] | [INFO] [stdout] 58 | let mut sum = args [INFO] [stdout] | ___________________^ [INFO] [stdout] 59 | | .get(0) [INFO] [stdout] | |_______________^ help: try: `args.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `args` [INFO] [stdout] --> src/builtins.rs:63:14 [INFO] [stdout] | [INFO] [stdout] 63 | for i in 1..args.len() { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 63 - for i in 1..args.len() { [INFO] [stdout] 63 + for in args.iter().skip(1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `args.get(0)` [INFO] [stdout] --> src/builtins.rs:76:19 [INFO] [stdout] | [INFO] [stdout] 76 | let mut sum = args [INFO] [stdout] | ___________________^ [INFO] [stdout] 77 | | .get(0) [INFO] [stdout] | |_______________^ help: try: `args.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `args` [INFO] [stdout] --> src/builtins.rs:81:14 [INFO] [stdout] | [INFO] [stdout] 81 | for i in 1..args.len() { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 81 - for i in 1..args.len() { [INFO] [stdout] 81 + for in args.iter().skip(1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/builtins.rs:145:16 [INFO] [stdout] | [INFO] [stdout] 145 | if !(first <= second) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `(first > second)` [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: length comparison to zero [INFO] [stdout] --> src/builtins.rs:135:8 [INFO] [stdout] | [INFO] [stdout] 135 | if values.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!values.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: the loop variable `i` is only used to index `values` [INFO] [stdout] --> src/builtins.rs:140:18 [INFO] [stdout] | [INFO] [stdout] 140 | for i in 1..values.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 140 - for i in 1..values.len() { [INFO] [stdout] 140 + for in values.iter().skip(1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/builtins.rs:171:16 [INFO] [stdout] | [INFO] [stdout] 171 | if !(first < second) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `(first >= second)` [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: length comparison to zero [INFO] [stdout] --> src/builtins.rs:161:8 [INFO] [stdout] | [INFO] [stdout] 161 | if values.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!values.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: the loop variable `i` is only used to index `values` [INFO] [stdout] --> src/builtins.rs:166:18 [INFO] [stdout] | [INFO] [stdout] 166 | for i in 1..values.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 166 - for i in 1..values.len() { [INFO] [stdout] 166 + for in values.iter().skip(1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/builtins.rs:197:16 [INFO] [stdout] | [INFO] [stdout] 197 | if !(first >= second) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `(first < second)` [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: length comparison to zero [INFO] [stdout] --> src/builtins.rs:187:8 [INFO] [stdout] | [INFO] [stdout] 187 | if values.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!values.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: the loop variable `i` is only used to index `values` [INFO] [stdout] --> src/builtins.rs:192:18 [INFO] [stdout] | [INFO] [stdout] 192 | for i in 1..values.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 192 - for i in 1..values.len() { [INFO] [stdout] 192 + for in values.iter().skip(1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/builtins.rs:223:16 [INFO] [stdout] | [INFO] [stdout] 223 | if !(first > second) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `(first <= second)` [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: length comparison to zero [INFO] [stdout] --> src/builtins.rs:213:8 [INFO] [stdout] | [INFO] [stdout] 213 | if values.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!values.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: the loop variable `i` is only used to index `values` [INFO] [stdout] --> src/builtins.rs:218:18 [INFO] [stdout] | [INFO] [stdout] 218 | for i in 1..values.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 218 - for i in 1..values.len() { [INFO] [stdout] 218 + for in values.iter().skip(1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/builtins.rs:285:5 [INFO] [stdout] | [INFO] [stdout] 285 | return Ok(func_call.expr(Expression::Bool(false))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 285 - return Ok(func_call.expr(Expression::Bool(false))); [INFO] [stdout] 285 + Ok(func_call.expr(Expression::Bool(false))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to one [INFO] [stdout] --> src/builtins.rs:273:8 [INFO] [stdout] | [INFO] [stdout] 273 | if expressions.len() < 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `expressions.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/builtins.rs:306:5 [INFO] [stdout] | [INFO] [stdout] 306 | return Ok(func_call.expr(Expression::Bool(true))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 306 - return Ok(func_call.expr(Expression::Bool(true))); [INFO] [stdout] 306 + Ok(func_call.expr(Expression::Bool(true))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to one [INFO] [stdout] --> src/builtins.rs:294:8 [INFO] [stdout] | [INFO] [stdout] 294 | if expressions.len() < 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `expressions.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/builtins.rs:326:5 [INFO] [stdout] | [INFO] [stdout] 326 | return Ok(func_call.expr(Expression::Int(first % second))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 326 - return Ok(func_call.expr(Expression::Int(first % second))); [INFO] [stdout] 326 + Ok(func_call.expr(Expression::Int(first % second))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/builtins.rs:368:38 [INFO] [stdout] | [INFO] [stdout] 368 | if let Expression::List(list) = &(*func_call.this).expr { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `func_call.this` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] = note: `#[warn(clippy::explicit_auto_deref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/builtins.rs:378:8 [INFO] [stdout] | [INFO] [stdout] 378 | 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: deref which would be done by auto-deref [INFO] [stdout] --> src/builtins.rs:386:38 [INFO] [stdout] | [INFO] [stdout] 386 | if let Expression::List(list) = &(*func_call.this).expr { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `func_call.this` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: items after a test module [INFO] [stdout] --> src/interpreter.rs:202:1 [INFO] [stdout] | [INFO] [stdout] 202 | mod tests { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 251 | impl ImportExpr { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 347 | impl Program { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 357 | impl Identifier { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 374 | fn expr_list_debug_str(delimiter: &str, expressions: &Vec) -> String { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 381 | impl LocExpr { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 669 | impl List { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 694 | fn expressions_to_debug_str(expressions: &Vec) -> String { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 698 | impl List { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 716 | impl Access { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 722 | impl Expression { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#items_after_test_module [INFO] [stdout] = note: `#[warn(clippy::items_after_test_module)]` on by default [INFO] [stdout] = help: move the items to before the test module was defined [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/interpreter.rs:112:66 [INFO] [stdout] | [INFO] [stdout] 112 | Expression::FuncExpr(func_expr) => call_func(&func_expr, &func_call, ctx, ctx), [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `func_call` [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/interpreter.rs:218:9 [INFO] [stdout] | [INFO] [stdout] 218 | return String::from_utf8(output).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 218 - return String::from_utf8(output).unwrap(); [INFO] [stdout] 218 + String::from_utf8(output).unwrap() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `chars.get(0)` [INFO] [stdout] --> src/interpreter.rs:255:27 [INFO] [stdout] | [INFO] [stdout] 255 | if let Some(ch) = chars.get(0) { [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `chars.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/interpreter.rs:292:42 [INFO] [stdout] | [INFO] [stdout] 292 | let value = remote_scope.get(&ident).map_err(|_| { [INFO] [stdout] | ^^^^^^ help: change this to: `ident` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter.rs:353:9 [INFO] [stdout] | [INFO] [stdout] 353 | return expr_list_debug_str("\n", &self.expressions); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 353 - return expr_list_debug_str("\n", &self.expressions); [INFO] [stdout] 353 + expr_list_debug_str("\n", &self.expressions) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/interpreter.rs:374:54 [INFO] [stdout] | [INFO] [stdout] 374 | fn expr_list_debug_str(delimiter: &str, expressions: &Vec) -> String { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 374 - fn expr_list_debug_str(delimiter: &str, expressions: &Vec) -> String { [INFO] [stdout] 374 + fn expr_list_debug_str(delimiter: &str, expressions: &[LocExpr]) -> String { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/interpreter.rs:383:9 [INFO] [stdout] | [INFO] [stdout] 383 | / match self.expr { [INFO] [stdout] 384 | | Expression::Touple(_) => true, [INFO] [stdout] 385 | | _ => false, [INFO] [stdout] 386 | | } [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] 383 - match self.expr { [INFO] [stdout] 384 - Expression::Touple(_) => true, [INFO] [stdout] 385 - _ => false, [INFO] [stdout] 386 - } [INFO] [stdout] 383 + matches!(self.expr, Expression::Touple(_)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `i64` which implements the `Copy` trait [INFO] [stdout] --> src/interpreter.rs:408:40 [INFO] [stdout] | [INFO] [stdout] 408 | Expression::Int(int) => Ok(int.clone()), [INFO] [stdout] | ^^^^^^^^^^^ help: try dereferencing it: `*int` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter.rs:560:17 [INFO] [stdout] | [INFO] [stdout] 560 | return Ok(last); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 560 - return Ok(last); [INFO] [stdout] 560 + Ok(last) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter.rs:577:17 [INFO] [stdout] | [INFO] [stdout] 577 | return Ok(last); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 577 - return Ok(last); [INFO] [stdout] 577 + Ok(last) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter.rs:591:17 [INFO] [stdout] | [INFO] [stdout] 591 | return Ok(self.loc.wrap(Expression::Return(Box::new(inner)))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 591 - return Ok(self.loc.wrap(Expression::Return(Box::new(inner)))); [INFO] [stdout] 591 + Ok(self.loc.wrap(Expression::Return(Box::new(inner)))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/interpreter.rs:510:40 [INFO] [stdout] | [INFO] [stdout] 510 | ctx.scope.reassign(&var, reassignment.expr.eval(ctx)?) [INFO] [stdout] | ^^^^ help: change this to: `var` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enclosing `Ok` and `?` operator are unneeded [INFO] [stdout] --> src/interpreter.rs:516:28 [INFO] [stdout] | [INFO] [stdout] 516 | return Ok(value[0].clone().eval(ctx)?); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark [INFO] [stdout] = note: `#[warn(clippy::needless_question_mark)]` on by default [INFO] [stdout] help: remove the enclosing `Ok` and `?` operator [INFO] [stdout] | [INFO] [stdout] 516 - return Ok(value[0].clone().eval(ctx)?); [INFO] [stdout] 516 + return value[0].clone().eval(ctx); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/interpreter.rs:531:31 [INFO] [stdout] | [INFO] [stdout] 531 | ctx.scope.get(&var) [INFO] [stdout] | ^^^^ help: change this to: `var` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/interpreter.rs:557:54 [INFO] [stdout] | [INFO] [stdout] 557 | last = eval_expr_list(&self.loc, &body, &child_ctx)?; [INFO] [stdout] | ^^^^^ help: change this to: `body` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/interpreter.rs:574:54 [INFO] [stdout] | [INFO] [stdout] 574 | last = eval_expr_list(&self.loc, &body, &child_ctx)?; [INFO] [stdout] | ^^^^^ help: change this to: `body` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/interpreter.rs:584:55 [INFO] [stdout] | [INFO] [stdout] 584 | eval_expr_and_call_returned_block(&else_expr, ctx) [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `else_expr` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `bool` which implements the `Copy` trait [INFO] [stdout] --> src/interpreter.rs:593:74 [INFO] [stdout] | [INFO] [stdout] 593 | Expression::Bool(value) => Ok(self.loc.wrap(Expression::Bool(value.clone()))), [INFO] [stdout] | ^^^^^^^^^^^^^ help: try dereferencing it: `*value` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/interpreter.rs:637:56 [INFO] [stdout] | [INFO] [stdout] 637 | Expression::Variable(var) => ctx.scope.get(&var)?.as_string(ctx), [INFO] [stdout] | ^^^^ help: change this to: `var` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `bool` which implements the `Copy` trait [INFO] [stdout] --> src/interpreter.rs:652:43 [INFO] [stdout] | [INFO] [stdout] 652 | Expression::Bool(value) => Ok(value.clone()), [INFO] [stdout] | ^^^^^^^^^^^^^ help: try removing the `clone` call: `value` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter.rs:690:9 [INFO] [stdout] | [INFO] [stdout] 690 | return Ok(format!("[{}]", join(", ", stringified_items))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 690 - return Ok(format!("[{}]", join(", ", stringified_items))); [INFO] [stdout] 690 + Ok(format!("[{}]", join(", ", stringified_items))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/interpreter.rs:694:42 [INFO] [stdout] | [INFO] [stdout] 694 | fn expressions_to_debug_str(expressions: &Vec) -> String { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 694 - fn expressions_to_debug_str(expressions: &Vec) -> String { [INFO] [stdout] 694 + fn expressions_to_debug_str(expressions: &[LocExpr]) -> String { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this call to `as_ref` does nothing [INFO] [stdout] --> src/interpreter.rs:700:15 [INFO] [stdout] | [INFO] [stdout] 700 | match key.as_ref() { [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_asref [INFO] [stdout] = note: `#[warn(clippy::useless_asref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter.rs:767:17 [INFO] [stdout] | [INFO] [stdout] 767 | / return format!( [INFO] [stdout] 768 | | "from \"{}\" import {}", [INFO] [stdout] 769 | | import_expr.path, [INFO] [stdout] 770 | | join(", ", imported) [INFO] [stdout] 771 | | ); [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 767 ~ format!( [INFO] [stdout] 768 + "from \"{}\" import {}", [INFO] [stdout] 769 + import_expr.path, [INFO] [stdout] 770 + join(", ", imported) [INFO] [stdout] 771 ~ ) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter.rs:828:17 [INFO] [stdout] | [INFO] [stdout] 828 | / return format!( [INFO] [stdout] 829 | | "{{\n{}\n}}", [INFO] [stdout] 830 | | closure [INFO] [stdout] 831 | | .func_expr [INFO] [stdout] ... | [INFO] [stdout] 835 | | .fold(String::new(), |a, b| format!("{}\n{}", a, b)) [INFO] [stdout] 836 | | ); [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 828 ~ format!( [INFO] [stdout] 829 + "{{\n{}\n}}", [INFO] [stdout] 830 + closure [INFO] [stdout] 831 + .func_expr [INFO] [stdout] 832 + .expressions [INFO] [stdout] 833 + .iter() [INFO] [stdout] 834 + .map(|it| it.debug_str()) [INFO] [stdout] 835 + .fold(String::new(), |a, b| format!("{}\n{}", a, b)) [INFO] [stdout] 836 ~ ) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter.rs:840:21 [INFO] [stdout] | [INFO] [stdout] 840 | / return format!( [INFO] [stdout] 841 | | "if {} {} else {}", [INFO] [stdout] 842 | | if_expr.condition.debug_str(), [INFO] [stdout] 843 | | if_expr.then_expr.debug_str(), [INFO] [stdout] 844 | | else_expr.debug_str() [INFO] [stdout] 845 | | ); [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 840 ~ format!( [INFO] [stdout] 841 + "if {} {} else {}", [INFO] [stdout] 842 + if_expr.condition.debug_str(), [INFO] [stdout] 843 + if_expr.then_expr.debug_str(), [INFO] [stdout] 844 + else_expr.debug_str() [INFO] [stdout] 845 ~ ) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/interpreter.rs:847:21 [INFO] [stdout] | [INFO] [stdout] 847 | / return format!( [INFO] [stdout] 848 | | "if {} {}", [INFO] [stdout] 849 | | if_expr.condition.debug_str(), [INFO] [stdout] 850 | | if_expr.then_expr.debug_str() [INFO] [stdout] 851 | | ); [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 847 ~ format!( [INFO] [stdout] 848 + "if {} {}", [INFO] [stdout] 849 + if_expr.condition.debug_str(), [INFO] [stdout] 850 + if_expr.then_expr.debug_str() [INFO] [stdout] 851 ~ ) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/interpreter.rs:802:58 [INFO] [stdout] | [INFO] [stdout] 802 | format!("({})", expressions_to_debug_str(&expressions)) [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `expressions` [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 are using an explicit closure for cloning elements [INFO] [stdout] --> src/interpreter.rs:818:43 [INFO] [stdout] | [INFO] [stdout] 818 | let args_str = join(", ", func_expr.args.iter().map(|it| it.clone()).collect()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `cloned` method: `func_expr.args.iter().cloned()` [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: unneeded `return` statement [INFO] [stdout] --> src/interpreter.rs:867:25 [INFO] [stdout] | [INFO] [stdout] 867 | return format!("{} = {}", k, v.debug_str()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 867 - return format!("{} = {}", k, v.debug_str()); [INFO] [stdout] 867 + format!("{} = {}", k, v.debug_str()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Scope` [INFO] [stdout] --> src/scope.rs:12:5 [INFO] [stdout] | [INFO] [stdout] 12 | / pub fn new() -> Self { [INFO] [stdout] 13 | | Scope { [INFO] [stdout] 14 | | values: Box::new(RefCell::new(HashMap::new())), [INFO] [stdout] 15 | | parent: None, [INFO] [stdout] 16 | | } [INFO] [stdout] 17 | | } [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] 11 + impl Default for Scope { [INFO] [stdout] 12 + fn default() -> Self { [INFO] [stdout] 13 + Self::new() [INFO] [stdout] 14 + } [INFO] [stdout] 15 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/scope.rs:71:13 [INFO] [stdout] | [INFO] [stdout] 71 | return Ok(expr); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 71 - return Ok(expr); [INFO] [stdout] 71 + Ok(expr) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/lexer.rs:24:12 [INFO] [stdout] | [INFO] [stdout] 24 | if self.word.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.word.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: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/lexer.rs:31:26 [INFO] [stdout] | [INFO] [stdout] 31 | Loc::new(self.line.clone(), self.column.clone()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/lexer.rs:31:45 [INFO] [stdout] | [INFO] [stdout] 31 | Loc::new(self.line.clone(), self.column.clone()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.column` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/lexer.rs:52:43 [INFO] [stdout] | [INFO] [stdout] 52 | for (_i, c) in self.source.chars().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index [INFO] [stdout] = note: `#[warn(clippy::unused_enumerate_index)]` on by default [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 52 - for (_i, c) in self.source.chars().enumerate() { [INFO] [stdout] 52 + for c in self.source.chars() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/parser.rs:107:5 [INFO] [stdout] | [INFO] [stdout] 107 | return Err(None); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 107 - return Err(None); [INFO] [stdout] 107 + Err(None) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/parser.rs:198:9 [INFO] [stdout] | [INFO] [stdout] 198 | / return Ok(( [INFO] [stdout] 199 | | first, [INFO] [stdout] 200 | | State { [INFO] [stdout] 201 | | tokens, [INFO] [stdout] ... | [INFO] [stdout] 204 | | }, [INFO] [stdout] 205 | | )); [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 198 ~ Ok(( [INFO] [stdout] 199 + first, [INFO] [stdout] 200 + State { [INFO] [stdout] 201 + tokens, [INFO] [stdout] 202 + final_loc: self.final_loc.clone(), [INFO] [stdout] 203 + is_in_block_arg: self.is_in_block_arg, [INFO] [stdout] 204 + }, [INFO] [stdout] 205 ~ )) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/parser.rs:192:12 [INFO] [stdout] | [INFO] [stdout] 192 | if self.tokens.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.tokens.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: accessing first element with `self.tokens.get(0)` [INFO] [stdout] --> src/parser.rs:211:24 [INFO] [stdout] | [INFO] [stdout] 211 | loc: match self.tokens.get(0) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `self.tokens.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/parser.rs:219:9 [INFO] [stdout] | [INFO] [stdout] 219 | / return match self.tokens.first() { [INFO] [stdout] 220 | | Some(token) => token.value == expected, [INFO] [stdout] 221 | | None => false, [INFO] [stdout] 222 | | }; [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 219 ~ match self.tokens.first() { [INFO] [stdout] 220 + Some(token) => token.value == expected, [INFO] [stdout] 221 + None => false, [INFO] [stdout] 222 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `self.tokens.get(0)` [INFO] [stdout] --> src/parser.rs:242:9 [INFO] [stdout] | [INFO] [stdout] 242 | self.tokens.get(0).map(|t| t.loc.clone()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `self.tokens.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/parser.rs:313:42 [INFO] [stdout] | [INFO] [stdout] 313 | let (let_token, state) = pick("let", &state)?; [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/parser.rs:408:52 [INFO] [stdout] | [INFO] [stdout] 408 | let (start_expr, state) = parse_block_arg_expr(&state)?; [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/parser.rs:438:5 [INFO] [stdout] | [INFO] [stdout] 438 | return Ok((for_kw.loc.wrap(Expression::ForExpr(for_expr)), state)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 438 - return Ok((for_kw.loc.wrap(Expression::ForExpr(for_expr)), state)); [INFO] [stdout] 438 + Ok((for_kw.loc.wrap(Expression::ForExpr(for_expr)), state)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/parser.rs:421:39 [INFO] [stdout] | [INFO] [stdout] 421 | let (for_kw, state) = pick("for", &state)?; [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/parser.rs:442:37 [INFO] [stdout] | [INFO] [stdout] 442 | let (kw, state) = pick("while", &state)?; [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/parser.rs:635:5 [INFO] [stdout] | [INFO] [stdout] 635 | return true; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 635 - return true; [INFO] [stdout] 635 + true [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `token.value.chars().collect::>().get(0)` [INFO] [stdout] --> src/parser.rs:642:31 [INFO] [stdout] | [INFO] [stdout] 642 | if let Some(first_char) = token.value.chars().collect::>().get(0) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `token.value.chars().collect::>().first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/parser.rs:647:5 [INFO] [stdout] | [INFO] [stdout] 647 | / match token.value.as_ref() { [INFO] [stdout] 648 | | "\n" | "(" | ")" | "{" | "}" | "[" | "]" | "," | ".." | "=" | "." => false, [INFO] [stdout] 649 | | _ => true, [INFO] [stdout] 650 | | } [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] 647 - match token.value.as_ref() { [INFO] [stdout] 648 - "\n" | "(" | ")" | "{" | "}" | "[" | "]" | "," | ".." | "=" | "." => false, [INFO] [stdout] 649 - _ => true, [INFO] [stdout] 650 - } [INFO] [stdout] 647 + !matches!(token.value.as_ref(), "\n" | "(" | ")" | "{" | "}" | "[" | "]" | "," | ".." | "=" | ".") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `i64` is unnecessary [INFO] [stdout] --> src/parser.rs:676:28 [INFO] [stdout] | [INFO] [stdout] 676 | sum += digit * (10 as i64).pow(exponent); [INFO] [stdout] | ^^^^^^^^^^^ help: try: `10_i64` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/parser.rs:804:5 [INFO] [stdout] | [INFO] [stdout] 804 | / return Ok(( [INFO] [stdout] 805 | | LocExpr { [INFO] [stdout] 806 | | loc: var.loc.clone(), [INFO] [stdout] 807 | | expr: Expression::Variable(var), [INFO] [stdout] 808 | | }, [INFO] [stdout] 809 | | state, [INFO] [stdout] 810 | | )); [INFO] [stdout] | |______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 804 ~ Ok(( [INFO] [stdout] 805 + LocExpr { [INFO] [stdout] 806 + loc: var.loc.clone(), [INFO] [stdout] 807 + expr: Expression::Variable(var), [INFO] [stdout] 808 + }, [INFO] [stdout] 809 + state, [INFO] [stdout] 810 ~ )) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/parser.rs:823:5 [INFO] [stdout] | [INFO] [stdout] 823 | / return Ok(( [INFO] [stdout] 824 | | LocExpr { [INFO] [stdout] 825 | | expr, [INFO] [stdout] 826 | | loc: opening_bracket.loc.clone(), [INFO] [stdout] 827 | | }, [INFO] [stdout] 828 | | state, [INFO] [stdout] 829 | | )); [INFO] [stdout] | |______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 823 ~ Ok(( [INFO] [stdout] 824 + LocExpr { [INFO] [stdout] 825 + expr, [INFO] [stdout] 826 + loc: opening_bracket.loc.clone(), [INFO] [stdout] 827 + }, [INFO] [stdout] 828 + state, [INFO] [stdout] 829 ~ )) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/parser.rs:909:5 [INFO] [stdout] | [INFO] [stdout] 909 | return Ok((vars, state)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 909 - return Ok((vars, state)); [INFO] [stdout] 909 + Ok((vars, state)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/types.rs:27:9 [INFO] [stdout] | [INFO] [stdout] 27 | / return FuncCall { [INFO] [stdout] 28 | | target: self.target.clone(), [INFO] [stdout] 29 | | arg: self.arg.clone(), [INFO] [stdout] 30 | | this: Box::new(this), [INFO] [stdout] 31 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 27 ~ FuncCall { [INFO] [stdout] 28 + target: self.target.clone(), [INFO] [stdout] 29 + arg: self.arg.clone(), [INFO] [stdout] 30 + this: Box::new(this), [INFO] [stdout] 31 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/types.rs:385:25 [INFO] [stdout] | [INFO] [stdout] 385 | message_line += format!("{}", format!("^ [{}:{}] ", err.loc.line, err.loc.column)).as_str(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `format!("^ [{}:{}] ", err.loc.line, err.loc.column).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: `format!` in `format!` args [INFO] [stdout] --> src/types.rs:385:25 [INFO] [stdout] | [INFO] [stdout] 385 | message_line += format!("{}", format!("^ [{}:{}] ", err.loc.line, err.loc.column)).as_str(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: combine the `format!(..)` arguments with the outer `format!(..)` call [INFO] [stdout] = help: or consider changing `format!` to `format_args!` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_in_format_args [INFO] [stdout] = note: `#[warn(clippy::format_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `values.get(0)` [INFO] [stdout] --> src/util.rs:8:22 [INFO] [stdout] | [INFO] [stdout] 8 | if let Some(s) = values.get(0) { [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `values.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/util.rs:12:29 [INFO] [stdout] | [INFO] [stdout] 12 | result.push_str(&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: useless conversion to the same type: `std::vec::Vec` [INFO] [stdout] --> src/main.rs:31:30 [INFO] [stdout] | [INFO] [stdout] 31 | expressions: program.expressions.into(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `program.expressions` [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: the borrowed expression implements the required traits [INFO] [stdout] --> src/main.rs:90:47 [INFO] [stdout] | [INFO] [stdout] 90 | let contents = fs::read_to_string(&filename).expect("Failed to read file"); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `filename` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:92:38 [INFO] [stdout] | [INFO] [stdout] 92 | eval_or_panic(&contents, &filename); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `filename` [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: empty string literal in `eprintln!` [INFO] [stdout] --> src/main.rs:797:13 [INFO] [stdout] | [INFO] [stdout] 797 | eprintln!(""); [INFO] [stdout] | ^^^^^^^^^^--^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [INFO] [stdout] = note: `#[warn(clippy::println_empty_string)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `eprintln!` [INFO] [stdout] --> src/main.rs:800:13 [INFO] [stdout] | [INFO] [stdout] 800 | eprintln!(""); [INFO] [stdout] | ^^^^^^^^^^--^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 4.44s [INFO] running `Command { std: "docker" "inspect" "2e6464ec47cd5853ed8f19b745031af4901e30667342ffc389c987322953a59f", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "2e6464ec47cd5853ed8f19b745031af4901e30667342ffc389c987322953a59f", kill_on_drop: false }` [INFO] [stdout] 2e6464ec47cd5853ed8f19b745031af4901e30667342ffc389c987322953a59f