[INFO] cloning repository https://github.com/DanielRamosAcosta/cya-rust [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/DanielRamosAcosta/cya-rust" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FDanielRamosAcosta%2Fcya-rust", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FDanielRamosAcosta%2Fcya-rust'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 079c38834c533c4fedb29d08bd46d23c5e1b5a9e [INFO] linting DanielRamosAcosta/cya-rust against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FDanielRamosAcosta%2Fcya-rust" "/workspace/builds/worker-0-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-0-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/DanielRamosAcosta/cya-rust [INFO] finished tweaking git repo https://github.com/DanielRamosAcosta/cya-rust [INFO] tweaked toml for git repo https://github.com/DanielRamosAcosta/cya-rust written to /workspace/builds/worker-0-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/DanielRamosAcosta/cya-rust 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] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "generate-lockfile" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] 66d72468fd1d50af5cc9722ce5f4b9da573a8a064b350bbdc102f57a473e8eda [INFO] running `Command { std: "docker" "start" "-a" "66d72468fd1d50af5cc9722ce5f4b9da573a8a064b350bbdc102f57a473e8eda", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "66d72468fd1d50af5cc9722ce5f4b9da573a8a064b350bbdc102f57a473e8eda", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "66d72468fd1d50af5cc9722ce5f4b9da573a8a064b350bbdc102f57a473e8eda", kill_on_drop: false }` [INFO] [stdout] 66d72468fd1d50af5cc9722ce5f4b9da573a8a064b350bbdc102f57a473e8eda [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "clippy" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 252859ceb806d70302dada3235ac45e6ed47b3514499c848a9c129fe46703e3a [INFO] running `Command { std: "docker" "start" "-a" "252859ceb806d70302dada3235ac45e6ed47b3514499c848a9c129fe46703e3a", kill_on_drop: false }` [INFO] [stderr] Checking exercise-10 v0.1.0 (/opt/rustwide/workdir/exercise-10) [INFO] [stderr] Checking exercise-4 v0.1.0 (/opt/rustwide/workdir/exercise-04) [INFO] [stdout] warning: method `eq` can be confused for the standard trait method `std::cmp::PartialEq::eq` [INFO] [stdout] --> exercise-04/src/dfa.rs:19:5 [INFO] [stdout] | [INFO] [stdout] 19 | / pub fn eq(&self, other: &Dfa) -> bool { [INFO] [stdout] 20 | | if self.initial_state != other.initial_state { [INFO] [stdout] 21 | | return false; [INFO] [stdout] ... | [INFO] [stdout] 36 | | }) [INFO] [stdout] 37 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: consider implementing the trait `std::cmp::PartialEq` or choosing a less ambiguous method name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait [INFO] [stdout] = note: `#[warn(clippy::should_implement_trait)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.fold` can be written more succinctly using another method [INFO] [stdout] --> exercise-04/src/dfa.rs:28:28 [INFO] [stdout] | [INFO] [stdout] 28 | self.states.iter().fold(true, |result, state| { [INFO] [stdout] | ____________________________^ [INFO] [stdout] 29 | | result [INFO] [stdout] 30 | | && other [INFO] [stdout] 31 | | .states [INFO] [stdout] ... | [INFO] [stdout] 35 | | .unwrap_or(false) [INFO] [stdout] 36 | | }) [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = note: the `all` method is short circuiting and may change the program semantics if the iterator has side effects [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold [INFO] [stdout] = note: `#[warn(clippy::unnecessary_fold)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 28 ~ self.states.iter().all(|state| other [INFO] [stdout] 29 + .states [INFO] [stdout] 30 + .iter() [INFO] [stdout] 31 + .find(|s| s.has_same_label(state)) [INFO] [stdout] 32 + .map(|s| s.equal(state)) [INFO] [stdout] 33 + .unwrap_or(false)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> exercise-04/src/dfa.rs:47:9 [INFO] [stdout] | [INFO] [stdout] 47 | return Status::new(input, transitions, is_final); [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] 47 - return Status::new(input, transitions, is_final); [INFO] [stdout] 47 + Status::new(input, transitions, is_final) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: implementation of inherent method `to_string(&self) -> String` for type `dfa::Dfa` [INFO] [stdout] --> exercise-04/src/dfa.rs:50:5 [INFO] [stdout] | [INFO] [stdout] 50 | / pub fn to_string(&self) -> String { [INFO] [stdout] 51 | | let states = self [INFO] [stdout] 52 | | .states [INFO] [stdout] 53 | | .iter() [INFO] [stdout] ... | [INFO] [stdout] 58 | | return format!("{}\n{}\n{}", self.states.len(), self.initial_state, states); [INFO] [stdout] 59 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: implement trait `Display` for type `dfa::Dfa` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inherent_to_string [INFO] [stdout] = note: `#[warn(clippy::inherent_to_string)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> exercise-04/src/dfa.rs:58:9 [INFO] [stdout] | [INFO] [stdout] 58 | return format!("{}\n{}\n{}", self.states.len(), self.initial_state, states); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 58 - return format!("{}\n{}\n{}", self.states.len(), self.initial_state, states); [INFO] [stdout] 58 + format!("{}\n{}\n{}", self.states.len(), self.initial_state, states) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> exercise-04/src/dfa.rs:63:16 [INFO] [stdout] | [INFO] [stdout] 63 | input: &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] 63 - input: &String, [INFO] [stdout] 63 + input: &str, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> exercise-04/src/dfa.rs:84:42 [INFO] [stdout] | [INFO] [stdout] 84 | fn perform_transitions(&self, input: &String) -> TransitionsLog { [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] 84 - fn perform_transitions(&self, input: &String) -> TransitionsLog { [INFO] [stdout] 84 + fn perform_transitions(&self, input: &str) -> TransitionsLog { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::str::Chars<'_>` [INFO] [stdout] --> exercise-04/src/dfa.rs:85:9 [INFO] [stdout] | [INFO] [stdout] 85 | / input [INFO] [stdout] 86 | | .chars() [INFO] [stdout] 87 | | .into_iter() [INFO] [stdout] | |________________________^ [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] help: consider removing `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 85 ~ input [INFO] [stdout] 86 + .chars() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> exercise-04/src/dfa_parser.rs:6:34 [INFO] [stdout] | [INFO] [stdout] 6 | pub fn get_initial_state(string: &String) -> Option { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 6 - pub fn get_initial_state(string: &String) -> Option { [INFO] [stdout] 6 + pub fn get_initial_state(string: &str) -> Option { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> exercise-04/src/dfa_parser.rs:16:25 [INFO] [stdout] | [INFO] [stdout] 16 | pub fn get_body(string: &String) -> 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] 16 - pub fn get_body(string: &String) -> String { [INFO] [stdout] 16 + pub fn get_body(string: &str) -> String { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> exercise-04/src/dfa_parser.rs:29:5 [INFO] [stdout] | [INFO] [stdout] 29 | return Transition::new(symbol1, dest_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] 29 - return Transition::new(symbol1, dest_state); [INFO] [stdout] 29 + Transition::new(symbol1, dest_state) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `el.get(0)` [INFO] [stdout] --> exercise-04/src/dfa_parser.rs:25:18 [INFO] [stdout] | [INFO] [stdout] 25 | let symbol = el.get(0).unwrap(); [INFO] [stdout] | ^^^^^^^^^ help: try: `el.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: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> exercise-04/src/dfa_parser.rs:32:28 [INFO] [stdout] | [INFO] [stdout] 32 | pub fn parse_state(string: &String) -> State { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 32 - pub fn parse_state(string: &String) -> State { [INFO] [stdout] 32 + pub fn parse_state(string: &str) -> State { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> exercise-04/src/dfa_parser.rs:35:14 [INFO] [stdout] | [INFO] [stdout] 35 | .map(|str| String::from(str)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `String::from` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `elements.get(0)` [INFO] [stdout] --> exercise-04/src/dfa_parser.rs:38:17 [INFO] [stdout] | [INFO] [stdout] 38 | let label = elements [INFO] [stdout] | _________________^ [INFO] [stdout] 39 | | .get(0) [INFO] [stdout] | |_______________^ help: try: `elements.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] --> exercise-04/src/dfa_parser.rs:77:5 [INFO] [stdout] | [INFO] [stdout] 77 | return Some(dfa); [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] 77 - return Some(dfa); [INFO] [stdout] 77 + Some(dfa) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> exercise-04/src/dfa_parser.rs:71:14 [INFO] [stdout] | [INFO] [stdout] 71 | .map(|str| String::from(str)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `String::from` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> exercise-04/src/state.rs:23:9 [INFO] [stdout] | [INFO] [stdout] 23 | / true && self.label.eq(&other.label) [INFO] [stdout] 24 | | && self.is_final.eq(&other.is_final) [INFO] [stdout] 25 | | && self.transitions.eq(&other.transitions) [INFO] [stdout] | |______________________________________________________^ help: try: `self.label.eq(&other.label) && self.is_final.eq(&other.is_final) && self.transitions.eq(&other.transitions)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> exercise-04/src/state.rs:23:9 [INFO] [stdout] | [INFO] [stdout] 23 | / true && self.label.eq(&other.label) [INFO] [stdout] 24 | | && self.is_final.eq(&other.is_final) [INFO] [stdout] | |________________________________________________^ help: try: `self.label.eq(&other.label) && self.is_final.eq(&other.is_final)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> exercise-04/src/state.rs:23:9 [INFO] [stdout] | [INFO] [stdout] 23 | true && self.label.eq(&other.label) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `self.label.eq(&other.label)` [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: implementation of inherent method `to_string(&self) -> String` for type `state::State` [INFO] [stdout] --> exercise-04/src/state.rs:36:5 [INFO] [stdout] | [INFO] [stdout] 36 | / pub fn to_string(&self) -> String { [INFO] [stdout] 37 | | format!( [INFO] [stdout] 38 | | "{} {} {} {}", [INFO] [stdout] 39 | | self.label, [INFO] [stdout] ... | [INFO] [stdout] 44 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: implement trait `Display` for type `state::State` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inherent_to_string [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: implementation of inherent method `to_string(&self) -> String` for type `status::Status` [INFO] [stdout] --> exercise-04/src/status.rs:19:5 [INFO] [stdout] | [INFO] [stdout] 19 | / pub fn to_string(&self) -> String { [INFO] [stdout] 20 | | let input = String::from("Input string: ").replace("", &self.input); [INFO] [stdout] 21 | | let transitions = self.transitions_log.to_string(); [INFO] [stdout] 22 | | let accepted = if self.is_accepted { [INFO] [stdout] ... | [INFO] [stdout] 30 | | return result; [INFO] [stdout] 31 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: implement trait `Display` for type `status::Status` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inherent_to_string [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> exercise-04/src/status.rs:30:9 [INFO] [stdout] | [INFO] [stdout] 30 | return result; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 30 - return result; [INFO] [stdout] 30 + result [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `eq` can be confused for the standard trait method `std::cmp::PartialEq::eq` [INFO] [stdout] --> exercise-04/src/transition.rs:23:5 [INFO] [stdout] | [INFO] [stdout] 23 | / pub fn eq(&self, other: &Transition) -> bool { [INFO] [stdout] 24 | | self.has_same_symbol(&other) && self.destination_state.eq(&other.destination_state) [INFO] [stdout] 25 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: consider implementing the trait `std::cmp::PartialEq` or choosing a less ambiguous method name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> exercise-04/src/transition.rs:24:30 [INFO] [stdout] | [INFO] [stdout] 24 | self.has_same_symbol(&other) && self.destination_state.eq(&other.destination_state) [INFO] [stdout] | ^^^^^^ help: change this to: `other` [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: implementation of inherent method `to_string(&self) -> String` for type `transition::Transition` [INFO] [stdout] --> exercise-04/src/transition.rs:27:5 [INFO] [stdout] | [INFO] [stdout] 27 | / pub fn to_string(&self) -> String { [INFO] [stdout] 28 | | format!("{} {}", self.symbol, self.destination_state) [INFO] [stdout] 29 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: implement trait `Display` for type `transition::Transition` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inherent_to_string [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> exercise-04/src/transition_log.rs:10:9 [INFO] [stdout] | [INFO] [stdout] 10 | / return TransitionLog { [INFO] [stdout] 11 | | current_state, [INFO] [stdout] 12 | | input, [INFO] [stdout] 13 | | next_state, [INFO] [stdout] 14 | | }; [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] 10 ~ TransitionLog { [INFO] [stdout] 11 + current_state, [INFO] [stdout] 12 + input, [INFO] [stdout] 13 + next_state, [INFO] [stdout] 14 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: implementation of inherent method `to_string(&self) -> String` for type `transition_log::TransitionLog` [INFO] [stdout] --> exercise-04/src/transition_log.rs:21:5 [INFO] [stdout] | [INFO] [stdout] 21 | / pub fn to_string(&self) -> String { [INFO] [stdout] 22 | | return format!( [INFO] [stdout] 23 | | "{} {} {}", [INFO] [stdout] 24 | | self.current_state.to_string(), [INFO] [stdout] ... | [INFO] [stdout] 27 | | ); [INFO] [stdout] 28 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: implement trait `Display` for type `transition_log::TransitionLog` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inherent_to_string [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> exercise-04/src/transition_log.rs:22:9 [INFO] [stdout] | [INFO] [stdout] 22 | / return format!( [INFO] [stdout] 23 | | "{} {} {}", [INFO] [stdout] 24 | | self.current_state.to_string(), [INFO] [stdout] 25 | | self.input.to_string(), [INFO] [stdout] 26 | | self.next_state.to_string() [INFO] [stdout] 27 | | ); [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] 22 ~ format!( [INFO] [stdout] 23 + "{} {} {}", [INFO] [stdout] 24 + self.current_state.to_string(), [INFO] [stdout] 25 + self.input.to_string(), [INFO] [stdout] 26 + self.next_state.to_string() [INFO] [stdout] 27 ~ ) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> exercise-04/src/transition_log.rs:24:31 [INFO] [stdout] | [INFO] [stdout] 24 | self.current_state.to_string(), [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] = note: `#[warn(clippy::to_string_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> exercise-04/src/transition_log.rs:25:23 [INFO] [stdout] | [INFO] [stdout] 25 | self.input.to_string(), [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> exercise-04/src/transition_log.rs:26:28 [INFO] [stdout] | [INFO] [stdout] 26 | self.next_state.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `eq` can be confused for the standard trait method `std::cmp::PartialEq::eq` [INFO] [stdout] --> exercise-04/src/transitions.rs:12:5 [INFO] [stdout] | [INFO] [stdout] 12 | / pub fn eq(&self, other: &Transitions) -> bool { [INFO] [stdout] 13 | | self.same_amount_of_transitions(other) [INFO] [stdout] 14 | | && self.transitions.iter().fold(true, |result, transition| { [INFO] [stdout] 15 | | result [INFO] [stdout] ... | [INFO] [stdout] 22 | | }) [INFO] [stdout] 23 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: consider implementing the trait `std::cmp::PartialEq` or choosing a less ambiguous method name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.fold` can be written more succinctly using another method [INFO] [stdout] --> exercise-04/src/transitions.rs:14:40 [INFO] [stdout] | [INFO] [stdout] 14 | && self.transitions.iter().fold(true, |result, transition| { [INFO] [stdout] | ________________________________________^ [INFO] [stdout] 15 | | result [INFO] [stdout] 16 | | && other [INFO] [stdout] 17 | | .transitions [INFO] [stdout] ... | [INFO] [stdout] 21 | | .unwrap_or(false) [INFO] [stdout] 22 | | }) [INFO] [stdout] | |______________^ [INFO] [stdout] | [INFO] [stdout] = note: the `all` method is short circuiting and may change the program semantics if the iterator has side effects [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 14 ~ && self.transitions.iter().all(|transition| other [INFO] [stdout] 15 + .transitions [INFO] [stdout] 16 + .iter() [INFO] [stdout] 17 + .find(|t| t.has_same_symbol(transition)) [INFO] [stdout] 18 + .map(|t| t.eq(transition)) [INFO] [stdout] 19 + .unwrap_or(false)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: implementation of inherent method `to_string(&self) -> String` for type `transitions::Transitions` [INFO] [stdout] --> exercise-04/src/transitions.rs:36:5 [INFO] [stdout] | [INFO] [stdout] 36 | / pub fn to_string(&self) -> String { [INFO] [stdout] 37 | | self.transitions [INFO] [stdout] 38 | | .iter() [INFO] [stdout] 39 | | .map(|transition| transition.to_string()) [INFO] [stdout] 40 | | .collect::>() [INFO] [stdout] 41 | | .join(" ") [INFO] [stdout] 42 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: implement trait `Display` for type `transitions::Transitions` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inherent_to_string [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> exercise-04/src/transitions_log.rs:27:9 [INFO] [stdout] | [INFO] [stdout] 27 | return TransitionsLog::new(transitions); [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 - return TransitionsLog::new(transitions); [INFO] [stdout] 27 + TransitionsLog::new(transitions) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: implementation of inherent method `to_string(&self) -> String` for type `transitions_log::TransitionsLog` [INFO] [stdout] --> exercise-04/src/transitions_log.rs:45:5 [INFO] [stdout] | [INFO] [stdout] 45 | / pub fn to_string(&self) -> String { [INFO] [stdout] 46 | | TransitionsLog::get_header() [INFO] [stdout] 47 | | + &self [INFO] [stdout] 48 | | .transitions [INFO] [stdout] ... | [INFO] [stdout] 52 | | .join("\n") [INFO] [stdout] 53 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: implement trait `Display` for type `transitions_log::TransitionsLog` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inherent_to_string [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> exercise-04/src/transitions_log.rs:20:19 [INFO] [stdout] | [INFO] [stdout] 20 | let aux = vec![transition]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: you can use an array directly: `[transition]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `LEFT` contains a capitalized acronym [INFO] [stdout] --> exercise-10/src/movement.rs:3:5 [INFO] [stdout] | [INFO] [stdout] 3 | LEFT, [INFO] [stdout] | ^^^^ help: consider making the acronym lowercase, except the initial letter: `Left` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] = note: `#[warn(clippy::upper_case_acronyms)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `RIGHT` contains a capitalized acronym [INFO] [stdout] --> exercise-10/src/movement.rs:4:5 [INFO] [stdout] | [INFO] [stdout] 4 | RIGHT, [INFO] [stdout] | ^^^^^ help: consider making the acronym lowercase, except the initial letter: `Right` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `STOP` contains a capitalized acronym [INFO] [stdout] --> exercise-10/src/movement.rs:5:5 [INFO] [stdout] | [INFO] [stdout] 5 | STOP, [INFO] [stdout] | ^^^^ help: consider making the acronym lowercase, except the initial letter: `Stop` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> exercise-10/src/tape.rs:18:40 [INFO] [stdout] | [INFO] [stdout] 18 | pub fn from_string_head_at(string: &String, head: usize) -> Tape { [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] 18 - pub fn from_string_head_at(string: &String, head: usize) -> Tape { [INFO] [stdout] 18 + pub fn from_string_head_at(string: &str, head: usize) -> Tape { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `char` which implements the `Copy` trait [INFO] [stdout] --> exercise-10/src/tape.rs:25:9 [INFO] [stdout] | [INFO] [stdout] 25 | self.rail.get(self.head).unwrap().clone() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*self.rail.get(self.head).unwrap()` [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: implementation of inherent method `to_string(&self) -> String` for type `tape::Tape` [INFO] [stdout] --> exercise-10/src/tape.rs:48:5 [INFO] [stdout] | [INFO] [stdout] 48 | / pub fn to_string(&self) -> String { [INFO] [stdout] 49 | | format!( [INFO] [stdout] 50 | | "...{}...\n...{}...", [INFO] [stdout] 51 | | self.rail_to_string(), [INFO] [stdout] ... | [INFO] [stdout] 54 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: implement trait `Display` for type `tape::Tape` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inherent_to_string [INFO] [stdout] = note: `#[warn(clippy::inherent_to_string)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::str::Chars<'_>` [INFO] [stdout] --> exercise-10/src/tape.rs:57:9 [INFO] [stdout] | [INFO] [stdout] 57 | / self.rail_to_string() [INFO] [stdout] 58 | | .chars() [INFO] [stdout] 59 | | .into_iter() [INFO] [stdout] | |________________________^ [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] help: consider removing `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 57 ~ self.rail_to_string() [INFO] [stdout] 58 + .chars() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `char` which implements the `Copy` trait [INFO] [stdout] --> exercise-10/src/tape.rs:78:35 [INFO] [stdout] | [INFO] [stdout] 78 | .map(|x| String::from(x.clone())) [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*x` [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] --> exercise-10/src/turing_machine.rs:63:9 [INFO] [stdout] | [INFO] [stdout] 63 | return Ok(status.tapes); [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] 63 - return Ok(status.tapes); [INFO] [stdout] 63 + Ok(status.tapes) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> exercise-10/src/turing_machine.rs:22:34 [INFO] [stdout] | [INFO] [stdout] 22 | pub fn execute(&self, input: &String) -> Result, Vec> { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 22 - pub fn execute(&self, input: &String) -> Result, Vec> { [INFO] [stdout] 22 + pub fn execute(&self, input: &str) -> Result, Vec> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> exercise-10/src/turing_machine.rs:46:25 [INFO] [stdout] | [INFO] [stdout] 46 | let tapes = vec![ [INFO] [stdout] | _________________________^ [INFO] [stdout] 47 | | tape.write(transition.write), [INFO] [stdout] 48 | | tape.write(transition.write).mov(transition.movement), [INFO] [stdout] 49 | | ]; [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] help: you can use an array directly [INFO] [stdout] | [INFO] [stdout] 46 ~ let tapes = [tape.write(transition.write), [INFO] [stdout] 47 ~ tape.write(transition.write).mov(transition.movement)]; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `eq` can be confused for the standard trait method `std::cmp::PartialEq::eq` [INFO] [stdout] --> exercise-04/src/dfa.rs:19:5 [INFO] [stdout] | [INFO] [stdout] 19 | / pub fn eq(&self, other: &Dfa) -> bool { [INFO] [stdout] 20 | | if self.initial_state != other.initial_state { [INFO] [stdout] 21 | | return false; [INFO] [stdout] ... | [INFO] [stdout] 36 | | }) [INFO] [stdout] 37 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: consider implementing the trait `std::cmp::PartialEq` or choosing a less ambiguous method name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait [INFO] [stdout] = note: `#[warn(clippy::should_implement_trait)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.fold` can be written more succinctly using another method [INFO] [stdout] --> exercise-04/src/dfa.rs:28:28 [INFO] [stdout] | [INFO] [stdout] 28 | self.states.iter().fold(true, |result, state| { [INFO] [stdout] | ____________________________^ [INFO] [stdout] 29 | | result [INFO] [stdout] 30 | | && other [INFO] [stdout] 31 | | .states [INFO] [stdout] ... | [INFO] [stdout] 35 | | .unwrap_or(false) [INFO] [stdout] 36 | | }) [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = note: the `all` method is short circuiting and may change the program semantics if the iterator has side effects [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold [INFO] [stdout] = note: `#[warn(clippy::unnecessary_fold)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 28 ~ self.states.iter().all(|state| other [INFO] [stdout] 29 + .states [INFO] [stdout] 30 + .iter() [INFO] [stdout] 31 + .find(|s| s.has_same_label(state)) [INFO] [stdout] 32 + .map(|s| s.equal(state)) [INFO] [stdout] 33 + .unwrap_or(false)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> exercise-04/src/dfa.rs:47:9 [INFO] [stdout] | [INFO] [stdout] 47 | return Status::new(input, transitions, is_final); [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] 47 - return Status::new(input, transitions, is_final); [INFO] [stdout] 47 + Status::new(input, transitions, is_final) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: implementation of inherent method `to_string(&self) -> String` for type `dfa::Dfa` [INFO] [stdout] --> exercise-04/src/dfa.rs:50:5 [INFO] [stdout] | [INFO] [stdout] 50 | / pub fn to_string(&self) -> String { [INFO] [stdout] 51 | | let states = self [INFO] [stdout] 52 | | .states [INFO] [stdout] 53 | | .iter() [INFO] [stdout] ... | [INFO] [stdout] 58 | | return format!("{}\n{}\n{}", self.states.len(), self.initial_state, states); [INFO] [stdout] 59 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: implement trait `Display` for type `dfa::Dfa` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inherent_to_string [INFO] [stdout] = note: `#[warn(clippy::inherent_to_string)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> exercise-04/src/dfa.rs:58:9 [INFO] [stdout] | [INFO] [stdout] 58 | return format!("{}\n{}\n{}", self.states.len(), self.initial_state, states); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 58 - return format!("{}\n{}\n{}", self.states.len(), self.initial_state, states); [INFO] [stdout] 58 + format!("{}\n{}\n{}", self.states.len(), self.initial_state, states) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> exercise-04/src/dfa.rs:63:16 [INFO] [stdout] | [INFO] [stdout] 63 | input: &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] 63 - input: &String, [INFO] [stdout] 63 + input: &str, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> exercise-04/src/dfa.rs:84:42 [INFO] [stdout] | [INFO] [stdout] 84 | fn perform_transitions(&self, input: &String) -> TransitionsLog { [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] 84 - fn perform_transitions(&self, input: &String) -> TransitionsLog { [INFO] [stdout] 84 + fn perform_transitions(&self, input: &str) -> TransitionsLog { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::str::Chars<'_>` [INFO] [stdout] --> exercise-04/src/dfa.rs:85:9 [INFO] [stdout] | [INFO] [stdout] 85 | / input [INFO] [stdout] 86 | | .chars() [INFO] [stdout] 87 | | .into_iter() [INFO] [stdout] | |________________________^ [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] help: consider removing `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 85 ~ input [INFO] [stdout] 86 + .chars() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> exercise-04/src/dfa.rs:199:9 [INFO] [stdout] | [INFO] [stdout] 199 | assert_eq!(dfa1.eq(&dfa2), true) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_assert_comparison)]` on by default [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 199 - assert_eq!(dfa1.eq(&dfa2), true) [INFO] [stdout] 199 + assert!(dfa1.eq(&dfa2)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> exercise-04/src/dfa.rs:214:9 [INFO] [stdout] | [INFO] [stdout] 214 | assert_eq!(dfa1.eq(&dfa2), false) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 214 - assert_eq!(dfa1.eq(&dfa2), false) [INFO] [stdout] 214 + assert!(!dfa1.eq(&dfa2)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> exercise-04/src/dfa.rs:246:9 [INFO] [stdout] | [INFO] [stdout] 246 | assert_eq!(dfa1.eq(&dfa2), false) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 246 - assert_eq!(dfa1.eq(&dfa2), false) [INFO] [stdout] 246 + assert!(!dfa1.eq(&dfa2)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> exercise-04/src/dfa.rs:278:9 [INFO] [stdout] | [INFO] [stdout] 278 | assert_eq!(dfa1.eq(&dfa2), true) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 278 - assert_eq!(dfa1.eq(&dfa2), true) [INFO] [stdout] 278 + assert!(dfa1.eq(&dfa2)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> exercise-04/src/dfa_parser.rs:6:34 [INFO] [stdout] | [INFO] [stdout] 6 | pub fn get_initial_state(string: &String) -> Option { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 6 - pub fn get_initial_state(string: &String) -> Option { [INFO] [stdout] 6 + pub fn get_initial_state(string: &str) -> Option { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> exercise-04/src/dfa_parser.rs:16:25 [INFO] [stdout] | [INFO] [stdout] 16 | pub fn get_body(string: &String) -> 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] 16 - pub fn get_body(string: &String) -> String { [INFO] [stdout] 16 + pub fn get_body(string: &str) -> String { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> exercise-04/src/dfa_parser.rs:29:5 [INFO] [stdout] | [INFO] [stdout] 29 | return Transition::new(symbol1, dest_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] 29 - return Transition::new(symbol1, dest_state); [INFO] [stdout] 29 + Transition::new(symbol1, dest_state) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `el.get(0)` [INFO] [stdout] --> exercise-04/src/dfa_parser.rs:25:18 [INFO] [stdout] | [INFO] [stdout] 25 | let symbol = el.get(0).unwrap(); [INFO] [stdout] | ^^^^^^^^^ help: try: `el.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: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> exercise-04/src/dfa_parser.rs:32:28 [INFO] [stdout] | [INFO] [stdout] 32 | pub fn parse_state(string: &String) -> State { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 32 - pub fn parse_state(string: &String) -> State { [INFO] [stdout] 32 + pub fn parse_state(string: &str) -> State { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> exercise-04/src/dfa_parser.rs:35:14 [INFO] [stdout] | [INFO] [stdout] 35 | .map(|str| String::from(str)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `String::from` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `elements.get(0)` [INFO] [stdout] --> exercise-04/src/dfa_parser.rs:38:17 [INFO] [stdout] | [INFO] [stdout] 38 | let label = elements [INFO] [stdout] | _________________^ [INFO] [stdout] 39 | | .get(0) [INFO] [stdout] | |_______________^ help: try: `elements.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] --> exercise-04/src/dfa_parser.rs:77:5 [INFO] [stdout] | [INFO] [stdout] 77 | return Some(dfa); [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] 77 - return Some(dfa); [INFO] [stdout] 77 + Some(dfa) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> exercise-04/src/dfa_parser.rs:71:14 [INFO] [stdout] | [INFO] [stdout] 71 | .map(|str| String::from(str)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `String::from` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> exercise-04/src/state.rs:23:9 [INFO] [stdout] | [INFO] [stdout] 23 | / true && self.label.eq(&other.label) [INFO] [stdout] 24 | | && self.is_final.eq(&other.is_final) [INFO] [stdout] 25 | | && self.transitions.eq(&other.transitions) [INFO] [stdout] | |______________________________________________________^ help: try: `self.label.eq(&other.label) && self.is_final.eq(&other.is_final) && self.transitions.eq(&other.transitions)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> exercise-04/src/state.rs:23:9 [INFO] [stdout] | [INFO] [stdout] 23 | / true && self.label.eq(&other.label) [INFO] [stdout] 24 | | && self.is_final.eq(&other.is_final) [INFO] [stdout] | |________________________________________________^ help: try: `self.label.eq(&other.label) && self.is_final.eq(&other.is_final)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> exercise-04/src/state.rs:23:9 [INFO] [stdout] | [INFO] [stdout] 23 | true && self.label.eq(&other.label) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `self.label.eq(&other.label)` [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: implementation of inherent method `to_string(&self) -> String` for type `state::State` [INFO] [stdout] --> exercise-04/src/state.rs:36:5 [INFO] [stdout] | [INFO] [stdout] 36 | / pub fn to_string(&self) -> String { [INFO] [stdout] 37 | | format!( [INFO] [stdout] 38 | | "{} {} {} {}", [INFO] [stdout] 39 | | self.label, [INFO] [stdout] ... | [INFO] [stdout] 44 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: implement trait `Display` for type `state::State` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inherent_to_string [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> exercise-04/src/state.rs:65:9 [INFO] [stdout] | [INFO] [stdout] 65 | assert_eq!(state1.equal(&state2), true) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 65 - assert_eq!(state1.equal(&state2), true) [INFO] [stdout] 65 + assert!(state1.equal(&state2)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> exercise-04/src/state.rs:77:9 [INFO] [stdout] | [INFO] [stdout] 77 | assert_eq!(state1.equal(&state2), false) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 77 - assert_eq!(state1.equal(&state2), false) [INFO] [stdout] 77 + assert!(!state1.equal(&state2)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> exercise-04/src/state.rs:89:9 [INFO] [stdout] | [INFO] [stdout] 89 | assert_eq!(state1.equal(&state2), false) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 89 - assert_eq!(state1.equal(&state2), false) [INFO] [stdout] 89 + assert!(!state1.equal(&state2)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> exercise-04/src/state.rs:101:9 [INFO] [stdout] | [INFO] [stdout] 101 | assert_eq!(state1.equal(&state2), false) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 101 - assert_eq!(state1.equal(&state2), false) [INFO] [stdout] 101 + assert!(!state1.equal(&state2)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: implementation of inherent method `to_string(&self) -> String` for type `status::Status` [INFO] [stdout] --> exercise-04/src/status.rs:19:5 [INFO] [stdout] | [INFO] [stdout] 19 | / pub fn to_string(&self) -> String { [INFO] [stdout] 20 | | let input = String::from("Input string: ").replace("", &self.input); [INFO] [stdout] 21 | | let transitions = self.transitions_log.to_string(); [INFO] [stdout] 22 | | let accepted = if self.is_accepted { [INFO] [stdout] ... | [INFO] [stdout] 30 | | return result; [INFO] [stdout] 31 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: implement trait `Display` for type `status::Status` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inherent_to_string [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> exercise-04/src/status.rs:30:9 [INFO] [stdout] | [INFO] [stdout] 30 | return result; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 30 - return result; [INFO] [stdout] 30 + result [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `eq` can be confused for the standard trait method `std::cmp::PartialEq::eq` [INFO] [stdout] --> exercise-04/src/transition.rs:23:5 [INFO] [stdout] | [INFO] [stdout] 23 | / pub fn eq(&self, other: &Transition) -> bool { [INFO] [stdout] 24 | | self.has_same_symbol(&other) && self.destination_state.eq(&other.destination_state) [INFO] [stdout] 25 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: consider implementing the trait `std::cmp::PartialEq` or choosing a less ambiguous method name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> exercise-04/src/transition.rs:24:30 [INFO] [stdout] | [INFO] [stdout] 24 | self.has_same_symbol(&other) && self.destination_state.eq(&other.destination_state) [INFO] [stdout] | ^^^^^^ help: change this to: `other` [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: implementation of inherent method `to_string(&self) -> String` for type `transition::Transition` [INFO] [stdout] --> exercise-04/src/transition.rs:27:5 [INFO] [stdout] | [INFO] [stdout] 27 | / pub fn to_string(&self) -> String { [INFO] [stdout] 28 | | format!("{} {}", self.symbol, self.destination_state) [INFO] [stdout] 29 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: implement trait `Display` for type `transition::Transition` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inherent_to_string [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> exercise-04/src/transition.rs:41:9 [INFO] [stdout] | [INFO] [stdout] 41 | assert_eq!(transition1.eq(&transition2), true) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 41 - assert_eq!(transition1.eq(&transition2), true) [INFO] [stdout] 41 + assert!(transition1.eq(&transition2)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> exercise-04/src/transition.rs:49:9 [INFO] [stdout] | [INFO] [stdout] 49 | assert_eq!(transition1.eq(&transition2), false) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 49 - assert_eq!(transition1.eq(&transition2), false) [INFO] [stdout] 49 + assert!(!transition1.eq(&transition2)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> exercise-04/src/transition.rs:57:9 [INFO] [stdout] | [INFO] [stdout] 57 | assert_eq!(transition1.eq(&transition2), false) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 57 - assert_eq!(transition1.eq(&transition2), false) [INFO] [stdout] 57 + assert!(!transition1.eq(&transition2)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> exercise-04/src/transition_log.rs:10:9 [INFO] [stdout] | [INFO] [stdout] 10 | / return TransitionLog { [INFO] [stdout] 11 | | current_state, [INFO] [stdout] 12 | | input, [INFO] [stdout] 13 | | next_state, [INFO] [stdout] 14 | | }; [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] 10 ~ TransitionLog { [INFO] [stdout] 11 + current_state, [INFO] [stdout] 12 + input, [INFO] [stdout] 13 + next_state, [INFO] [stdout] 14 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: implementation of inherent method `to_string(&self) -> String` for type `transition_log::TransitionLog` [INFO] [stdout] --> exercise-04/src/transition_log.rs:21:5 [INFO] [stdout] | [INFO] [stdout] 21 | / pub fn to_string(&self) -> String { [INFO] [stdout] 22 | | return format!( [INFO] [stdout] 23 | | "{} {} {}", [INFO] [stdout] 24 | | self.current_state.to_string(), [INFO] [stdout] ... | [INFO] [stdout] 27 | | ); [INFO] [stdout] 28 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: implement trait `Display` for type `transition_log::TransitionLog` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inherent_to_string [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> exercise-04/src/transition_log.rs:22:9 [INFO] [stdout] | [INFO] [stdout] 22 | / return format!( [INFO] [stdout] 23 | | "{} {} {}", [INFO] [stdout] 24 | | self.current_state.to_string(), [INFO] [stdout] 25 | | self.input.to_string(), [INFO] [stdout] 26 | | self.next_state.to_string() [INFO] [stdout] 27 | | ); [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] 22 ~ format!( [INFO] [stdout] 23 + "{} {} {}", [INFO] [stdout] 24 + self.current_state.to_string(), [INFO] [stdout] 25 + self.input.to_string(), [INFO] [stdout] 26 + self.next_state.to_string() [INFO] [stdout] 27 ~ ) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> exercise-04/src/transition_log.rs:24:31 [INFO] [stdout] | [INFO] [stdout] 24 | self.current_state.to_string(), [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] = note: `#[warn(clippy::to_string_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> exercise-04/src/transition_log.rs:25:23 [INFO] [stdout] | [INFO] [stdout] 25 | self.input.to_string(), [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> exercise-04/src/transition_log.rs:26:28 [INFO] [stdout] | [INFO] [stdout] 26 | self.next_state.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `eq` can be confused for the standard trait method `std::cmp::PartialEq::eq` [INFO] [stdout] --> exercise-04/src/transitions.rs:12:5 [INFO] [stdout] | [INFO] [stdout] 12 | / pub fn eq(&self, other: &Transitions) -> bool { [INFO] [stdout] 13 | | self.same_amount_of_transitions(other) [INFO] [stdout] 14 | | && self.transitions.iter().fold(true, |result, transition| { [INFO] [stdout] 15 | | result [INFO] [stdout] ... | [INFO] [stdout] 22 | | }) [INFO] [stdout] 23 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: consider implementing the trait `std::cmp::PartialEq` or choosing a less ambiguous method name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.fold` can be written more succinctly using another method [INFO] [stdout] --> exercise-04/src/transitions.rs:14:40 [INFO] [stdout] | [INFO] [stdout] 14 | && self.transitions.iter().fold(true, |result, transition| { [INFO] [stdout] | ________________________________________^ [INFO] [stdout] 15 | | result [INFO] [stdout] 16 | | && other [INFO] [stdout] 17 | | .transitions [INFO] [stdout] ... | [INFO] [stdout] 21 | | .unwrap_or(false) [INFO] [stdout] 22 | | }) [INFO] [stdout] | |______________^ [INFO] [stdout] | [INFO] [stdout] = note: the `all` method is short circuiting and may change the program semantics if the iterator has side effects [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 14 ~ && self.transitions.iter().all(|transition| other [INFO] [stdout] 15 + .transitions [INFO] [stdout] 16 + .iter() [INFO] [stdout] 17 + .find(|t| t.has_same_symbol(transition)) [INFO] [stdout] 18 + .map(|t| t.eq(transition)) [INFO] [stdout] 19 + .unwrap_or(false)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: implementation of inherent method `to_string(&self) -> String` for type `transitions::Transitions` [INFO] [stdout] --> exercise-04/src/transitions.rs:36:5 [INFO] [stdout] | [INFO] [stdout] 36 | / pub fn to_string(&self) -> String { [INFO] [stdout] 37 | | self.transitions [INFO] [stdout] 38 | | .iter() [INFO] [stdout] 39 | | .map(|transition| transition.to_string()) [INFO] [stdout] 40 | | .collect::>() [INFO] [stdout] 41 | | .join(" ") [INFO] [stdout] 42 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: implement trait `Display` for type `transitions::Transitions` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inherent_to_string [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> exercise-04/src/transitions.rs:62:9 [INFO] [stdout] | [INFO] [stdout] 62 | assert_eq!(transitions1.eq(&transitions2), true) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 62 - assert_eq!(transitions1.eq(&transitions2), true) [INFO] [stdout] 62 + assert!(transitions1.eq(&transitions2)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> exercise-04/src/transitions.rs:70:9 [INFO] [stdout] | [INFO] [stdout] 70 | assert_eq!(transitions1.eq(&transitions2), true) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 70 - assert_eq!(transitions1.eq(&transitions2), true) [INFO] [stdout] 70 + assert!(transitions1.eq(&transitions2)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> exercise-04/src/transitions.rs:82:9 [INFO] [stdout] | [INFO] [stdout] 82 | assert_eq!(transitions1.eq(&transitions2), false) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 82 - assert_eq!(transitions1.eq(&transitions2), false) [INFO] [stdout] 82 + assert!(!transitions1.eq(&transitions2)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> exercise-04/src/transitions.rs:90:9 [INFO] [stdout] | [INFO] [stdout] 90 | assert_eq!(transitions1.eq(&transitions2), false) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 90 - assert_eq!(transitions1.eq(&transitions2), false) [INFO] [stdout] 90 + assert!(!transitions1.eq(&transitions2)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> exercise-04/src/transitions_log.rs:27:9 [INFO] [stdout] | [INFO] [stdout] 27 | return TransitionsLog::new(transitions); [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 - return TransitionsLog::new(transitions); [INFO] [stdout] 27 + TransitionsLog::new(transitions) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: implementation of inherent method `to_string(&self) -> String` for type `transitions_log::TransitionsLog` [INFO] [stdout] --> exercise-04/src/transitions_log.rs:45:5 [INFO] [stdout] | [INFO] [stdout] 45 | / pub fn to_string(&self) -> String { [INFO] [stdout] 46 | | TransitionsLog::get_header() [INFO] [stdout] 47 | | + &self [INFO] [stdout] 48 | | .transitions [INFO] [stdout] ... | [INFO] [stdout] 52 | | .join("\n") [INFO] [stdout] 53 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: implement trait `Display` for type `transitions_log::TransitionsLog` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inherent_to_string [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> exercise-04/src/transitions_log.rs:20:19 [INFO] [stdout] | [INFO] [stdout] 20 | let aux = vec![transition]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: you can use an array directly: `[transition]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `LEFT` contains a capitalized acronym [INFO] [stdout] --> exercise-10/src/movement.rs:3:5 [INFO] [stdout] | [INFO] [stdout] 3 | LEFT, [INFO] [stdout] | ^^^^ help: consider making the acronym lowercase, except the initial letter: `Left` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] = note: `#[warn(clippy::upper_case_acronyms)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `RIGHT` contains a capitalized acronym [INFO] [stdout] --> exercise-10/src/movement.rs:4:5 [INFO] [stdout] | [INFO] [stdout] 4 | RIGHT, [INFO] [stdout] | ^^^^^ help: consider making the acronym lowercase, except the initial letter: `Right` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `STOP` contains a capitalized acronym [INFO] [stdout] --> exercise-10/src/movement.rs:5:5 [INFO] [stdout] | [INFO] [stdout] 5 | STOP, [INFO] [stdout] | ^^^^ help: consider making the acronym lowercase, except the initial letter: `Stop` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> exercise-10/src/tape.rs:18:40 [INFO] [stdout] | [INFO] [stdout] 18 | pub fn from_string_head_at(string: &String, head: usize) -> Tape { [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] 18 - pub fn from_string_head_at(string: &String, head: usize) -> Tape { [INFO] [stdout] 18 + pub fn from_string_head_at(string: &str, head: usize) -> Tape { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `char` which implements the `Copy` trait [INFO] [stdout] --> exercise-10/src/tape.rs:25:9 [INFO] [stdout] | [INFO] [stdout] 25 | self.rail.get(self.head).unwrap().clone() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*self.rail.get(self.head).unwrap()` [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: implementation of inherent method `to_string(&self) -> String` for type `tape::Tape` [INFO] [stdout] --> exercise-10/src/tape.rs:48:5 [INFO] [stdout] | [INFO] [stdout] 48 | / pub fn to_string(&self) -> String { [INFO] [stdout] 49 | | format!( [INFO] [stdout] 50 | | "...{}...\n...{}...", [INFO] [stdout] 51 | | self.rail_to_string(), [INFO] [stdout] ... | [INFO] [stdout] 54 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: implement trait `Display` for type `tape::Tape` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inherent_to_string [INFO] [stdout] = note: `#[warn(clippy::inherent_to_string)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::str::Chars<'_>` [INFO] [stdout] --> exercise-10/src/tape.rs:57:9 [INFO] [stdout] | [INFO] [stdout] 57 | / self.rail_to_string() [INFO] [stdout] 58 | | .chars() [INFO] [stdout] 59 | | .into_iter() [INFO] [stdout] | |________________________^ [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] help: consider removing `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 57 ~ self.rail_to_string() [INFO] [stdout] 58 + .chars() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `char` which implements the `Copy` trait [INFO] [stdout] --> exercise-10/src/tape.rs:78:35 [INFO] [stdout] | [INFO] [stdout] 78 | .map(|x| String::from(x.clone())) [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*x` [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] --> exercise-10/src/turing_machine.rs:63:9 [INFO] [stdout] | [INFO] [stdout] 63 | return Ok(status.tapes); [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] 63 - return Ok(status.tapes); [INFO] [stdout] 63 + Ok(status.tapes) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> exercise-10/src/turing_machine.rs:22:34 [INFO] [stdout] | [INFO] [stdout] 22 | pub fn execute(&self, input: &String) -> Result, Vec> { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 22 - pub fn execute(&self, input: &String) -> Result, Vec> { [INFO] [stdout] 22 + pub fn execute(&self, input: &str) -> Result, Vec> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> exercise-10/src/turing_machine.rs:46:25 [INFO] [stdout] | [INFO] [stdout] 46 | let tapes = vec![ [INFO] [stdout] | _________________________^ [INFO] [stdout] 47 | | tape.write(transition.write), [INFO] [stdout] 48 | | tape.write(transition.write).mov(transition.movement), [INFO] [stdout] 49 | | ]; [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] help: you can use an array directly [INFO] [stdout] | [INFO] [stdout] 46 ~ let tapes = [tape.write(transition.write), [INFO] [stdout] 47 ~ tape.write(transition.write).mov(transition.movement)]; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.50s [INFO] running `Command { std: "docker" "inspect" "252859ceb806d70302dada3235ac45e6ed47b3514499c848a9c129fe46703e3a", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "252859ceb806d70302dada3235ac45e6ed47b3514499c848a9c129fe46703e3a", kill_on_drop: false }` [INFO] [stdout] 252859ceb806d70302dada3235ac45e6ed47b3514499c848a9c129fe46703e3a