[INFO] cloning repository https://github.com/sh0623k/coding_interview [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/sh0623k/coding_interview" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fsh0623k%2Fcoding_interview", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fsh0623k%2Fcoding_interview'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] ad2a675ba51f91fb104e2272a58badfd5bfa77bc [INFO] linting sh0623k/coding_interview against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fsh0623k%2Fcoding_interview" "/workspace/builds/worker-7-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-7-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/sh0623k/coding_interview [INFO] finished tweaking git repo https://github.com/sh0623k/coding_interview [INFO] tweaked toml for git repo https://github.com/sh0623k/coding_interview written to /workspace/builds/worker-7-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/sh0623k/coding_interview 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/sh0623k/coding_interview 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] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-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] aa51e92424cb8b47f0635ba858d644aa115b93a5a8cce557ee62ea4e7b880076 [INFO] running `Command { std: "docker" "start" "-a" "aa51e92424cb8b47f0635ba858d644aa115b93a5a8cce557ee62ea4e7b880076", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "aa51e92424cb8b47f0635ba858d644aa115b93a5a8cce557ee62ea4e7b880076", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "aa51e92424cb8b47f0635ba858d644aa115b93a5a8cce557ee62ea4e7b880076", kill_on_drop: false }` [INFO] [stdout] aa51e92424cb8b47f0635ba858d644aa115b93a5a8cce557ee62ea4e7b880076 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-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] 50a6e5880cee264f6ae6742ca2f95404666eb3efc4fba8f104bfc904cbc89955 [INFO] running `Command { std: "docker" "start" "-a" "50a6e5880cee264f6ae6742ca2f95404666eb3efc4fba8f104bfc904cbc89955", kill_on_drop: false }` [INFO] [stderr] Checking coding_interview v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/stack.rs:42:13 [INFO] [stdout] | [INFO] [stdout] 42 | capacity_of_one: capacity_of_one, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `capacity_of_one` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/queue.rs:17:13 [INFO] [stdout] | [INFO] [stdout] 17 | size: size, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `size` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/queue.rs:84:13 [INFO] [stdout] | [INFO] [stdout] 84 | arr: arr, [INFO] [stdout] | ^^^^^^^^ help: replace it with: `arr` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/queue.rs:85:13 [INFO] [stdout] | [INFO] [stdout] 85 | next: next, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `next` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/tree.rs:13:13 [INFO] [stdout] | [INFO] [stdout] 13 | data: data, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `data` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `LinkedList` [INFO] [stdout] --> src/linked_list.rs:82:5 [INFO] [stdout] | [INFO] [stdout] 82 | / pub fn new() -> Self { [INFO] [stdout] 83 | | Self { head: None } [INFO] [stdout] 84 | | } [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] 78 + impl Default for LinkedList [INFO] [stdout] 79 + where [INFO] [stdout] 80 + T: std::cmp::Eq + std::hash::Hash + std::clone::Clone + std::cmp::PartialOrd, [INFO] [stdout] 81 + { [INFO] [stdout] 82 + fn default() -> Self { [INFO] [stdout] 83 + Self::new() [INFO] [stdout] 84 + } [INFO] [stdout] 85 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/linked_list.rs:146:16 [INFO] [stdout] | [INFO] [stdout] 146 | if !node_buf.is_none() && node_buf.unwrap().borrow().data == node.borrow().data { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try: `node_buf.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary operation [INFO] [stdout] --> src/linked_list.rs:147:17 [INFO] [stdout] | [INFO] [stdout] 147 | &node.borrow_mut().remove(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `node.borrow_mut().remove();` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_operation [INFO] [stdout] = note: `#[warn(clippy::unnecessary_operation)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this lifetime isn't used in the impl [INFO] [stdout] --> src/linked_list.rs:286:6 [INFO] [stdout] | [INFO] [stdout] 286 | impl<'a, T> Iterator for LinkedListIter { [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes [INFO] [stdout] = note: `#[warn(clippy::extra_unused_lifetimes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this lifetime isn't used in the impl [INFO] [stdout] --> src/linked_list.rs:299:6 [INFO] [stdout] | [INFO] [stdout] 299 | impl<'a, T> Iterator for LinkedListIterBackward { [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Stack` [INFO] [stdout] --> src/stack.rs:7:5 [INFO] [stdout] | [INFO] [stdout] 7 | / pub fn new() -> Self { [INFO] [stdout] 8 | | Stack { [INFO] [stdout] 9 | | arr: Vec::::new(), [INFO] [stdout] 10 | | top: 0, [INFO] [stdout] 11 | | } [INFO] [stdout] 12 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 6 + impl Default for Stack { [INFO] [stdout] 7 + fn default() -> Self { [INFO] [stdout] 8 + Self::new() [INFO] [stdout] 9 + } [INFO] [stdout] 10 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to pop elements from a `Vec` in a loop [INFO] [stdout] --> src/graph.rs:51:13 [INFO] [stdout] | [INFO] [stdout] 51 | let cur_v = todo.pop().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_while_let_some [INFO] [stdout] = note: `#[warn(clippy::manual_while_let_some)]` on by default [INFO] [stdout] help: consider using a `while..let` loop [INFO] [stdout] | [INFO] [stdout] 50 ~ while let Some(cur_v) = todo.pop() { [INFO] [stdout] 51 ~ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against true are unnecessary [INFO] [stdout] --> src/graph.rs:57:20 [INFO] [stdout] | [INFO] [stdout] 57 | if seen[edge.vertex_to] == true { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `seen[edge.vertex_to]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_comparison)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against true are unnecessary [INFO] [stdout] --> src/graph.rs:71:16 [INFO] [stdout] | [INFO] [stdout] 71 | if seen[edge.vertex_to] == true { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `seen[edge.vertex_to]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/tree.rs:38:44 [INFO] [stdout] | [INFO] [stdout] 38 | self.create_minimal_bst_with_range(&arr, 0, arr.len() - 1); [INFO] [stdout] | ^^^^ help: change this to: `arr` [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/tree.rs:47:60 [INFO] [stdout] | [INFO] [stdout] 47 | node.left = self.create_minimal_bst_with_range(&arr, start, mid - 1); [INFO] [stdout] | ^^^^ help: change this to: `arr` [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/tree.rs:49:57 [INFO] [stdout] | [INFO] [stdout] 49 | node.right = self.create_minimal_bst_with_range(&arr, mid + 1, end); [INFO] [stdout] | ^^^^ help: change this to: `arr` [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: unused borrow that must be used [INFO] [stdout] --> src/linked_list.rs:147:17 [INFO] [stdout] | [INFO] [stdout] 147 | &node.borrow_mut().remove(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the borrow produces a value [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_must_use)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: use `let _ = ...` to ignore the resulting value [INFO] [stdout] | [INFO] [stdout] 147 | let _ = &node.borrow_mut().remove(); [INFO] [stdout] | +++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: hiding a lifetime that's elided elsewhere is confusing [INFO] [stdout] --> src/queue.rs:64:17 [INFO] [stdout] | [INFO] [stdout] 64 | pub fn iter(&self) -> QueueIter { [INFO] [stdout] | ^^^^^ ^^^^^^^^^^^^ the same lifetime is hidden here [INFO] [stdout] | | [INFO] [stdout] | the lifetime is elided here [INFO] [stdout] | [INFO] [stdout] = help: the same lifetime is referred to in inconsistent ways, making the signature confusing [INFO] [stdout] = note: `#[warn(mismatched_lifetime_syntaxes)]` on by default [INFO] [stdout] help: use `'_` for type paths [INFO] [stdout] | [INFO] [stdout] 64 | pub fn iter(&self) -> QueueIter<'_, T> { [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/stack.rs:42:13 [INFO] [stdout] | [INFO] [stdout] 42 | capacity_of_one: capacity_of_one, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `capacity_of_one` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/queue.rs:17:13 [INFO] [stdout] | [INFO] [stdout] 17 | size: size, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `size` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/queue.rs:84:13 [INFO] [stdout] | [INFO] [stdout] 84 | arr: arr, [INFO] [stdout] | ^^^^^^^^ help: replace it with: `arr` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/queue.rs:85:13 [INFO] [stdout] | [INFO] [stdout] 85 | next: next, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `next` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/tree.rs:13:13 [INFO] [stdout] | [INFO] [stdout] 13 | data: data, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `data` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: items after a test module [INFO] [stdout] --> src/bin/ch01p05.rs:88:1 [INFO] [stdout] | [INFO] [stdout] 88 | mod tests { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 99 | fn main() { [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 `if` statement can be collapsed [INFO] [stdout] --> src/bin/ch01p05.rs:74:9 [INFO] [stdout] | [INFO] [stdout] 74 | / if !found_missing_char { [INFO] [stdout] 75 | | if char_long != None && char_short != char_long.unwrap() { [INFO] [stdout] 76 | | found_missing_char = true; [INFO] [stdout] 77 | | char_long = itr_char_long.next(); [INFO] [stdout] 78 | | } [INFO] [stdout] 79 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 74 ~ if !found_missing_char [INFO] [stdout] 75 ~ && char_long != None && char_short != char_long.unwrap() { [INFO] [stdout] 76 | found_missing_char = true; [INFO] [stdout] 77 | char_long = itr_char_long.next(); [INFO] [stdout] 78 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> src/bin/ch01p05.rs:75:16 [INFO] [stdout] | [INFO] [stdout] 75 | if char_long != None && char_short != char_long.unwrap() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: use `Option::is_some()` instead: `char_long.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] = note: `#[warn(clippy::partialeq_to_none)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> src/bin/ch01p05.rs:80:12 [INFO] [stdout] | [INFO] [stdout] 80 | if char_long != None && char_short != char_long.unwrap() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: use `Option::is_some()` instead: `char_long.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/bin/ch01p05.rs:92:9 [INFO] [stdout] | [INFO] [stdout] 92 | assert_eq!(is_convertible_by_once(&String::from("pale"), &String::from("ple")), 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] 92 - assert_eq!(is_convertible_by_once(&String::from("pale"), &String::from("ple")), true); [INFO] [stdout] 92 + assert!(is_convertible_by_once(&String::from("pale"), &String::from("ple"))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/bin/ch01p05.rs:93:9 [INFO] [stdout] | [INFO] [stdout] 93 | assert_eq!(is_convertible_by_once(&String::from("pales"), &String::from("pale")), 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] 93 - assert_eq!(is_convertible_by_once(&String::from("pales"), &String::from("pale")), true); [INFO] [stdout] 93 + assert!(is_convertible_by_once(&String::from("pales"), &String::from("pale"))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/bin/ch01p05.rs:94:9 [INFO] [stdout] | [INFO] [stdout] 94 | assert_eq!(is_convertible_by_once(&String::from("pale"), &String::from("bale")), 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] 94 - assert_eq!(is_convertible_by_once(&String::from("pale"), &String::from("bale")), true); [INFO] [stdout] 94 + assert!(is_convertible_by_once(&String::from("pale"), &String::from("bale"))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/bin/ch01p05.rs:95:9 [INFO] [stdout] | [INFO] [stdout] 95 | assert_eq!(is_convertible_by_once(&String::from("pale"), &String::from("bake")), 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] 95 - assert_eq!(is_convertible_by_once(&String::from("pale"), &String::from("bake")), false); [INFO] [stdout] 95 + assert!(!is_convertible_by_once(&String::from("pale"), &String::from("bake"))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/str_helper.rs:34:9 [INFO] [stdout] | [INFO] [stdout] 34 | assert_eq!(char_count_map.contains_key(&'f'), 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] = note: `#[warn(clippy::bool_assert_comparison)]` on by default [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 34 - assert_eq!(char_count_map.contains_key(&'f'), false); [INFO] [stdout] 34 + assert!(!char_count_map.contains_key(&'f')); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `LinkedList` [INFO] [stdout] --> src/linked_list.rs:82:5 [INFO] [stdout] | [INFO] [stdout] 82 | / pub fn new() -> Self { [INFO] [stdout] 83 | | Self { head: None } [INFO] [stdout] 84 | | } [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] 78 + impl Default for LinkedList [INFO] [stdout] 79 + where [INFO] [stdout] 80 + T: std::cmp::Eq + std::hash::Hash + std::clone::Clone + std::cmp::PartialOrd, [INFO] [stdout] 81 + { [INFO] [stdout] 82 + fn default() -> Self { [INFO] [stdout] 83 + Self::new() [INFO] [stdout] 84 + } [INFO] [stdout] 85 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/linked_list.rs:146:16 [INFO] [stdout] | [INFO] [stdout] 146 | if !node_buf.is_none() && node_buf.unwrap().borrow().data == node.borrow().data { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try: `node_buf.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary operation [INFO] [stdout] --> src/linked_list.rs:147:17 [INFO] [stdout] | [INFO] [stdout] 147 | &node.borrow_mut().remove(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `node.borrow_mut().remove();` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_operation [INFO] [stdout] = note: `#[warn(clippy::unnecessary_operation)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this lifetime isn't used in the impl [INFO] [stdout] --> src/linked_list.rs:286:6 [INFO] [stdout] | [INFO] [stdout] 286 | impl<'a, T> Iterator for LinkedListIter { [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes [INFO] [stdout] = note: `#[warn(clippy::extra_unused_lifetimes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this lifetime isn't used in the impl [INFO] [stdout] --> src/linked_list.rs:299:6 [INFO] [stdout] | [INFO] [stdout] 299 | impl<'a, T> Iterator for LinkedListIterBackward { [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/linked_list.rs:340:9 [INFO] [stdout] | [INFO] [stdout] 340 | assert_eq!(list1.list_has_duplicates(), 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] 340 - assert_eq!(list1.list_has_duplicates(), false); [INFO] [stdout] 340 + assert!(!list1.list_has_duplicates()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/linked_list.rs:348:9 [INFO] [stdout] | [INFO] [stdout] 348 | assert_eq!(list2.list_has_duplicates(), 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] 348 - assert_eq!(list2.list_has_duplicates(), true); [INFO] [stdout] 348 + assert!(list2.list_has_duplicates()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/linked_list.rs:358:9 [INFO] [stdout] | [INFO] [stdout] 358 | assert_eq!(list1.list_has_duplicates(), 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] 358 - assert_eq!(list1.list_has_duplicates(), false); [INFO] [stdout] 358 + assert!(!list1.list_has_duplicates()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/linked_list.rs:369:9 [INFO] [stdout] | [INFO] [stdout] 369 | assert_eq!(list2.list_has_duplicates(), 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] 369 - assert_eq!(list2.list_has_duplicates(), true); [INFO] [stdout] 369 + assert!(list2.list_has_duplicates()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/linked_list.rs:373:9 [INFO] [stdout] | [INFO] [stdout] 373 | assert_eq!(list2.list_has_duplicates(), 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] 373 - assert_eq!(list2.list_has_duplicates(), false); [INFO] [stdout] 373 + assert!(!list2.list_has_duplicates()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary operation [INFO] [stdout] --> src/linked_list.rs:405:17 [INFO] [stdout] | [INFO] [stdout] 405 | &node.borrow_mut().remove(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `node.borrow_mut().remove();` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_operation [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Stack` [INFO] [stdout] --> src/stack.rs:7:5 [INFO] [stdout] | [INFO] [stdout] 7 | / pub fn new() -> Self { [INFO] [stdout] 8 | | Stack { [INFO] [stdout] 9 | | arr: Vec::::new(), [INFO] [stdout] 10 | | top: 0, [INFO] [stdout] 11 | | } [INFO] [stdout] 12 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 6 + impl Default for Stack { [INFO] [stdout] 7 + fn default() -> Self { [INFO] [stdout] 8 + Self::new() [INFO] [stdout] 9 + } [INFO] [stdout] 10 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/stack.rs:77:9 [INFO] [stdout] | [INFO] [stdout] 77 | assert_eq!(stack.is_empty(), 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] 77 - assert_eq!(stack.is_empty(), true); [INFO] [stdout] 77 + assert!(stack.is_empty()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/stack.rs:99:9 [INFO] [stdout] | [INFO] [stdout] 99 | assert_eq!(set_of_stacks.is_empty(), 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] 99 - assert_eq!(set_of_stacks.is_empty(), true); [INFO] [stdout] 99 + assert!(set_of_stacks.is_empty()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/queue.rs:143:9 [INFO] [stdout] | [INFO] [stdout] 143 | assert_eq!(my_queue.enqueue(10), 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] 143 - assert_eq!(my_queue.enqueue(10), false); [INFO] [stdout] 143 + assert!(!my_queue.enqueue(10)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/queue.rs:147:9 [INFO] [stdout] | [INFO] [stdout] 147 | assert_eq!(my_queue.dequeue().is_none(), 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] 147 - assert_eq!(my_queue.dequeue().is_none(), true); [INFO] [stdout] 147 + assert!(my_queue.dequeue().is_none()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to pop elements from a `Vec` in a loop [INFO] [stdout] --> src/graph.rs:51:13 [INFO] [stdout] | [INFO] [stdout] 51 | let cur_v = todo.pop().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_while_let_some [INFO] [stdout] = note: `#[warn(clippy::manual_while_let_some)]` on by default [INFO] [stdout] help: consider using a `while..let` loop [INFO] [stdout] | [INFO] [stdout] 50 ~ while let Some(cur_v) = todo.pop() { [INFO] [stdout] 51 ~ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against true are unnecessary [INFO] [stdout] --> src/graph.rs:57:20 [INFO] [stdout] | [INFO] [stdout] 57 | if seen[edge.vertex_to] == true { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `seen[edge.vertex_to]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_comparison)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against true are unnecessary [INFO] [stdout] --> src/graph.rs:71:16 [INFO] [stdout] | [INFO] [stdout] 71 | if seen[edge.vertex_to] == true { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `seen[edge.vertex_to]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: items after a test module [INFO] [stdout] --> src/bin/ch05p08.rs:17:1 [INFO] [stdout] | [INFO] [stdout] 17 | mod tests { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 29 | fn main() { [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: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/ch05p08.rs:8:22 [INFO] [stdout] | [INFO] [stdout] 8 | fn draw_line(screen: &mut Vec, width: usize, x1: usize, x2: usize, y: usize) { [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] 8 - fn draw_line(screen: &mut Vec, width: usize, x1: usize, x2: usize, y: usize) { [INFO] [stdout] 8 + fn draw_line(screen: &mut [u8], width: usize, x1: usize, x2: usize, y: usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `vertex` is used as a loop counter [INFO] [stdout] --> src/graph.rs:130:9 [INFO] [stdout] | [INFO] [stdout] 130 | for i in 6..11 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: consider using: `for (vertex, i) in (1..).zip((6..11))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] = note: `#[warn(clippy::explicit_counter_loop)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/graph.rs:139:13 [INFO] [stdout] | [INFO] [stdout] 139 | assert_eq!(graph.has_a_walk(0, i), 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] 139 - assert_eq!(graph.has_a_walk(0, i), true); [INFO] [stdout] 139 + assert!(graph.has_a_walk(0, i)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/graph.rs:141:9 [INFO] [stdout] | [INFO] [stdout] 141 | assert_eq!(graph.has_a_walk(0, 10), 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] 141 - assert_eq!(graph.has_a_walk(0, 10), true); [INFO] [stdout] 141 + assert!(graph.has_a_walk(0, 10)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/graph.rs:142:9 [INFO] [stdout] | [INFO] [stdout] 142 | assert_eq!(graph.has_a_walk(1, 14), 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] 142 - assert_eq!(graph.has_a_walk(1, 14), true); [INFO] [stdout] 142 + assert!(graph.has_a_walk(1, 14)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/graph.rs:143:9 [INFO] [stdout] | [INFO] [stdout] 143 | assert_eq!(graph.has_a_walk(0, 12), 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] 143 - assert_eq!(graph.has_a_walk(0, 12), false); [INFO] [stdout] 143 + assert!(!graph.has_a_walk(0, 12)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: items after a test module [INFO] [stdout] --> src/bin/ch05p01.rs:21:1 [INFO] [stdout] | [INFO] [stdout] 21 | mod tests { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 30 | fn main() { [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: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/graph.rs:144:9 [INFO] [stdout] | [INFO] [stdout] 144 | assert_eq!(graph.has_a_walk(0, 16), 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] 144 - assert_eq!(graph.has_a_walk(0, 16), false); [INFO] [stdout] 144 + assert!(!graph.has_a_walk(0, 16)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/graph.rs:145:9 [INFO] [stdout] | [INFO] [stdout] 145 | assert_eq!(graph.has_a_walk(6, 10), 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] 145 - assert_eq!(graph.has_a_walk(6, 10), false); [INFO] [stdout] 145 + assert!(!graph.has_a_walk(6, 10)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/ch05p01.rs:15:9 [INFO] [stdout] | [INFO] [stdout] 15 | mask = mask | (1 << cnt); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `mask |= (1 << cnt)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/tree.rs:38:44 [INFO] [stdout] | [INFO] [stdout] 38 | self.create_minimal_bst_with_range(&arr, 0, arr.len() - 1); [INFO] [stdout] | ^^^^ help: change this to: `arr` [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/tree.rs:47:60 [INFO] [stdout] | [INFO] [stdout] 47 | node.left = self.create_minimal_bst_with_range(&arr, start, mid - 1); [INFO] [stdout] | ^^^^ help: change this to: `arr` [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/tree.rs:49:57 [INFO] [stdout] | [INFO] [stdout] 49 | node.right = self.create_minimal_bst_with_range(&arr, mid + 1, end); [INFO] [stdout] | ^^^^ help: change this to: `arr` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `result` [INFO] [stdout] --> src/tree.rs:80:18 [INFO] [stdout] | [INFO] [stdout] 80 | for i in 0..15 { [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 80 - for i in 0..15 { [INFO] [stdout] 80 + for (i, ) in result.iter().enumerate().take(15) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: items after a test module [INFO] [stdout] --> src/bin/ch01p01.rs:82:1 [INFO] [stdout] | [INFO] [stdout] 82 | mod tests { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 110 | fn main () { [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: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/bin/ch01p01.rs:86:9 [INFO] [stdout] | [INFO] [stdout] 86 | assert_eq!(is_all_chars_unique(&String::from("abcdefg")), 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] 86 - assert_eq!(is_all_chars_unique(&String::from("abcdefg")), true); [INFO] [stdout] 86 + assert!(is_all_chars_unique(&String::from("abcdefg"))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/bin/ch01p01.rs:87:9 [INFO] [stdout] | [INFO] [stdout] 87 | assert_eq!(is_all_chars_unique(&String::from("abccdefg")), 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] 87 - assert_eq!(is_all_chars_unique(&String::from("abccdefg")), false); [INFO] [stdout] 87 + assert!(!is_all_chars_unique(&String::from("abccdefg"))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused borrow that must be used [INFO] [stdout] --> src/linked_list.rs:147:17 [INFO] [stdout] | [INFO] [stdout] 147 | &node.borrow_mut().remove(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the borrow produces a value [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_must_use)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: use `let _ = ...` to ignore the resulting value [INFO] [stdout] | [INFO] [stdout] 147 | let _ = &node.borrow_mut().remove(); [INFO] [stdout] | +++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/bin/ch01p01.rs:91:9 [INFO] [stdout] | [INFO] [stdout] 91 | assert_eq!(is_all_chars_unique_without_add_data_structure(&String::from("abcdefg")), 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] 91 - assert_eq!(is_all_chars_unique_without_add_data_structure(&String::from("abcdefg")), true); [INFO] [stdout] 91 + assert!(is_all_chars_unique_without_add_data_structure(&String::from("abcdefg"))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/bin/ch01p01.rs:92:9 [INFO] [stdout] | [INFO] [stdout] 92 | assert_eq!(is_all_chars_unique_without_add_data_structure(&String::from("abccdefg")), 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] 92 - assert_eq!(is_all_chars_unique_without_add_data_structure(&String::from("abccdefg")), false); [INFO] [stdout] 92 + assert!(!is_all_chars_unique_without_add_data_structure(&String::from("abccdefg"))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/bin/ch01p01.rs:93:9 [INFO] [stdout] | [INFO] [stdout] 93 | assert_eq!(is_all_chars_unique_without_add_data_structure(&String::from("abcdēfg")), 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] 93 - assert_eq!(is_all_chars_unique_without_add_data_structure(&String::from("abcdēfg")), true); [INFO] [stdout] 93 + assert!(is_all_chars_unique_without_add_data_structure(&String::from("abcdēfg"))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused borrow that must be used [INFO] [stdout] --> src/linked_list.rs:405:17 [INFO] [stdout] | [INFO] [stdout] 405 | &node.borrow_mut().remove(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the borrow produces a value [INFO] [stdout] | [INFO] [stdout] help: use `let _ = ...` to ignore the resulting value [INFO] [stdout] | [INFO] [stdout] 405 | let _ = &node.borrow_mut().remove(); [INFO] [stdout] | +++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: hiding a lifetime that's elided elsewhere is confusing [INFO] [stdout] --> src/queue.rs:64:17 [INFO] [stdout] | [INFO] [stdout] 64 | pub fn iter(&self) -> QueueIter { [INFO] [stdout] | ^^^^^ ^^^^^^^^^^^^ the same lifetime is hidden here [INFO] [stdout] | | [INFO] [stdout] | the lifetime is elided here [INFO] [stdout] | [INFO] [stdout] = help: the same lifetime is referred to in inconsistent ways, making the signature confusing [INFO] [stdout] = note: `#[warn(mismatched_lifetime_syntaxes)]` on by default [INFO] [stdout] help: use `'_` for type paths [INFO] [stdout] | [INFO] [stdout] 64 | pub fn iter(&self) -> QueueIter<'_, T> { [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/bin/ch01p01.rs:94:9 [INFO] [stdout] | [INFO] [stdout] 94 | assert_eq!(is_all_chars_unique_without_add_data_structure(&String::from("abcdēēfg")), 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] 94 - assert_eq!(is_all_chars_unique_without_add_data_structure(&String::from("abcdēēfg")), false); [INFO] [stdout] 94 + assert!(!is_all_chars_unique_without_add_data_structure(&String::from("abcdēēfg"))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/bin/ch01p01.rs:98:9 [INFO] [stdout] | [INFO] [stdout] 98 | assert_eq!(is_all_chars_unique_with_sorted_str(&String::from("abcdefg")), 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] 98 - assert_eq!(is_all_chars_unique_with_sorted_str(&String::from("abcdefg")), true); [INFO] [stdout] 98 + assert!(is_all_chars_unique_with_sorted_str(&String::from("abcdefg"))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/bin/ch01p01.rs:99:9 [INFO] [stdout] | [INFO] [stdout] 99 | assert_eq!(is_all_chars_unique_with_sorted_str(&String::from("abccdefg")), 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] 99 - assert_eq!(is_all_chars_unique_with_sorted_str(&String::from("abccdefg")), false); [INFO] [stdout] 99 + assert!(!is_all_chars_unique_with_sorted_str(&String::from("abccdefg"))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `StackWithMin` [INFO] [stdout] --> src/bin/ch03p02.rs:17:5 [INFO] [stdout] | [INFO] [stdout] 17 | / pub fn new() -> Self { [INFO] [stdout] 18 | | StackWithMin { [INFO] [stdout] 19 | | arr: Vec::::new(), [INFO] [stdout] 20 | | top: 0, [INFO] [stdout] ... | [INFO] [stdout] 23 | | } [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] 13 + impl Default for StackWithMin [INFO] [stdout] 14 + where [INFO] [stdout] 15 + T: std::cmp::PartialEq + std::cmp::PartialOrd + std::clone::Clone, [INFO] [stdout] 16 + { [INFO] [stdout] 17 + fn default() -> Self { [INFO] [stdout] 18 + Self::new() [INFO] [stdout] 19 + } [INFO] [stdout] 20 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: items after a test module [INFO] [stdout] --> src/bin/ch01p07.rs:74:1 [INFO] [stdout] | [INFO] [stdout] 74 | mod tests { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 128 | fn main() { [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: length comparison to zero [INFO] [stdout] --> src/bin/ch01p07.rs:8:8 [INFO] [stdout] | [INFO] [stdout] 8 | if matrix.len() == 0 || matrix.len() != matrix[0].len(){ [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `matrix.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: length comparison to one [INFO] [stdout] --> src/bin/ch08p03.rs:9:8 [INFO] [stdout] | [INFO] [stdout] 9 | if sorted_nums.len() < 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `sorted_nums.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: unnecessary operation [INFO] [stdout] --> src/bin/ch02p03.rs:19:13 [INFO] [stdout] | [INFO] [stdout] 19 | &node.borrow_mut().remove(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `node.borrow_mut().remove();` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_operation [INFO] [stdout] = note: `#[warn(clippy::unnecessary_operation)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused borrow that must be used [INFO] [stdout] --> src/bin/ch02p03.rs:19:13 [INFO] [stdout] | [INFO] [stdout] 19 | &node.borrow_mut().remove(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the borrow produces a value [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_must_use)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: use `let _ = ...` to ignore the resulting value [INFO] [stdout] | [INFO] [stdout] 19 | let _ = &node.borrow_mut().remove(); [INFO] [stdout] | +++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: items after a test module [INFO] [stdout] --> src/bin/ch08p11.rs:33:1 [INFO] [stdout] | [INFO] [stdout] 33 | mod tests { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 44 | fn main() { [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: the function `urlify` doesn't need a mutable reference [INFO] [stdout] --> src/bin/ch01p03.rs:63:12 [INFO] [stdout] | [INFO] [stdout] 63 | urlify(&mut String::from("Mr John Smith ")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed [INFO] [stdout] = note: `#[warn(clippy::unnecessary_mut_passed)]` on by default [INFO] [stdout] help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] 63 - urlify(&mut String::from("Mr John Smith ")); [INFO] [stdout] 63 + urlify(&String::from("Mr John Smith ")); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the function `urlify_fold` doesn't need a mutable reference [INFO] [stdout] --> src/bin/ch01p03.rs:65:17 [INFO] [stdout] | [INFO] [stdout] 65 | urlify_fold(&mut String::from("Mr John Smith ")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed [INFO] [stdout] help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] 65 - urlify_fold(&mut String::from("Mr John Smith ")); [INFO] [stdout] 65 + urlify_fold(&String::from("Mr John Smith ")); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/bin/ch07p01.rs:79:13 [INFO] [stdout] | [INFO] [stdout] 79 | suit: suit, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `suit` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/bin/ch07p01.rs:80:13 [INFO] [stdout] | [INFO] [stdout] 80 | rank: rank, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `rank` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/bin/ch07p01.rs:104:13 [INFO] [stdout] | [INFO] [stdout] 104 | cards: cards, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `cards` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/bin/ch07p01.rs:125:13 [INFO] [stdout] | [INFO] [stdout] 125 | cards: cards, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `cards` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/ch01p05.rs:74:9 [INFO] [stdout] | [INFO] [stdout] 74 | / if !found_missing_char { [INFO] [stdout] 75 | | if char_long != None && char_short != char_long.unwrap() { [INFO] [stdout] 76 | | found_missing_char = true; [INFO] [stdout] 77 | | char_long = itr_char_long.next(); [INFO] [stdout] 78 | | } [INFO] [stdout] 79 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 74 ~ if !found_missing_char [INFO] [stdout] 75 ~ && char_long != None && char_short != char_long.unwrap() { [INFO] [stdout] 76 | found_missing_char = true; [INFO] [stdout] 77 | char_long = itr_char_long.next(); [INFO] [stdout] 78 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> src/bin/ch01p05.rs:75:16 [INFO] [stdout] | [INFO] [stdout] 75 | if char_long != None && char_short != char_long.unwrap() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: use `Option::is_some()` instead: `char_long.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] = note: `#[warn(clippy::partialeq_to_none)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> src/bin/ch01p05.rs:80:12 [INFO] [stdout] | [INFO] [stdout] 80 | if char_long != None && char_short != char_long.unwrap() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: use `Option::is_some()` instead: `char_long.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/bin/ch07p01.rs:91:13 [INFO] [stdout] | [INFO] [stdout] 91 | let mut value = 0; [INFO] [stdout] | ----^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/bin/ch07p01.rs:108:13 [INFO] [stdout] | [INFO] [stdout] 108 | let mut score = 0; [INFO] [stdout] | ----^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `card` [INFO] [stdout] --> src/bin/ch07p01.rs:112:28 [INFO] [stdout] | [INFO] [stdout] 112 | fn add_card(&mut self, card: BlackJackCard) { [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_card` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/bin/ch07p01.rs:136:13 [INFO] [stdout] | [INFO] [stdout] 136 | let mut hand: Vec = vec![]; [INFO] [stdout] | ----^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait `Card` is never used [INFO] [stdout] --> src/bin/ch07p01.rs:50:7 [INFO] [stdout] | [INFO] [stdout] 50 | trait Card { [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait `Deck` is never used [INFO] [stdout] --> src/bin/ch07p01.rs:55:7 [INFO] [stdout] | [INFO] [stdout] 55 | trait Deck { [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait `Hand` is never used [INFO] [stdout] --> src/bin/ch07p01.rs:63:7 [INFO] [stdout] | [INFO] [stdout] 63 | trait Hand { [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `suit`, `rank`, and `available` are never read [INFO] [stdout] --> src/bin/ch07p01.rs:71:5 [INFO] [stdout] | [INFO] [stdout] 70 | struct BlackJackCard { [INFO] [stdout] | ------------- fields in this struct [INFO] [stdout] 71 | suit: Suit, [INFO] [stdout] | ^^^^ [INFO] [stdout] 72 | rank: Rank, [INFO] [stdout] | ^^^^ [INFO] [stdout] 73 | available: bool, [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `BlackJackCard` has derived impls for the traits `Debug` and `Clone`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `BlackJackHand` is never constructed [INFO] [stdout] --> src/bin/ch07p01.rs:97:8 [INFO] [stdout] | [INFO] [stdout] 97 | struct BlackJackHand { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `BlackJackDeck` is never constructed [INFO] [stdout] --> src/bin/ch07p01.rs:117:8 [INFO] [stdout] | [INFO] [stdout] 117 | struct BlackJackDeck { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/bin/ch07p01.rs:92:9 [INFO] [stdout] | [INFO] [stdout] 91 | let mut value = 0; [INFO] [stdout] | ------------------ unnecessary `let` binding [INFO] [stdout] 92 | value [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 91 ~ [INFO] [stdout] 92 ~ 0 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to one [INFO] [stdout] --> src/bin/ch01p08.rs:8:8 [INFO] [stdout] | [INFO] [stdout] 8 | if matrix.len() < 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `matrix.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 `col` is used to index `matrix` [INFO] [stdout] --> src/bin/ch01p08.rs:17:20 [INFO] [stdout] | [INFO] [stdout] 17 | for col in 0..matrix[0].len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 17 - for col in 0..matrix[0].len() { [INFO] [stdout] 17 + for (col, ) in matrix.iter().enumerate().take(matrix[0].len()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `matrix` [INFO] [stdout] --> src/bin/ch01p08.rs:30:18 [INFO] [stdout] | [INFO] [stdout] 30 | for i in 0..matrix.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] 30 - for i in 0..matrix.len() { [INFO] [stdout] 30 + for in &mut matrix { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/bin/ch04p02.rs:10:9 [INFO] [stdout] | [INFO] [stdout] 10 | let mut mbst = MinimalBinarySearchTree::::new(&arr); [INFO] [stdout] | ----^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `node` after checking its variant with `is_some` [INFO] [stdout] --> src/bin/ch04p02.rs:13:29 [INFO] [stdout] | [INFO] [stdout] 12 | if node.is_some() { [INFO] [stdout] | ----------------- help: try: `if let Some() = node` [INFO] [stdout] 13 | let some_node = node.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/ch05p01.rs:15:9 [INFO] [stdout] | [INFO] [stdout] 15 | mask = mask | (1 << cnt); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `mask |= (1 << cnt)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: items after a test module [INFO] [stdout] --> src/bin/ch01p04.rs:35:1 [INFO] [stdout] | [INFO] [stdout] 35 | mod tests { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 49 | fn main() { [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: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/bin/ch01p04.rs:39:9 [INFO] [stdout] | [INFO] [stdout] 39 | assert_eq!(is_palindrome(&String::from("Tact Coa")), 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] 39 - assert_eq!(is_palindrome(&String::from("Tact Coa")), true); [INFO] [stdout] 39 + assert!(is_palindrome(&String::from("Tact Coa"))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/bin/ch01p04.rs:40:9 [INFO] [stdout] | [INFO] [stdout] 40 | assert_eq!(is_palindrome(&String::from(" Tact Coa ")), 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] 40 - assert_eq!(is_palindrome(&String::from(" Tact Coa ")), true); [INFO] [stdout] 40 + assert!(is_palindrome(&String::from(" Tact Coa "))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/bin/ch01p04.rs:41:9 [INFO] [stdout] | [INFO] [stdout] 41 | assert_eq!(is_palindrome(&String::from("aabbcc")), 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!(is_palindrome(&String::from("aabbcc")), true); [INFO] [stdout] 41 + assert!(is_palindrome(&String::from("aabbcc"))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/bin/ch01p04.rs:42:9 [INFO] [stdout] | [INFO] [stdout] 42 | assert_eq!(is_palindrome(&String::from("aabbēē")), 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] 42 - assert_eq!(is_palindrome(&String::from("aabbēē")), true); [INFO] [stdout] 42 + assert!(is_palindrome(&String::from("aabbēē"))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/bin/ch01p04.rs:43:9 [INFO] [stdout] | [INFO] [stdout] 43 | assert_eq!(is_palindrome(&String::from("aaacccc")), 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] 43 - assert_eq!(is_palindrome(&String::from("aaacccc")), true); [INFO] [stdout] 43 + assert!(is_palindrome(&String::from("aaacccc"))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/bin/ch01p04.rs:44:9 [INFO] [stdout] | [INFO] [stdout] 44 | assert_eq!(is_palindrome(&String::from("abbc")), 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] 44 - assert_eq!(is_palindrome(&String::from("abbc")), false); [INFO] [stdout] 44 + assert!(!is_palindrome(&String::from("abbc"))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/bin/ch01p04.rs:45:9 [INFO] [stdout] | [INFO] [stdout] 45 | assert_eq!(is_palindrome(&String::from("aaabbccc")), 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] 45 - assert_eq!(is_palindrome(&String::from("aaabbccc")), false); [INFO] [stdout] 45 + assert!(!is_palindrome(&String::from("aaabbccc"))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: items after a test module [INFO] [stdout] --> src/bin/ch08p03.rs:39:1 [INFO] [stdout] | [INFO] [stdout] 39 | mod tests { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 49 | fn main() { [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: length comparison to one [INFO] [stdout] --> src/bin/ch08p03.rs:9:8 [INFO] [stdout] | [INFO] [stdout] 9 | if sorted_nums.len() < 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `sorted_nums.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: items after a test module [INFO] [stdout] --> src/bin/ch03p02.rs:54:1 [INFO] [stdout] | [INFO] [stdout] 54 | mod tests { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 76 | fn main() { [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: you should consider adding a `Default` implementation for `StackWithMin` [INFO] [stdout] --> src/bin/ch03p02.rs:17:5 [INFO] [stdout] | [INFO] [stdout] 17 | / pub fn new() -> Self { [INFO] [stdout] 18 | | StackWithMin { [INFO] [stdout] 19 | | arr: Vec::::new(), [INFO] [stdout] 20 | | top: 0, [INFO] [stdout] ... | [INFO] [stdout] 23 | | } [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] 13 + impl Default for StackWithMin [INFO] [stdout] 14 + where [INFO] [stdout] 15 + T: std::cmp::PartialEq + std::cmp::PartialOrd + std::clone::Clone, [INFO] [stdout] 16 + { [INFO] [stdout] 17 + fn default() -> Self { [INFO] [stdout] 18 + Self::new() [INFO] [stdout] 19 + } [INFO] [stdout] 20 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/ch01p07.rs:8:8 [INFO] [stdout] | [INFO] [stdout] 8 | if matrix.len() == 0 || matrix.len() != matrix[0].len(){ [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `matrix.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: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/bin/ch03p02.rs:72:9 [INFO] [stdout] | [INFO] [stdout] 72 | assert_eq!(stack_with_min.min().is_none(), 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] 72 - assert_eq!(stack_with_min.min().is_none(), true); [INFO] [stdout] 72 + assert!(stack_with_min.min().is_none()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `digit` is used as a loop counter [INFO] [stdout] --> src/bin/ch02p05.rs:24:5 [INFO] [stdout] | [INFO] [stdout] 24 | for node in list.iter() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (digit, node) in list.iter().enumerate()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] = note: `#[warn(clippy::explicit_counter_loop)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `i32` which implements the `Copy` trait [INFO] [stdout] --> src/bin/ch02p05.rs:25:17 [INFO] [stdout] | [INFO] [stdout] 25 | let v = node.borrow().data.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `node.borrow().data` [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: redundant field names in struct initialization [INFO] [stdout] --> src/bin/ch07p02.rs:87:13 [INFO] [stdout] | [INFO] [stdout] 87 | rank: rank, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `rank` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `complete_call` and `escalate` are never used [INFO] [stdout] --> src/bin/ch07p02.rs:29:8 [INFO] [stdout] | [INFO] [stdout] 27 | trait Employee { [INFO] [stdout] | -------- methods in this trait [INFO] [stdout] 28 | fn receive_call(&mut self, call: &Call); [INFO] [stdout] 29 | fn complete_call(&mut self, call: &mut Call); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] 30 | fn escalate(&mut self, call: &mut Call); [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `completed` is never read [INFO] [stdout] --> src/bin/ch07p02.rs:38:5 [INFO] [stdout] | [INFO] [stdout] 36 | struct Call { [INFO] [stdout] | ---- field in this struct [INFO] [stdout] 37 | rank: Rank, [INFO] [stdout] 38 | completed: bool, [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Call` has derived impls for the traits `Debug` and `Clone`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `&Box`. Consider using just `&T` [INFO] [stdout] --> src/bin/ch07p02.rs:71:59 [INFO] [stdout] | [INFO] [stdout] 71 | fn get_handler_for_call(&self, call: &Call) -> Option<&Box>> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&RefCell` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrowed_box [INFO] [stdout] = note: `#[warn(clippy::borrowed_box)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/ch05p08.rs:8:22 [INFO] [stdout] | [INFO] [stdout] 8 | fn draw_line(screen: &mut Vec, width: usize, x1: usize, x2: usize, y: usize) { [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] 8 - fn draw_line(screen: &mut Vec, width: usize, x1: usize, x2: usize, y: usize) { [INFO] [stdout] 8 + fn draw_line(screen: &mut [u8], width: usize, x1: usize, x2: usize, y: usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `&Box`. Consider using just `&T` [INFO] [stdout] --> src/bin/ch07p02.rs:82:51 [INFO] [stdout] | [INFO] [stdout] 82 | fn dispatch_call(&self, call: &Call, handler: &Box>) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&RefCell` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrowed_box [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/ch07p02.rs:83:43 [INFO] [stdout] | [INFO] [stdout] 83 | handler.borrow_mut().receive_call(&call) [INFO] [stdout] | ^^^^^ help: change this to: `call` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` 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/bin/ch07p02.rs:104:43 [INFO] [stdout] | [INFO] [stdout] 104 | self.dispatch_call(&call, &handler); [INFO] [stdout] | ^^^^^^^^ help: change this to: `handler` [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: redundant field names in struct initialization [INFO] [stdout] --> src/bin/ch07p01.rs:79:13 [INFO] [stdout] | [INFO] [stdout] 79 | suit: suit, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `suit` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/bin/ch07p01.rs:80:13 [INFO] [stdout] | [INFO] [stdout] 80 | rank: rank, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `rank` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/bin/ch07p01.rs:104:13 [INFO] [stdout] | [INFO] [stdout] 104 | cards: cards, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `cards` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/bin/ch07p01.rs:125:13 [INFO] [stdout] | [INFO] [stdout] 125 | cards: cards, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `cards` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: items after a test module [INFO] [stdout] --> src/bin/ch08p01.rs:25:1 [INFO] [stdout] | [INFO] [stdout] 25 | mod tests { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 36 | fn main() { [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: items after a test module [INFO] [stdout] --> src/bin/ch02p05.rs:38:1 [INFO] [stdout] | [INFO] [stdout] 38 | mod tests { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 61 | fn main() { [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: the variable `digit` is used as a loop counter [INFO] [stdout] --> src/bin/ch02p05.rs:24:5 [INFO] [stdout] | [INFO] [stdout] 24 | for node in list.iter() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (digit, node) in list.iter().enumerate()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] = note: `#[warn(clippy::explicit_counter_loop)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `i32` which implements the `Copy` trait [INFO] [stdout] --> src/bin/ch02p05.rs:25:17 [INFO] [stdout] | [INFO] [stdout] 25 | let v = node.borrow().data.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `node.borrow().data` [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: variable does not need to be mutable [INFO] [stdout] --> src/bin/ch07p01.rs:91:13 [INFO] [stdout] | [INFO] [stdout] 91 | let mut value = 0; [INFO] [stdout] | ----^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/bin/ch07p01.rs:108:13 [INFO] [stdout] | [INFO] [stdout] 108 | let mut score = 0; [INFO] [stdout] | ----^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: items after a test module [INFO] [stdout] --> src/bin/ch01p09.rs:21:1 [INFO] [stdout] | [INFO] [stdout] 21 | mod tests { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 32 | fn main() { [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: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/bin/ch01p09.rs:25:9 [INFO] [stdout] | [INFO] [stdout] 25 | assert_eq!(is_strs_rotation(&String::from("abc"), &String::from("cab")), 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] 25 - assert_eq!(is_strs_rotation(&String::from("abc"), &String::from("cab")), true); [INFO] [stdout] 25 + assert!(is_strs_rotation(&String::from("abc"), &String::from("cab"))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `card` [INFO] [stdout] --> src/bin/ch07p01.rs:112:28 [INFO] [stdout] | [INFO] [stdout] 112 | fn add_card(&mut self, card: BlackJackCard) { [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_card` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/bin/ch07p01.rs:136:13 [INFO] [stdout] | [INFO] [stdout] 136 | let mut hand: Vec = vec![]; [INFO] [stdout] | ----^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/bin/ch01p09.rs:26:9 [INFO] [stdout] | [INFO] [stdout] 26 | assert_eq!(is_strs_rotation(&String::from("abc"), &String::from("bac")), 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] 26 - assert_eq!(is_strs_rotation(&String::from("abc"), &String::from("bac")), false); [INFO] [stdout] 26 + assert!(!is_strs_rotation(&String::from("abc"), &String::from("bac"))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait `Card` is never used [INFO] [stdout] --> src/bin/ch07p01.rs:50:7 [INFO] [stdout] | [INFO] [stdout] 50 | trait Card { [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait `Deck` is never used [INFO] [stdout] --> src/bin/ch07p01.rs:55:7 [INFO] [stdout] | [INFO] [stdout] 55 | trait Deck { [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/bin/ch01p09.rs:27:9 [INFO] [stdout] | [INFO] [stdout] 27 | assert_eq!(is_strs_rotation(&String::from("abcdebcade"), &String::from("deabcdebca")), 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] 27 - assert_eq!(is_strs_rotation(&String::from("abcdebcade"), &String::from("deabcdebca")), true); [INFO] [stdout] 27 + assert!(is_strs_rotation(&String::from("abcdebcade"), &String::from("deabcdebca"))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait `Hand` is never used [INFO] [stdout] --> src/bin/ch07p01.rs:63:7 [INFO] [stdout] | [INFO] [stdout] 63 | trait Hand { [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `suit`, `rank`, and `available` are never read [INFO] [stdout] --> src/bin/ch07p01.rs:71:5 [INFO] [stdout] | [INFO] [stdout] 70 | struct BlackJackCard { [INFO] [stdout] | ------------- fields in this struct [INFO] [stdout] 71 | suit: Suit, [INFO] [stdout] | ^^^^ [INFO] [stdout] 72 | rank: Rank, [INFO] [stdout] | ^^^^ [INFO] [stdout] 73 | available: bool, [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `BlackJackCard` has derived impls for the traits `Debug` and `Clone`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `BlackJackHand` is never constructed [INFO] [stdout] --> src/bin/ch07p01.rs:97:8 [INFO] [stdout] | [INFO] [stdout] 97 | struct BlackJackHand { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `BlackJackDeck` is never constructed [INFO] [stdout] --> src/bin/ch07p01.rs:117:8 [INFO] [stdout] | [INFO] [stdout] 117 | struct BlackJackDeck { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/bin/ch01p09.rs:28:9 [INFO] [stdout] | [INFO] [stdout] 28 | assert_eq!(is_strs_rotation(&String::from("abcdebcadea"), &String::from("debabcdebca")), 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] 28 - assert_eq!(is_strs_rotation(&String::from("abcdebcadea"), &String::from("debabcdebca")), false); [INFO] [stdout] 28 + assert!(!is_strs_rotation(&String::from("abcdebcadea"), &String::from("debabcdebca"))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/bin/ch07p01.rs:92:9 [INFO] [stdout] | [INFO] [stdout] 91 | let mut value = 0; [INFO] [stdout] | ------------------ unnecessary `let` binding [INFO] [stdout] 92 | value [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 91 ~ [INFO] [stdout] 92 ~ 0 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: items after a test module [INFO] [stdout] --> src/bin/ch05p02.rs:25:1 [INFO] [stdout] | [INFO] [stdout] 25 | mod tests { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 37 | fn main() { [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: items after a test module [INFO] [stdout] --> src/bin/ch01p03.rs:53:1 [INFO] [stdout] | [INFO] [stdout] 53 | mod tests { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 62 | fn main() { [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: the function `urlify` doesn't need a mutable reference [INFO] [stdout] --> src/bin/ch01p03.rs:57:27 [INFO] [stdout] | [INFO] [stdout] 57 | assert_eq!(urlify(&mut String::from("Mr John Smith ")), "Mr%20John%20Smith"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed [INFO] [stdout] = note: `#[warn(clippy::unnecessary_mut_passed)]` on by default [INFO] [stdout] help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] 57 - assert_eq!(urlify(&mut String::from("Mr John Smith ")), "Mr%20John%20Smith"); [INFO] [stdout] 57 + assert_eq!(urlify(&String::from("Mr John Smith ")), "Mr%20John%20Smith"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the function `urlify_fold` doesn't need a mutable reference [INFO] [stdout] --> src/bin/ch01p03.rs:59:32 [INFO] [stdout] | [INFO] [stdout] 59 | assert_eq!(urlify_fold(&mut String::from("Mr John Smith ")), "Mr%20John%20Smith"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed [INFO] [stdout] help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] 59 - assert_eq!(urlify_fold(&mut String::from("Mr John Smith ")), "Mr%20John%20Smith"); [INFO] [stdout] 59 + assert_eq!(urlify_fold(&String::from("Mr John Smith ")), "Mr%20John%20Smith"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the function `urlify` doesn't need a mutable reference [INFO] [stdout] --> src/bin/ch01p03.rs:63:12 [INFO] [stdout] | [INFO] [stdout] 63 | urlify(&mut String::from("Mr John Smith ")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed [INFO] [stdout] help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] 63 - urlify(&mut String::from("Mr John Smith ")); [INFO] [stdout] 63 + urlify(&String::from("Mr John Smith ")); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the function `urlify_fold` doesn't need a mutable reference [INFO] [stdout] --> src/bin/ch01p03.rs:65:17 [INFO] [stdout] | [INFO] [stdout] 65 | urlify_fold(&mut String::from("Mr John Smith ")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed [INFO] [stdout] help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] 65 - urlify_fold(&mut String::from("Mr John Smith ")); [INFO] [stdout] 65 + urlify_fold(&String::from("Mr John Smith ")); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/bin/ch10p02.rs:13:18 [INFO] [stdout] | [INFO] [stdout] 13 | fn sort_chars(s: &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] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 13 - fn sort_chars(s: &String) -> String { [INFO] [stdout] 13 + fn sort_chars(s: &str) -> String { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/bin/ch07p02.rs:87:13 [INFO] [stdout] | [INFO] [stdout] 87 | rank: rank, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `rank` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: items after a test module [INFO] [stdout] --> src/bin/ch05p06.rs:21:1 [INFO] [stdout] | [INFO] [stdout] 21 | mod tests { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 30 | fn main() { [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: items after a test module [INFO] [stdout] --> src/bin/ch08p12.rs:41:1 [INFO] [stdout] | [INFO] [stdout] 41 | mod tests { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 53 | fn main() { [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: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/ch08p12.rs:9:25 [INFO] [stdout] | [INFO] [stdout] 9 | fn check_valid(columns: &mut Vec, row1: usize, column1: usize) -> bool { [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] 9 - fn check_valid(columns: &mut Vec, row1: usize, column1: usize) -> bool { [INFO] [stdout] 9 + fn check_valid(columns: &mut [usize], row1: usize, column1: usize) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting the result of `i64::abs()` to usize [INFO] [stdout] --> src/bin/ch08p12.rs:17:31 [INFO] [stdout] | [INFO] [stdout] 17 | let column_distance = ((*column2 as i64) - (column1 as i64)).abs() as usize; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `((*column2 as i64) - (column1 as i64)).unsigned_abs()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_abs_to_unsigned [INFO] [stdout] = note: `#[warn(clippy::cast_abs_to_unsigned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `complete_call` and `escalate` are never used [INFO] [stdout] --> src/bin/ch07p02.rs:29:8 [INFO] [stdout] | [INFO] [stdout] 27 | trait Employee { [INFO] [stdout] | -------- methods in this trait [INFO] [stdout] 28 | fn receive_call(&mut self, call: &Call); [INFO] [stdout] 29 | fn complete_call(&mut self, call: &mut Call); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] 30 | fn escalate(&mut self, call: &mut Call); [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `completed` is never read [INFO] [stdout] --> src/bin/ch07p02.rs:38:5 [INFO] [stdout] | [INFO] [stdout] 36 | struct Call { [INFO] [stdout] | ---- field in this struct [INFO] [stdout] 37 | rank: Rank, [INFO] [stdout] 38 | completed: bool, [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Call` has derived impls for the traits `Debug` and `Clone`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `&Box`. Consider using just `&T` [INFO] [stdout] --> src/bin/ch07p02.rs:71:59 [INFO] [stdout] | [INFO] [stdout] 71 | fn get_handler_for_call(&self, call: &Call) -> Option<&Box>> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&RefCell` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrowed_box [INFO] [stdout] = note: `#[warn(clippy::borrowed_box)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `&Box`. Consider using just `&T` [INFO] [stdout] --> src/bin/ch07p02.rs:82:51 [INFO] [stdout] | [INFO] [stdout] 82 | fn dispatch_call(&self, call: &Call, handler: &Box>) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&RefCell` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrowed_box [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/ch07p02.rs:83:43 [INFO] [stdout] | [INFO] [stdout] 83 | handler.borrow_mut().receive_call(&call) [INFO] [stdout] | ^^^^^ help: change this to: `call` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` 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/bin/ch07p02.rs:104:43 [INFO] [stdout] | [INFO] [stdout] 104 | self.dispatch_call(&call, &handler); [INFO] [stdout] | ^^^^^^^^ help: change this to: `handler` [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: items after a test module [INFO] [stdout] --> src/bin/ch10p01.rs:28:1 [INFO] [stdout] | [INFO] [stdout] 28 | mod tests { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 39 | fn main() { [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: items after a test module [INFO] [stdout] --> src/bin/ch02p06.rs:21:1 [INFO] [stdout] | [INFO] [stdout] 21 | mod tests { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 59 | fn main() { [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: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/bin/ch02p06.rs:32:9 [INFO] [stdout] | [INFO] [stdout] 32 | assert_eq!(is_palindrome(list1), 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] 32 - assert_eq!(is_palindrome(list1), true); [INFO] [stdout] 32 + assert!(is_palindrome(list1)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/bin/ch02p06.rs:41:9 [INFO] [stdout] | [INFO] [stdout] 41 | assert_eq!(is_palindrome(list2), 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] 41 - assert_eq!(is_palindrome(list2), false); [INFO] [stdout] 41 + assert!(!is_palindrome(list2)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/bin/ch02p06.rs:48:9 [INFO] [stdout] | [INFO] [stdout] 48 | assert_eq!(is_palindrome(list3), 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] 48 - assert_eq!(is_palindrome(list3), true); [INFO] [stdout] 48 + assert!(is_palindrome(list3)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/bin/ch02p06.rs:55:9 [INFO] [stdout] | [INFO] [stdout] 55 | assert_eq!(is_palindrome(list4), 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] 55 - assert_eq!(is_palindrome(list4), false); [INFO] [stdout] 55 + assert!(!is_palindrome(list4)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: items after a test module [INFO] [stdout] --> src/bin/ch01p08.rs:38:1 [INFO] [stdout] | [INFO] [stdout] 38 | mod tests { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 61 | fn main() { [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: length comparison to one [INFO] [stdout] --> src/bin/ch01p08.rs:8:8 [INFO] [stdout] | [INFO] [stdout] 8 | if matrix.len() < 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `matrix.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 `col` is used to index `matrix` [INFO] [stdout] --> src/bin/ch01p08.rs:17:20 [INFO] [stdout] | [INFO] [stdout] 17 | for col in 0..matrix[0].len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 17 - for col in 0..matrix[0].len() { [INFO] [stdout] 17 + for (col, ) in matrix.iter().enumerate().take(matrix[0].len()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `matrix` [INFO] [stdout] --> src/bin/ch01p08.rs:30:18 [INFO] [stdout] | [INFO] [stdout] 30 | for i in 0..matrix.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] 30 - for i in 0..matrix.len() { [INFO] [stdout] 30 + for in &mut matrix { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/bin/ch04p02.rs:10:9 [INFO] [stdout] | [INFO] [stdout] 10 | let mut mbst = MinimalBinarySearchTree::::new(&arr); [INFO] [stdout] | ----^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `node` after checking its variant with `is_some` [INFO] [stdout] --> src/bin/ch04p02.rs:13:29 [INFO] [stdout] | [INFO] [stdout] 12 | if node.is_some() { [INFO] [stdout] | ----------------- help: try: `if let Some() = node` [INFO] [stdout] 13 | let some_node = node.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/ch08p12.rs:9:25 [INFO] [stdout] | [INFO] [stdout] 9 | fn check_valid(columns: &mut Vec, row1: usize, column1: usize) -> bool { [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] 9 - fn check_valid(columns: &mut Vec, row1: usize, column1: usize) -> bool { [INFO] [stdout] 9 + fn check_valid(columns: &mut [usize], row1: usize, column1: usize) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting the result of `i64::abs()` to usize [INFO] [stdout] --> src/bin/ch08p12.rs:17:31 [INFO] [stdout] | [INFO] [stdout] 17 | let column_distance = ((*column2 as i64) - (column1 as i64)).abs() as usize; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `((*column2 as i64) - (column1 as i64)).unsigned_abs()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_abs_to_unsigned [INFO] [stdout] = note: `#[warn(clippy::cast_abs_to_unsigned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary operation [INFO] [stdout] --> src/bin/ch02p03.rs:19:13 [INFO] [stdout] | [INFO] [stdout] 19 | &node.borrow_mut().remove(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `node.borrow_mut().remove();` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_operation [INFO] [stdout] = note: `#[warn(clippy::unnecessary_operation)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused borrow that must be used [INFO] [stdout] --> src/bin/ch02p03.rs:19:13 [INFO] [stdout] | [INFO] [stdout] 19 | &node.borrow_mut().remove(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the borrow produces a value [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_must_use)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: use `let _ = ...` to ignore the resulting value [INFO] [stdout] | [INFO] [stdout] 19 | let _ = &node.borrow_mut().remove(); [INFO] [stdout] | +++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: items after a test module [INFO] [stdout] --> src/bin/ch01p06.rs:60:1 [INFO] [stdout] | [INFO] [stdout] 60 | mod tests { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 80 | fn main() { [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: usage of `&String::from("")` for a function expecting a `&str` argument [INFO] [stdout] --> src/bin/ch01p06.rs:68:46 [INFO] [stdout] | [INFO] [stdout] 68 | assert_eq!(str_compression_with_fold(&String::from("")), String::from("")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `""` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_owned_empty_strings [INFO] [stdout] = note: `#[warn(clippy::unnecessary_owned_empty_strings)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of `&String::from("")` for a function expecting a `&str` argument [INFO] [stdout] --> src/bin/ch01p06.rs:76:36 [INFO] [stdout] | [INFO] [stdout] 76 | assert_eq!(str_compression(&String::from("")), String::from("")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `""` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_owned_empty_strings [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: items after a test module [INFO] [stdout] --> src/bin/ch10p02.rs:44:1 [INFO] [stdout] | [INFO] [stdout] 44 | mod tests { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 78 | fn main() { [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: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/bin/ch10p02.rs:13:18 [INFO] [stdout] | [INFO] [stdout] 13 | fn sort_chars(s: &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] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 13 - fn sort_chars(s: &String) -> String { [INFO] [stdout] 13 + fn sort_chars(s: &str) -> String { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: items after a test module [INFO] [stdout] --> src/bin/ch01p02.rs:27:1 [INFO] [stdout] | [INFO] [stdout] 27 | mod tests { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 40 | fn main(){ [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: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/bin/ch01p02.rs:31:9 [INFO] [stdout] | [INFO] [stdout] 31 | assert_eq!(are_two_strs_in_the_same_combination(&String::from("A cdēe"), &String::from("A cdēe")), 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] 31 - assert_eq!(are_two_strs_in_the_same_combination(&String::from("A cdēe"), &String::from("A cdēe")), true); [INFO] [stdout] 31 + assert!(are_two_strs_in_the_same_combination(&String::from("A cdēe"), &String::from("A cdēe"))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/bin/ch01p02.rs:32:9 [INFO] [stdout] | [INFO] [stdout] 32 | assert_eq!(are_two_strs_in_the_same_combination(&String::from("abcdee"), &String::from("abcdeea")), 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] 32 - assert_eq!(are_two_strs_in_the_same_combination(&String::from("abcdee"), &String::from("abcdeea")), false); [INFO] [stdout] 32 + assert!(!are_two_strs_in_the_same_combination(&String::from("abcdee"), &String::from("abcdeea"))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/bin/ch01p02.rs:33:9 [INFO] [stdout] | [INFO] [stdout] 33 | assert_eq!(are_two_strs_in_the_same_combination(&String::from("abcdee"), &String::from("awcdee")), 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] 33 - assert_eq!(are_two_strs_in_the_same_combination(&String::from("abcdee"), &String::from("awcdee")), false); [INFO] [stdout] 33 + assert!(!are_two_strs_in_the_same_combination(&String::from("abcdee"), &String::from("awcdee"))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/bin/ch01p02.rs:34:9 [INFO] [stdout] | [INFO] [stdout] 34 | assert_eq!(are_two_strs_in_the_same_combination(&String::from("abcdeē"), &String::from("abcdee")), 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] 34 - assert_eq!(are_two_strs_in_the_same_combination(&String::from("abcdeē"), &String::from("abcdee")), false); [INFO] [stdout] 34 + assert!(!are_two_strs_in_the_same_combination(&String::from("abcdeē"), &String::from("abcdee"))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/bin/ch01p02.rs:35:9 [INFO] [stdout] | [INFO] [stdout] 35 | assert_eq!(are_two_strs_in_the_same_combination(&String::from("Abcde"), &String::from("abcde")), 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] 35 - assert_eq!(are_two_strs_in_the_same_combination(&String::from("Abcde"), &String::from("abcde")), false); [INFO] [stdout] 35 + assert!(!are_two_strs_in_the_same_combination(&String::from("Abcde"), &String::from("abcde"))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/bin/ch01p02.rs:36:9 [INFO] [stdout] | [INFO] [stdout] 36 | assert_eq!(are_two_strs_in_the_same_combination(&String::from("abcde "), &String::from("abcde")), 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] 36 - assert_eq!(are_two_strs_in_the_same_combination(&String::from("abcde "), &String::from("abcde")), false); [INFO] [stdout] 36 + assert!(!are_two_strs_in_the_same_combination(&String::from("abcde "), &String::from("abcde"))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 2.76s [INFO] running `Command { std: "docker" "inspect" "50a6e5880cee264f6ae6742ca2f95404666eb3efc4fba8f104bfc904cbc89955", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "50a6e5880cee264f6ae6742ca2f95404666eb3efc4fba8f104bfc904cbc89955", kill_on_drop: false }` [INFO] [stdout] 50a6e5880cee264f6ae6742ca2f95404666eb3efc4fba8f104bfc904cbc89955