[INFO] cloning repository https://github.com/shiinazuki/study [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/shiinazuki/study" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fshiinazuki%2Fstudy", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fshiinazuki%2Fstudy'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 691165d60e4d1ed8cffd7da5600384af829a6aaf [INFO] linting shiinazuki/study/691165d60e4d1ed8cffd7da5600384af829a6aaf against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fshiinazuki%2Fstudy" "/workspace/builds/worker-0-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-0-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/shiinazuki/study [INFO] finished tweaking git repo https://github.com/shiinazuki/study [INFO] tweaked toml for git repo https://github.com/shiinazuki/study written to /workspace/builds/worker-0-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/shiinazuki/study 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/shiinazuki/study already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] 0dd4938e0f97c3903a6412399f1b7a69270f5f09877169f8ff9c5ff0d8f84081 [INFO] running `Command { std: "docker" "start" "-a" "0dd4938e0f97c3903a6412399f1b7a69270f5f09877169f8ff9c5ff0d8f84081", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "0dd4938e0f97c3903a6412399f1b7a69270f5f09877169f8ff9c5ff0d8f84081", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "0dd4938e0f97c3903a6412399f1b7a69270f5f09877169f8ff9c5ff0d8f84081", kill_on_drop: false }` [INFO] [stdout] 0dd4938e0f97c3903a6412399f1b7a69270f5f09877169f8ff9c5ff0d8f84081 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "clippy" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 0e583ac1fe0abc3e7136ac09f420544f46be5130553ddbc676981ad63105b84f [INFO] running `Command { std: "docker" "start" "-a" "0e583ac1fe0abc3e7136ac09f420544f46be5130553ddbc676981ad63105b84f", kill_on_drop: false }` [INFO] [stderr] Compiling proc-macro2 v1.0.86 [INFO] [stderr] Checking chapt8_collections v0.1.0 (/opt/rustwide/workdir/chapt8_collections) [INFO] [stderr] Checking chapt17_rust_object v0.1.0 (/opt/rustwide/workdir/chapt17_rust_object) [INFO] [stderr] Checking chapt20_web_server v0.1.0 (/opt/rustwide/workdir/chapt20_web_server) [INFO] [stderr] Checking chapt12_io_item v0.1.0 (/opt/rustwide/workdir/chapt12_io_item) [INFO] [stderr] Checking chapt11_test v0.1.0 (/opt/rustwide/workdir/chapt11_test) [INFO] [stderr] Checking chapt10_trait v0.1.0 (/opt/rustwide/workdir/chapt10_trait) [INFO] [stderr] Checking chapt14_cargo v0.1.0 (/opt/rustwide/workdir/chapt14_cargo) [INFO] [stderr] Checking chapt16_concurrent_program v0.1.0 (/opt/rustwide/workdir/chapt16_concurrent_program) [INFO] [stderr] Checking chapt4_ownership v0.1.0 (/opt/rustwide/workdir/chapt4_ownership) [INFO] [stderr] Checking chapt9_error v0.1.0 (/opt/rustwide/workdir/chapt9_error) [INFO] [stderr] Compiling libc v0.2.155 [INFO] [stderr] Checking a_standard v0.1.0 (/opt/rustwide/workdir/a_standard) [INFO] [stdout] warning: unused variable: `name` [INFO] [stdout] --> chapt11_test/src/lib.rs:32:17 [INFO] [stdout] | [INFO] [stdout] 32 | pub fn greeting(name: &str) -> String { [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_name` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Rectangle` is never constructed [INFO] [stdout] --> chapt11_test/src/lib.rs:13:8 [INFO] [stdout] | [INFO] [stdout] 13 | struct Rectangle { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `can_hold` is never used [INFO] [stdout] --> chapt11_test/src/lib.rs:19:8 [INFO] [stdout] | [INFO] [stdout] 18 | impl Rectangle { [INFO] [stdout] | -------------- method in this implementation [INFO] [stdout] 19 | fn can_hold(&self, other: &Rectangle) -> bool { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Guess` is never constructed [INFO] [stdout] --> chapt11_test/src/lib.rs:36:8 [INFO] [stdout] | [INFO] [stdout] 36 | struct Guess { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> chapt11_test/src/lib.rs:41:12 [INFO] [stdout] | [INFO] [stdout] 40 | impl Guess { [INFO] [stdout] | ---------- associated function in this implementation [INFO] [stdout] 41 | pub fn new(value: i32) -> Guess { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> chapt11_test/src/lib.rs:33:5 [INFO] [stdout] | [INFO] [stdout] 33 | format!("Hello!") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Hello!".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `t` [INFO] [stdout] --> chapt10_trait/src/bin/trait.rs:100:57 [INFO] [stdout] | [INFO] [stdout] 100 | fn _some_function(t: &T, u: &U) -> i32 { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_t` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `u` [INFO] [stdout] --> chapt10_trait/src/bin/trait.rs:100:64 [INFO] [stdout] | [INFO] [stdout] 100 | fn _some_function(t: &T, u: &U) -> i32 { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_u` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `t` [INFO] [stdout] --> chapt10_trait/src/bin/trait.rs:103:31 [INFO] [stdout] | [INFO] [stdout] 103 | fn _some_function_siple(t: &T, u: &U) -> i32 [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_t` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `u` [INFO] [stdout] --> chapt10_trait/src/bin/trait.rs:103:38 [INFO] [stdout] | [INFO] [stdout] 103 | fn _some_function_siple(t: &T, u: &U) -> i32 [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_u` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `summary` [INFO] [stdout] --> chapt10_trait/src/bin/trait.rs:114:17 [INFO] [stdout] | [INFO] [stdout] 114 | fn _notify_more(summary: &(impl Summary + Display)) {} [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_summary` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `summary` [INFO] [stdout] --> chapt10_trait/src/bin/trait.rs:116:45 [INFO] [stdout] | [INFO] [stdout] 116 | fn _notify_more_bound(summary: &T) {} [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_summary` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `summary1` [INFO] [stdout] --> chapt10_trait/src/bin/trait.rs:127:19 [INFO] [stdout] | [INFO] [stdout] 127 | fn _notify_second(summary1: &impl Summary, summary2: &impl Summary) {} [INFO] [stdout] | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_summary1` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `summary2` [INFO] [stdout] --> chapt10_trait/src/bin/trait.rs:127:44 [INFO] [stdout] | [INFO] [stdout] 127 | fn _notify_second(summary1: &impl Summary, summary2: &impl Summary) {} [INFO] [stdout] | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_summary2` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `summary1` [INFO] [stdout] --> chapt10_trait/src/bin/trait.rs:131:29 [INFO] [stdout] | [INFO] [stdout] 131 | fn _notify_same(summary1: &T, summary2: &T) {} [INFO] [stdout] | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_summary1` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `summary2` [INFO] [stdout] --> chapt10_trait/src/bin/trait.rs:131:43 [INFO] [stdout] | [INFO] [stdout] 131 | fn _notify_same(summary1: &T, summary2: &T) {} [INFO] [stdout] | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_summary2` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Pair` is never constructed [INFO] [stdout] --> chapt10_trait/src/bin/trait.rs:38:8 [INFO] [stdout] | [INFO] [stdout] 38 | struct Pair { [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> chapt10_trait/src/bin/trait.rs:45:8 [INFO] [stdout] | [INFO] [stdout] 44 | impl Pair { [INFO] [stdout] | --------------- associated function in this implementation [INFO] [stdout] 45 | fn new(x: T, y: T) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `cmp_display` is never used [INFO] [stdout] --> chapt10_trait/src/bin/trait.rs:52:8 [INFO] [stdout] | [INFO] [stdout] 51 | impl Pair { [INFO] [stdout] | ------------------------------------- method in this implementation [INFO] [stdout] 52 | fn cmp_display(&self) { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `returns_summarizable` is never used [INFO] [stdout] --> chapt10_trait/src/bin/trait.rs:90:4 [INFO] [stdout] | [INFO] [stdout] 90 | fn returns_summarizable() -> impl Summary { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `content` is never read [INFO] [stdout] --> chapt10_trait/src/bin/trait.rs:158:5 [INFO] [stdout] | [INFO] [stdout] 154 | struct NewsArticle { [INFO] [stdout] | ----------- field in this struct [INFO] [stdout] ... [INFO] [stdout] 158 | content: String, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `reply` and `retweet` are never read [INFO] [stdout] --> chapt10_trait/src/bin/trait.rs:174:5 [INFO] [stdout] | [INFO] [stdout] 171 | struct Tweet { [INFO] [stdout] | ----- fields in this struct [INFO] [stdout] ... [INFO] [stdout] 174 | reply: bool, [INFO] [stdout] | ^^^^^ [INFO] [stdout] 175 | retweet: bool, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `post` [INFO] [stdout] --> chapt17_rust_object/src/lib.rs:100:31 [INFO] [stdout] | [INFO] [stdout] 100 | fn content<'a>(&self, post: &'a Post) -> &'a str { [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_post` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods called `new` usually return `Self` [INFO] [stdout] --> chapt17_rust_object/src/lib.rs:7:9 [INFO] [stdout] | [INFO] [stdout] 7 | / pub fn new() -> DraftPost { [INFO] [stdout] 8 | | DraftPost { [INFO] [stdout] 9 | | content: String::new(), [INFO] [stdout] 10 | | } [INFO] [stdout] 11 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_ret_no_self [INFO] [stdout] = note: `#[warn(clippy::new_ret_no_self)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Post` [INFO] [stdout] --> chapt17_rust_object/src/lib.rs:55:9 [INFO] [stdout] | [INFO] [stdout] 55 | / pub fn new() -> Post { [INFO] [stdout] 56 | | Post { [INFO] [stdout] 57 | | state: Some(Box::new(Draft {})), [INFO] [stdout] 58 | | content: String::new(), [INFO] [stdout] 59 | | } [INFO] [stdout] 60 | | } [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] 54 ~ impl Default for Post { [INFO] [stdout] 55 + fn default() -> Self { [INFO] [stdout] 56 + Self::new() [INFO] [stdout] 57 + } [INFO] [stdout] 58 + } [INFO] [stdout] 59 + [INFO] [stdout] 60 ~ impl Post { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> chapt8_collections/src/vect.rs:19:9 [INFO] [stdout] | [INFO] [stdout] 19 | let mut v = vec![1, 2, 3, 4, 5, 6, 7, 8, 9]; [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] --> chapt8_collections/src/vect.rs:30:9 [INFO] [stdout] | [INFO] [stdout] 30 | let mut v = vec![1, 2, 3, 4, 5, 6]; [INFO] [stdout] | ----^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `v` [INFO] [stdout] --> chapt8_collections/src/vect.rs:2:9 [INFO] [stdout] | [INFO] [stdout] 2 | let v: Vec = Vec::new(); [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_v` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `0` is never read [INFO] [stdout] --> chapt8_collections/src/vect.rs:57:9 [INFO] [stdout] | [INFO] [stdout] 57 | Int(i32), [INFO] [stdout] | --- ^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `SpreadsheetCell` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 57 - Int(i32), [INFO] [stdout] 57 + Int(()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary braces around function argument [INFO] [stdout] --> chapt17_rust_object/src/bin/trait.rs:7:37 [INFO] [stdout] | [INFO] [stdout] 7 | label: String::from({ "Ok" }), [INFO] [stdout] | ^^ ^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_braces)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: remove these braces [INFO] [stdout] | [INFO] [stdout] 7 - label: String::from({ "Ok" }), [INFO] [stdout] 7 + label: String::from("Ok" ), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `0` is never read [INFO] [stdout] --> chapt8_collections/src/vect.rs:58:11 [INFO] [stdout] | [INFO] [stdout] 58 | Float(f64), [INFO] [stdout] | ----- ^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `SpreadsheetCell` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 58 - Float(f64), [INFO] [stdout] 58 + Float(()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: type `Screen_Two` should have an upper camel case name [INFO] [stdout] --> chapt17_rust_object/src/bin/trait.rs:74:12 [INFO] [stdout] | [INFO] [stdout] 74 | pub struct Screen_Two { [INFO] [stdout] | ^^^^^^^^^^ help: convert the identifier to upper camel case: `ScreenTwo` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(non_camel_case_types)]` (part of `#[warn(nonstandard_style)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `0` is never read [INFO] [stdout] --> chapt8_collections/src/vect.rs:59:10 [INFO] [stdout] | [INFO] [stdout] 59 | Text(String), [INFO] [stdout] | ---- ^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `SpreadsheetCell` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 59 - Text(String), [INFO] [stdout] 59 + Text(()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calls to `push` immediately after creation [INFO] [stdout] --> chapt8_collections/src/vect.rs:11:5 [INFO] [stdout] | [INFO] [stdout] 11 | / let mut v = Vec::new(); [INFO] [stdout] 12 | | v.push(5); [INFO] [stdout] 13 | | v.push(6); [INFO] [stdout] 14 | | v.push(7); [INFO] [stdout] 15 | | v.push(8); [INFO] [stdout] | |______________^ help: consider using the `vec![]` macro: `let v = vec![..];` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push [INFO] [stdout] = note: `#[warn(clippy::vec_init_then_push)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait `Draw` is more private than the item `Screen::components` [INFO] [stdout] --> chapt17_rust_object/src/bin/trait.rs:59:5 [INFO] [stdout] | [INFO] [stdout] 59 | pub components: Vec>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ field `Screen::components` is reachable at visibility `pub` [INFO] [stdout] | [INFO] [stdout] note: but trait `Draw` is only usable at visibility `pub(crate)` [INFO] [stdout] --> chapt17_rust_object/src/bin/trait.rs:89:1 [INFO] [stdout] | [INFO] [stdout] 89 | trait Draw { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] = note: `#[warn(private_interfaces)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait `Draw` is more private than the item `Screen_Two` [INFO] [stdout] --> chapt17_rust_object/src/bin/trait.rs:74:1 [INFO] [stdout] | [INFO] [stdout] 74 | pub struct Screen_Two { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ struct `Screen_Two` is reachable at visibility `pub` [INFO] [stdout] | [INFO] [stdout] note: but trait `Draw` is only usable at visibility `pub(crate)` [INFO] [stdout] --> chapt17_rust_object/src/bin/trait.rs:89:1 [INFO] [stdout] | [INFO] [stdout] 89 | trait Draw { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] = note: `#[warn(private_bounds)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait `Draw` is more private than the item `Screen_Two` [INFO] [stdout] --> chapt17_rust_object/src/bin/trait.rs:78:1 [INFO] [stdout] | [INFO] [stdout] 78 | / impl Screen_Two [INFO] [stdout] 79 | | where [INFO] [stdout] 80 | | T: Draw, [INFO] [stdout] | |____________^ implementation `Screen_Two` is reachable at visibility `pub` [INFO] [stdout] | [INFO] [stdout] note: but trait `Draw` is only usable at visibility `pub(crate)` [INFO] [stdout] --> chapt17_rust_object/src/bin/trait.rs:89:1 [INFO] [stdout] | [INFO] [stdout] 89 | trait Draw { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert` to construct default value [INFO] [stdout] --> chapt8_collections/src/hashmap.rs:79:51 [INFO] [stdout] | [INFO] [stdout] 79 | let employees = map.entry(department).or_insert(Vec::new()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] = note: `#[warn(clippy::unwrap_or_default)]` 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] --> chapt8_collections/src/hashmap.rs:171:21 [INFO] [stdout] | [INFO] [stdout] 171 | fn bubble_sort(vec: &mut Vec) { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 171 - fn bubble_sort(vec: &mut Vec) { [INFO] [stdout] 171 + fn bubble_sort(vec: &mut [i32]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this looks like you are swapping elements of `vec` manually [INFO] [stdout] --> chapt8_collections/src/hashmap.rs:175:17 [INFO] [stdout] | [INFO] [stdout] 175 | / let temp = vec[j]; [INFO] [stdout] 176 | | vec[j] = vec[j + 1]; [INFO] [stdout] 177 | | vec[j + 1] = temp; [INFO] [stdout] | |__________________________________^ help: try: `vec.swap(j, j + 1);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_swap [INFO] [stdout] = note: `#[warn(clippy::manual_swap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> chapt8_collections/src/vect.rs:5:13 [INFO] [stdout] | [INFO] [stdout] 5 | let v = vec![1, 2, 3]; [INFO] [stdout] | ^^^^^^^^^^^^^ help: you can use an array directly: `[1, 2, 3]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> chapt8_collections/src/vect.rs:30:17 [INFO] [stdout] | [INFO] [stdout] 30 | let mut v = vec![1, 2, 3, 4, 5, 6]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[1, 2, 3, 4, 5, 6]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `t` [INFO] [stdout] --> chapt10_trait/src/bin/trait.rs:100:57 [INFO] [stdout] | [INFO] [stdout] 100 | fn _some_function(t: &T, u: &U) -> i32 { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_t` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `u` [INFO] [stdout] --> chapt10_trait/src/bin/trait.rs:100:64 [INFO] [stdout] | [INFO] [stdout] 100 | fn _some_function(t: &T, u: &U) -> i32 { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_u` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `t` [INFO] [stdout] --> chapt10_trait/src/bin/trait.rs:103:31 [INFO] [stdout] | [INFO] [stdout] 103 | fn _some_function_siple(t: &T, u: &U) -> i32 [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_t` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `u` [INFO] [stdout] --> chapt10_trait/src/bin/trait.rs:103:38 [INFO] [stdout] | [INFO] [stdout] 103 | fn _some_function_siple(t: &T, u: &U) -> i32 [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_u` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `summary` [INFO] [stdout] --> chapt10_trait/src/bin/trait.rs:114:17 [INFO] [stdout] | [INFO] [stdout] 114 | fn _notify_more(summary: &(impl Summary + Display)) {} [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_summary` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `summary` [INFO] [stdout] --> chapt10_trait/src/bin/trait.rs:116:45 [INFO] [stdout] | [INFO] [stdout] 116 | fn _notify_more_bound(summary: &T) {} [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_summary` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `summary1` [INFO] [stdout] --> chapt10_trait/src/bin/trait.rs:127:19 [INFO] [stdout] | [INFO] [stdout] 127 | fn _notify_second(summary1: &impl Summary, summary2: &impl Summary) {} [INFO] [stdout] | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_summary1` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `summary2` [INFO] [stdout] --> chapt10_trait/src/bin/trait.rs:127:44 [INFO] [stdout] | [INFO] [stdout] 127 | fn _notify_second(summary1: &impl Summary, summary2: &impl Summary) {} [INFO] [stdout] | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_summary2` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `summary1` [INFO] [stdout] --> chapt10_trait/src/bin/trait.rs:131:29 [INFO] [stdout] | [INFO] [stdout] 131 | fn _notify_same(summary1: &T, summary2: &T) {} [INFO] [stdout] | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_summary1` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `summary2` [INFO] [stdout] --> chapt10_trait/src/bin/trait.rs:131:43 [INFO] [stdout] | [INFO] [stdout] 131 | fn _notify_same(summary1: &T, summary2: &T) {} [INFO] [stdout] | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_summary2` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Pair` is never constructed [INFO] [stdout] --> chapt10_trait/src/bin/trait.rs:38:8 [INFO] [stdout] | [INFO] [stdout] 38 | struct Pair { [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> chapt10_trait/src/bin/trait.rs:45:8 [INFO] [stdout] | [INFO] [stdout] 44 | impl Pair { [INFO] [stdout] | --------------- associated function in this implementation [INFO] [stdout] 45 | fn new(x: T, y: T) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `cmp_display` is never used [INFO] [stdout] --> chapt10_trait/src/bin/trait.rs:52:8 [INFO] [stdout] | [INFO] [stdout] 51 | impl Pair { [INFO] [stdout] | ------------------------------------- method in this implementation [INFO] [stdout] 52 | fn cmp_display(&self) { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `returns_summarizable` is never used [INFO] [stdout] --> chapt10_trait/src/bin/trait.rs:90:4 [INFO] [stdout] | [INFO] [stdout] 90 | fn returns_summarizable() -> impl Summary { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `content` is never read [INFO] [stdout] --> chapt10_trait/src/bin/trait.rs:158:5 [INFO] [stdout] | [INFO] [stdout] 154 | struct NewsArticle { [INFO] [stdout] | ----------- field in this struct [INFO] [stdout] ... [INFO] [stdout] 158 | content: String, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `reply` and `retweet` are never read [INFO] [stdout] --> chapt10_trait/src/bin/trait.rs:174:5 [INFO] [stdout] | [INFO] [stdout] 171 | struct Tweet { [INFO] [stdout] | ----- fields in this struct [INFO] [stdout] ... [INFO] [stdout] 174 | reply: bool, [INFO] [stdout] | ^^^^^ [INFO] [stdout] 175 | retweet: bool, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `y` [INFO] [stdout] --> chapt10_trait/src/bin/lifetime.rs:146:32 [INFO] [stdout] | [INFO] [stdout] 146 | fn longest_one<'a>(x: &'a str, y: &str) -> &'a str { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_y` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Import` is never constructed [INFO] [stdout] --> chapt10_trait/src/bin/lifetime.rs:103:8 [INFO] [stdout] | [INFO] [stdout] 103 | struct Import<'a> { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `level` and `announce_and_return_part` are never used [INFO] [stdout] --> chapt10_trait/src/bin/lifetime.rs:108:8 [INFO] [stdout] | [INFO] [stdout] 107 | impl<'a, 'b> Import<'a> { [INFO] [stdout] | ----------------------- methods in this implementation [INFO] [stdout] 108 | fn level(&self) -> i32 { [INFO] [stdout] | ^^^^^ [INFO] [stdout] ... [INFO] [stdout] 113 | fn announce_and_return_part(&'a self, announcement: &'b str) -> &'a str { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `part` is never read [INFO] [stdout] --> chapt10_trait/src/bin/lifetime.rs:134:5 [INFO] [stdout] | [INFO] [stdout] 133 | struct ImportantExcerpt<'a> { [INFO] [stdout] | ---------------- field in this struct [INFO] [stdout] 134 | part: &'a str, [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `ImportantExcerpt` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `longest_one` is never used [INFO] [stdout] --> chapt10_trait/src/bin/lifetime.rs:146:4 [INFO] [stdout] | [INFO] [stdout] 146 | fn longest_one<'a>(x: &'a str, y: &str) -> &'a str { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> chapt10_trait/src/bin/lifetime.rs:24:23 [INFO] [stdout] | [INFO] [stdout] 24 | let res = longest(&str1.as_str(), &str2); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `str1.as_str()` [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] --> chapt10_trait/src/bin/lifetime.rs:24:39 [INFO] [stdout] | [INFO] [stdout] 24 | let res = longest(&str1.as_str(), &str2); [INFO] [stdout] | ^^^^^ help: change this to: `str2` [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 following explicit lifetimes could be elided: 'a [INFO] [stdout] --> chapt10_trait/src/bin/lifetime.rs:119:16 [INFO] [stdout] | [INFO] [stdout] 119 | fn _first_word<'a>(s: &'a str) -> &'a str { [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: `#[warn(clippy::needless_lifetimes)]` on by default [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 119 - fn _first_word<'a>(s: &'a str) -> &'a str { [INFO] [stdout] 119 + fn _first_word(s: &str) -> &str { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant slicing of the whole range [INFO] [stdout] --> chapt10_trait/src/bin/lifetime.rs:126:5 [INFO] [stdout] | [INFO] [stdout] 126 | &s[..] [INFO] [stdout] | ^^^^^^ help: use the original value instead: `s` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_slicing [INFO] [stdout] = note: `#[warn(clippy::redundant_slicing)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> chapt4_ownership/src/bin/refbow.rs:60:24 [INFO] [stdout] | [INFO] [stdout] 60 | fn calculate_length(s: &String) -> 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] 60 - fn calculate_length(s: &String) -> usize { [INFO] [stdout] 60 + fn calculate_length(s: &str) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Checking chapt15_smart_pointer v0.1.0 (/opt/rustwide/workdir/chapt15_smart_pointer) [INFO] [stdout] warning: unnecessary braces around function argument [INFO] [stdout] --> chapt17_rust_object/src/bin/trait.rs:7:37 [INFO] [stdout] | [INFO] [stdout] 7 | label: String::from({ "Ok" }), [INFO] [stdout] | ^^ ^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_braces)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: remove these braces [INFO] [stdout] | [INFO] [stdout] 7 - label: String::from({ "Ok" }), [INFO] [stdout] 7 + label: String::from("Ok" ), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: type `Screen_Two` should have an upper camel case name [INFO] [stdout] --> chapt17_rust_object/src/bin/trait.rs:74:12 [INFO] [stdout] | [INFO] [stdout] 74 | pub struct Screen_Two { [INFO] [stdout] | ^^^^^^^^^^ help: convert the identifier to upper camel case: `ScreenTwo` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(non_camel_case_types)]` (part of `#[warn(nonstandard_style)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> a_standard/src/bin/hash.rs:136:9 [INFO] [stdout] | [INFO] [stdout] 136 | *val = *val + 10; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace it with: `*val += 10` [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: trait `Draw` is more private than the item `Screen::components` [INFO] [stdout] --> chapt17_rust_object/src/bin/trait.rs:59:5 [INFO] [stdout] | [INFO] [stdout] 59 | pub components: Vec>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ field `Screen::components` is reachable at visibility `pub` [INFO] [stdout] | [INFO] [stdout] note: but trait `Draw` is only usable at visibility `pub(crate)` [INFO] [stdout] --> chapt17_rust_object/src/bin/trait.rs:89:1 [INFO] [stdout] | [INFO] [stdout] 89 | trait Draw { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] = note: `#[warn(private_interfaces)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait `Draw` is more private than the item `Screen_Two` [INFO] [stdout] --> chapt17_rust_object/src/bin/trait.rs:74:1 [INFO] [stdout] | [INFO] [stdout] 74 | pub struct Screen_Two { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ struct `Screen_Two` is reachable at visibility `pub` [INFO] [stdout] | [INFO] [stdout] note: but trait `Draw` is only usable at visibility `pub(crate)` [INFO] [stdout] --> chapt17_rust_object/src/bin/trait.rs:89:1 [INFO] [stdout] | [INFO] [stdout] 89 | trait Draw { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] = note: `#[warn(private_bounds)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait `Draw` is more private than the item `Screen_Two` [INFO] [stdout] --> chapt17_rust_object/src/bin/trait.rs:78:1 [INFO] [stdout] | [INFO] [stdout] 78 | / impl Screen_Two [INFO] [stdout] 79 | | where [INFO] [stdout] 80 | | T: Draw, [INFO] [stdout] | |____________^ implementation `Screen_Two` is reachable at visibility `pub` [INFO] [stdout] | [INFO] [stdout] note: but trait `Draw` is only usable at visibility `pub(crate)` [INFO] [stdout] --> chapt17_rust_object/src/bin/trait.rs:89:1 [INFO] [stdout] | [INFO] [stdout] 89 | trait Draw { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/hash.rs:279:5 [INFO] [stdout] | [INFO] [stdout] 279 | assert_eq!(map.contains_key(&1), 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] 279 - assert_eq!(map.contains_key(&1), true); [INFO] [stdout] 279 + assert!(map.contains_key(&1)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/hash.rs:280:5 [INFO] [stdout] | [INFO] [stdout] 280 | assert_eq!(map.contains_key(&2), 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] 280 - assert_eq!(map.contains_key(&2), false); [INFO] [stdout] 280 + assert!(!map.contains_key(&2)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/hash.rs:294:5 [INFO] [stdout] | [INFO] [stdout] 294 | assert_eq!(map.is_empty(), 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] 294 - assert_eq!(map.is_empty(), false); [INFO] [stdout] 294 + assert!(!map.is_empty()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Checking chapt6_enum_match v0.1.0 (/opt/rustwide/workdir/chapt6_enum_match) [INFO] [stderr] Checking chapt5_struct v0.1.0 (/opt/rustwide/workdir/chapt5_struct) [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> a_standard/src/bin/str.rs:84:13 [INFO] [stdout] | [INFO] [stdout] 84 | assert!(!v.get(1..).is_none()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `v.get(1..).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] [stderr] Checking chapt13_closures_iterators v0.1.0 (/opt/rustwide/workdir/chapt13_closures_iterators) [INFO] [stdout] warning: this expression always evaluates to true [INFO] [stdout] --> a_standard/src/bin/str.rs:31:13 [INFO] [stdout] | [INFO] [stdout] 31 | assert!(s.is_empty()); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#const_is_empty [INFO] [stdout] = note: `#[warn(clippy::const_is_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression always evaluates to false [INFO] [stdout] --> a_standard/src/bin/str.rs:33:14 [INFO] [stdout] | [INFO] [stdout] 33 | assert!(!s.is_empty()); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#const_is_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> a_standard/src/bin/str.rs:287:33 [INFO] [stdout] | [INFO] [stdout] 287 | assert!(bananas.starts_with(&['b', 'a', 'n', 'a'])); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: change this to: `['b', 'a', 'n', 'a']` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> a_standard/src/bin/str.rs:288:33 [INFO] [stdout] | [INFO] [stdout] 288 | assert!(bananas.starts_with(&['a', 'b', 'c', 'd'])); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: change this to: `['a', 'b', 'c', 'd']` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `kind` and `address` are never read [INFO] [stdout] --> chapt6_enum_match/src/bin/enum.rs:9:5 [INFO] [stdout] | [INFO] [stdout] 8 | struct IpAddr { [INFO] [stdout] | ------ fields in this struct [INFO] [stdout] 9 | kind: IpAddrKind, [INFO] [stdout] | ^^^^ [INFO] [stdout] 10 | address: String, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `IpAddr` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `0` is never read [INFO] [stdout] --> chapt6_enum_match/src/bin/enum.rs:17:8 [INFO] [stdout] | [INFO] [stdout] 17 | V4(String), [INFO] [stdout] | -- ^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `IpAddrNew` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 17 - V4(String), [INFO] [stdout] 17 + V4(()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `0` is never read [INFO] [stdout] --> chapt6_enum_match/src/bin/enum.rs:18:8 [INFO] [stdout] | [INFO] [stdout] 18 | V6(String), [INFO] [stdout] | -- ^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `IpAddrNew` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 18 - V6(String), [INFO] [stdout] 18 + V6(()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `0`, `1`, `2`, and `3` are never read [INFO] [stdout] --> chapt6_enum_match/src/bin/enum.rs:23:8 [INFO] [stdout] | [INFO] [stdout] 23 | V4(u8, u8, u8, u8), [INFO] [stdout] | -- ^^ ^^ ^^ ^^ [INFO] [stdout] | | [INFO] [stdout] | fields in this variant [INFO] [stdout] | [INFO] [stdout] = note: `IpAddrOnther` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] help: consider changing the fields to be of unit type to suppress this warning while preserving the field numbering, or remove the fields [INFO] [stdout] | [INFO] [stdout] 23 - V4(u8, u8, u8, u8), [INFO] [stdout] 23 + V4((), (), (), ()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `0` is never read [INFO] [stdout] --> chapt6_enum_match/src/bin/enum.rs:24:8 [INFO] [stdout] | [INFO] [stdout] 24 | V6(String), [INFO] [stdout] | -- ^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `IpAddrOnther` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 24 - V6(String), [INFO] [stdout] 24 + V6(()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `0` is never read [INFO] [stdout] --> chapt6_enum_match/src/bin/enum.rs:74:11 [INFO] [stdout] | [INFO] [stdout] 74 | Write(String), [INFO] [stdout] | ----- ^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `Message` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 74 - Write(String), [INFO] [stdout] 74 + Write(()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variants `Quit`, `Move`, and `ChangeColor` are never constructed [INFO] [stdout] --> chapt6_enum_match/src/bin/enum.rs:72:5 [INFO] [stdout] | [INFO] [stdout] 71 | enum Message { [INFO] [stdout] | ------- variants in this enum [INFO] [stdout] 72 | Quit, [INFO] [stdout] | ^^^^ [INFO] [stdout] 73 | Move { x: i32, y: i32 }, [INFO] [stdout] | ^^^^ [INFO] [stdout] 74 | Write(String), [INFO] [stdout] 75 | ChangeColor(i32, i32, i32), [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Message` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this manual char comparison can be written more succinctly [INFO] [stdout] --> a_standard/src/bin/str.rs:350:44 [INFO] [stdout] | [INFO] [stdout] 350 | let v: Vec<&str> = "abc1defXghi".split(|c| c == '1' || c == 'X').collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using an array of `char`: `['1', 'X']` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_pattern_char_comparison [INFO] [stdout] = note: `#[warn(clippy::manual_pattern_char_comparison)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: type `List_Rc` should have an upper camel case name [INFO] [stdout] --> chapt15_smart_pointer/src/bin/rc.rs:45:6 [INFO] [stdout] | [INFO] [stdout] 45 | enum List_Rc { [INFO] [stdout] | ^^^^^^^ help: convert the identifier to upper camel case: `ListRc` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(non_camel_case_types)]` (part of `#[warn(nonstandard_style)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `1` is never read [INFO] [stdout] --> chapt15_smart_pointer/src/bin/refcell.rs:69:13 [INFO] [stdout] | [INFO] [stdout] 69 | Cons(T, Rc>), [INFO] [stdout] | ---- ^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `List` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 69 - Cons(T, Rc>), [INFO] [stdout] 69 + Cons(T, ()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `username` and `age` are never read [INFO] [stdout] --> chapt15_smart_pointer/src/bin/refcell.rs:78:5 [INFO] [stdout] | [INFO] [stdout] 77 | struct User { [INFO] [stdout] | ---- fields in this struct [INFO] [stdout] 78 | username: String, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] 79 | age: usize, [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `active`, `username`, and `email` are never read [INFO] [stdout] --> chapt5_struct/src/bin/struct.rs:101:5 [INFO] [stdout] | [INFO] [stdout] 100 | struct Person<'a> { [INFO] [stdout] | ------ fields in this struct [INFO] [stdout] 101 | active: bool, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] 102 | username: &'a str, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] 103 | email: &'a str, [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Person` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `b` [INFO] [stdout] --> chapt15_smart_pointer/src/bin/rc.rs:32:9 [INFO] [stdout] | [INFO] [stdout] 32 | let b = List_Rc::Cons(3, Rc::clone(&a)); [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_b` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `c` [INFO] [stdout] --> chapt15_smart_pointer/src/bin/rc.rs:35:13 [INFO] [stdout] | [INFO] [stdout] 35 | let c = List_Rc::Cons(4, Rc::clone(&a)); [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_c` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `1` is never read [INFO] [stdout] --> chapt15_smart_pointer/src/bin/rc.rs:46:13 [INFO] [stdout] | [INFO] [stdout] 46 | Cons(T, Rc>), [INFO] [stdout] | ---- ^^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `List_Rc` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 46 - Cons(T, Rc>), [INFO] [stdout] 46 + Cons(T, ()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `1` is never read [INFO] [stdout] --> chapt15_smart_pointer/src/bin/rc.rs:52:13 [INFO] [stdout] | [INFO] [stdout] 52 | Cons(T, Rc>>), [INFO] [stdout] | ---- ^^^^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `List` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 52 - Cons(T, Rc>>), [INFO] [stdout] 52 + Cons(T, ()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of `Rc>>` [INFO] [stdout] --> chapt15_smart_pointer/src/bin/rc.rs:52:13 [INFO] [stdout] | [INFO] [stdout] 52 | Cons(T, Rc>>), [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Box>` is already on the heap, `Rc>>` makes an extra allocation [INFO] [stdout] = help: consider using just `Rc>` or `Box>` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_allocation [INFO] [stdout] = note: `#[warn(clippy::redundant_allocation)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Checking chapt3_variables v0.1.0 (/opt/rustwide/workdir/chapt3_variables) [INFO] [stdout] warning: fields `value` and `children` are never read [INFO] [stdout] --> chapt15_smart_pointer/src/bin/refcycle.rs:93:5 [INFO] [stdout] | [INFO] [stdout] 92 | struct Node { [INFO] [stdout] | ---- fields in this struct [INFO] [stdout] 93 | value: i32, [INFO] [stdout] | ^^^^^ [INFO] [stdout] 94 | children: RefCell>>, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Node` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `1` is never read [INFO] [stdout] --> chapt15_smart_pointer/src/bin/box.rs:26:13 [INFO] [stdout] | [INFO] [stdout] 26 | Cons(T, Box>), [INFO] [stdout] | ---- ^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `List` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 26 - Cons(T, Box>), [INFO] [stdout] 26 + Cons(T, ()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> chapt8_collections/src/vect.rs:19:9 [INFO] [stdout] | [INFO] [stdout] 19 | let mut v = vec![1, 2, 3, 4, 5, 6, 7, 8, 9]; [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] --> chapt8_collections/src/vect.rs:30:9 [INFO] [stdout] | [INFO] [stdout] 30 | let mut v = vec![1, 2, 3, 4, 5, 6]; [INFO] [stdout] | ----^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `v` [INFO] [stdout] --> chapt8_collections/src/vect.rs:2:9 [INFO] [stdout] | [INFO] [stdout] 2 | let v: Vec = Vec::new(); [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_v` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `1` is never read [INFO] [stdout] --> chapt15_smart_pointer/src/bin/box.rs:26:13 [INFO] [stdout] | [INFO] [stdout] 26 | Cons(T, Box>), [INFO] [stdout] | ---- ^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `List` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 26 - Cons(T, Box>), [INFO] [stdout] 26 + Cons(T, ()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> chapt9_error/src/bin/result.rs:61:44 [INFO] [stdout] | [INFO] [stdout] 61 | println!("{}", last_char_of_first_line(&"text").unwrap()); [INFO] [stdout] | ^^^^^^^ help: change this to: `"text"` [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 `match` expression can be replaced with `?` [INFO] [stdout] --> chapt9_error/src/bin/result.rs:84:29 [INFO] [stdout] | [INFO] [stdout] 84 | let mut greeting_file = match greeting_file_res { [INFO] [stdout] | _____________________________^ [INFO] [stdout] 85 | | Ok(file) => file, [INFO] [stdout] 86 | | Err(e) => return Err(e), [INFO] [stdout] 87 | | }; [INFO] [stdout] | |_____^ help: try instead: `greeting_file_res?` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] = note: `#[warn(clippy::question_mark)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `height` is never read [INFO] [stdout] --> chapt13_closures_iterators/src/bin/closures.rs:124:5 [INFO] [stdout] | [INFO] [stdout] 122 | struct Rectangle { [INFO] [stdout] | --------- field in this struct [INFO] [stdout] 123 | width: u32, [INFO] [stdout] 124 | height: u32, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Rectangle` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Checking chapt1_hello_world v0.1.0 (/opt/rustwide/workdir/chapt1_hello_world) [INFO] [stdout] warning: field `0` is never read [INFO] [stdout] --> chapt8_collections/src/vect.rs:57:9 [INFO] [stdout] | [INFO] [stdout] 57 | Int(i32), [INFO] [stdout] | --- ^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `SpreadsheetCell` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 57 - Int(i32), [INFO] [stdout] 57 + Int(()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `0` is never read [INFO] [stdout] --> chapt8_collections/src/vect.rs:58:11 [INFO] [stdout] | [INFO] [stdout] 58 | Float(f64), [INFO] [stdout] | ----- ^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `SpreadsheetCell` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 58 - Float(f64), [INFO] [stdout] 58 + Float(()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `0` is never read [INFO] [stdout] --> chapt8_collections/src/vect.rs:59:10 [INFO] [stdout] | [INFO] [stdout] 59 | Text(String), [INFO] [stdout] | ---- ^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `SpreadsheetCell` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 59 - Text(String), [INFO] [stdout] 59 + Text(()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calls to `push` immediately after creation [INFO] [stdout] --> chapt8_collections/src/vect.rs:11:5 [INFO] [stdout] | [INFO] [stdout] 11 | / let mut v = Vec::new(); [INFO] [stdout] 12 | | v.push(5); [INFO] [stdout] 13 | | v.push(6); [INFO] [stdout] 14 | | v.push(7); [INFO] [stdout] 15 | | v.push(8); [INFO] [stdout] | |______________^ help: consider using the `vec![]` macro: `let v = vec![..];` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push [INFO] [stdout] = note: `#[warn(clippy::vec_init_then_push)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert` to construct default value [INFO] [stdout] --> chapt8_collections/src/hashmap.rs:79:51 [INFO] [stdout] | [INFO] [stdout] 79 | let employees = map.entry(department).or_insert(Vec::new()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] = note: `#[warn(clippy::unwrap_or_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: importing legacy numeric constants [INFO] [stdout] --> chapt3_variables/src/bin/variable.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use std::usize; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: remove this import [INFO] [stdout] = note: then `usize::` will resolve to the respective associated constant [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] = note: `#[warn(clippy::legacy_numeric_constants)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `x` and `y` are never read [INFO] [stdout] --> chapt10_trait/src/bin/generics.rs:80:5 [INFO] [stdout] | [INFO] [stdout] 79 | struct De { [INFO] [stdout] | -- fields in this struct [INFO] [stdout] 80 | x: T, [INFO] [stdout] | ^ [INFO] [stdout] 81 | y: U, [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = note: `De` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `x` and `y` are never used [INFO] [stdout] --> chapt10_trait/src/bin/generics.rs:100:8 [INFO] [stdout] | [INFO] [stdout] 99 | impl Point { [INFO] [stdout] | ---------------- methods in this implementation [INFO] [stdout] 100 | fn x(&self) -> &T { [INFO] [stdout] | ^ [INFO] [stdout] ... [INFO] [stdout] 103 | fn y(&self) -> &T { [INFO] [stdout] | ^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `distance_from_origin` is never used [INFO] [stdout] --> chapt10_trait/src/bin/generics.rs:109:8 [INFO] [stdout] | [INFO] [stdout] 108 | impl Point { [INFO] [stdout] | --------------- method in this implementation [INFO] [stdout] 109 | fn distance_from_origin(&self) -> f64 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `value` and `children` are never read [INFO] [stdout] --> chapt15_smart_pointer/src/bin/refcycle.rs:93:5 [INFO] [stdout] | [INFO] [stdout] 92 | struct Node { [INFO] [stdout] | ---- fields in this struct [INFO] [stdout] 93 | value: i32, [INFO] [stdout] | ^^^^^ [INFO] [stdout] 94 | children: RefCell>>, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Node` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) 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] --> chapt8_collections/src/hashmap.rs:171:21 [INFO] [stdout] | [INFO] [stdout] 171 | fn bubble_sort(vec: &mut Vec) { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 171 - fn bubble_sort(vec: &mut Vec) { [INFO] [stdout] 171 + fn bubble_sort(vec: &mut [i32]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this looks like you are swapping elements of `vec` manually [INFO] [stdout] --> chapt8_collections/src/hashmap.rs:175:17 [INFO] [stdout] | [INFO] [stdout] 175 | / let temp = vec[j]; [INFO] [stdout] 176 | | vec[j] = vec[j + 1]; [INFO] [stdout] 177 | | vec[j + 1] = temp; [INFO] [stdout] | |__________________________________^ help: try: `vec.swap(j, j + 1);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_swap [INFO] [stdout] = note: `#[warn(clippy::manual_swap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> chapt8_collections/src/vect.rs:5:13 [INFO] [stdout] | [INFO] [stdout] 5 | let v = vec![1, 2, 3]; [INFO] [stdout] | ^^^^^^^^^^^^^ help: you can use an array directly: `[1, 2, 3]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> chapt8_collections/src/vect.rs:30:17 [INFO] [stdout] | [INFO] [stdout] 30 | let mut v = vec![1, 2, 3, 4, 5, 6]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[1, 2, 3, 4, 5, 6]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Checking quote v1.0.36 [INFO] [stdout] warning: field `height` is never read [INFO] [stdout] --> chapt13_closures_iterators/src/bin/closures.rs:124:5 [INFO] [stdout] | [INFO] [stdout] 122 | struct Rectangle { [INFO] [stdout] | --------- field in this struct [INFO] [stdout] 123 | width: u32, [INFO] [stdout] 124 | height: u32, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Rectangle` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant slicing of the whole range [INFO] [stdout] --> chapt4_ownership/src/bin/slice.rs:49:27 [INFO] [stdout] | [INFO] [stdout] 49 | let word = first_word(&my_string_literal[..]); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: use the original value instead: `my_string_literal` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_slicing [INFO] [stdout] = note: `#[warn(clippy::redundant_slicing)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant slicing of the whole range [INFO] [stdout] --> chapt4_ownership/src/bin/slice.rs:75:5 [INFO] [stdout] | [INFO] [stdout] 75 | &s[..] [INFO] [stdout] | ^^^^^^ help: use the original value instead: `s` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_slicing [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `post` [INFO] [stdout] --> chapt17_rust_object/src/lib.rs:100:31 [INFO] [stdout] | [INFO] [stdout] 100 | fn content<'a>(&self, post: &'a Post) -> &'a str { [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_post` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods called `new` usually return `Self` [INFO] [stdout] --> chapt17_rust_object/src/lib.rs:7:9 [INFO] [stdout] | [INFO] [stdout] 7 | / pub fn new() -> DraftPost { [INFO] [stdout] 8 | | DraftPost { [INFO] [stdout] 9 | | content: String::new(), [INFO] [stdout] 10 | | } [INFO] [stdout] 11 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_ret_no_self [INFO] [stdout] = note: `#[warn(clippy::new_ret_no_self)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Post` [INFO] [stdout] --> chapt17_rust_object/src/lib.rs:55:9 [INFO] [stdout] | [INFO] [stdout] 55 | / pub fn new() -> Post { [INFO] [stdout] 56 | | Post { [INFO] [stdout] 57 | | state: Some(Box::new(Draft {})), [INFO] [stdout] 58 | | content: String::new(), [INFO] [stdout] 59 | | } [INFO] [stdout] 60 | | } [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] 54 ~ impl Default for Post { [INFO] [stdout] 55 + fn default() -> Self { [INFO] [stdout] 56 + Self::new() [INFO] [stdout] 57 + } [INFO] [stdout] 58 + } [INFO] [stdout] 59 + [INFO] [stdout] 60 ~ impl Post { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `y` [INFO] [stdout] --> chapt10_trait/src/bin/lifetime.rs:146:32 [INFO] [stdout] | [INFO] [stdout] 146 | fn longest_one<'a>(x: &'a str, y: &str) -> &'a str { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_y` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Import` is never constructed [INFO] [stdout] --> chapt10_trait/src/bin/lifetime.rs:103:8 [INFO] [stdout] | [INFO] [stdout] 103 | struct Import<'a> { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `level` and `announce_and_return_part` are never used [INFO] [stdout] --> chapt10_trait/src/bin/lifetime.rs:108:8 [INFO] [stdout] | [INFO] [stdout] 107 | impl<'a, 'b> Import<'a> { [INFO] [stdout] | ----------------------- methods in this implementation [INFO] [stdout] 108 | fn level(&self) -> i32 { [INFO] [stdout] | ^^^^^ [INFO] [stdout] ... [INFO] [stdout] 113 | fn announce_and_return_part(&'a self, announcement: &'b str) -> &'a str { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `part` is never read [INFO] [stdout] --> chapt10_trait/src/bin/lifetime.rs:134:5 [INFO] [stdout] | [INFO] [stdout] 133 | struct ImportantExcerpt<'a> { [INFO] [stdout] | ---------------- field in this struct [INFO] [stdout] 134 | part: &'a str, [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `ImportantExcerpt` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `longest_one` is never used [INFO] [stdout] --> chapt10_trait/src/bin/lifetime.rs:146:4 [INFO] [stdout] | [INFO] [stdout] 146 | fn longest_one<'a>(x: &'a str, y: &str) -> &'a str { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> chapt10_trait/src/bin/lifetime.rs:24:23 [INFO] [stdout] | [INFO] [stdout] 24 | let res = longest(&str1.as_str(), &str2); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `str1.as_str()` [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] --> chapt10_trait/src/bin/lifetime.rs:24:39 [INFO] [stdout] | [INFO] [stdout] 24 | let res = longest(&str1.as_str(), &str2); [INFO] [stdout] | ^^^^^ help: change this to: `str2` [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 following explicit lifetimes could be elided: 'a [INFO] [stdout] --> chapt10_trait/src/bin/lifetime.rs:119:16 [INFO] [stdout] | [INFO] [stdout] 119 | fn _first_word<'a>(s: &'a str) -> &'a str { [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: `#[warn(clippy::needless_lifetimes)]` on by default [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 119 - fn _first_word<'a>(s: &'a str) -> &'a str { [INFO] [stdout] 119 + fn _first_word(s: &str) -> &str { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant slicing of the whole range [INFO] [stdout] --> chapt10_trait/src/bin/lifetime.rs:126:5 [INFO] [stdout] | [INFO] [stdout] 126 | &s[..] [INFO] [stdout] | ^^^^^^ help: use the original value instead: `s` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_slicing [INFO] [stdout] = note: `#[warn(clippy::redundant_slicing)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> chapt6_enum_match/src/bin/iflet.rs:6:5 [INFO] [stdout] | [INFO] [stdout] 6 | / match config_max { [INFO] [stdout] 7 | | Some(max) => println!("The maximum is configured to be {}", max), [INFO] [stdout] 8 | | _ => (), [INFO] [stdout] 9 | | } [INFO] [stdout] | |_____^ help: try: `if let Some(max) = config_max { println!("The maximum is configured to be {}", max) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Checking chapt18_patterns v0.1.0 (/opt/rustwide/workdir/chapt18_patterns) [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/res.rs:12:5 [INFO] [stdout] | [INFO] [stdout] 12 | assert_eq!(x.is_ok(), 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] 12 - assert_eq!(x.is_ok(), true); [INFO] [stdout] 12 + assert!(x.is_ok()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/res.rs:15:5 [INFO] [stdout] | [INFO] [stdout] 15 | assert_eq!(x.is_ok(), 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] 15 - assert_eq!(x.is_ok(), false); [INFO] [stdout] 15 + assert!(!x.is_ok()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/res.rs:19:5 [INFO] [stdout] | [INFO] [stdout] 19 | assert_eq!(x.is_ok_and(|x| x > 1), 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] 19 - assert_eq!(x.is_ok_and(|x| x > 1), true); [INFO] [stdout] 19 + assert!(x.is_ok_and(|x| x > 1)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/res.rs:22:5 [INFO] [stdout] | [INFO] [stdout] 22 | assert_eq!(x.is_ok_and(|x| x > 1), 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] 22 - assert_eq!(x.is_ok_and(|x| x > 1), false); [INFO] [stdout] 22 + assert!(!x.is_ok_and(|x| x > 1)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/res.rs:25:5 [INFO] [stdout] | [INFO] [stdout] 25 | assert_eq!(x.is_ok_and(|x| x > 1), 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] 25 - assert_eq!(x.is_ok_and(|x| x > 1), false); [INFO] [stdout] 25 + assert!(!x.is_ok_and(|x| x > 1)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/res.rs:29:5 [INFO] [stdout] | [INFO] [stdout] 29 | assert_eq!(x.is_err(), 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] 29 - assert_eq!(x.is_err(), false); [INFO] [stdout] 29 + assert!(!x.is_err()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/res.rs:32:5 [INFO] [stdout] | [INFO] [stdout] 32 | assert_eq!(x.is_err(), 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] 32 - assert_eq!(x.is_err(), true); [INFO] [stdout] 32 + assert!(x.is_err()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/res.rs:36:5 [INFO] [stdout] | [INFO] [stdout] 36 | assert_eq!(x.is_err_and(|x| x.kind() == ErrorKind::NotFound), 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] 36 - assert_eq!(x.is_err_and(|x| x.kind() == ErrorKind::NotFound), true); [INFO] [stdout] 36 + assert!(x.is_err_and(|x| x.kind() == ErrorKind::NotFound)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/res.rs:39:5 [INFO] [stdout] | [INFO] [stdout] 39 | assert_eq!(x.is_err_and(|x| x.kind() == ErrorKind::NotFound), 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] 39 - assert_eq!(x.is_err_and(|x| x.kind() == ErrorKind::NotFound), false); [INFO] [stdout] 39 + assert!(!x.is_err_and(|x| x.kind() == ErrorKind::NotFound)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/res.rs:42:5 [INFO] [stdout] | [INFO] [stdout] 42 | assert_eq!(x.is_err_and(|x| x.kind() == ErrorKind::NotFound), 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] 42 - assert_eq!(x.is_err_and(|x| x.kind() == ErrorKind::NotFound), false); [INFO] [stdout] 42 + assert!(!x.is_err_and(|x| x.kind() == ErrorKind::NotFound)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> a_standard/src/bin/res.rs:87:9 [INFO] [stdout] | [INFO] [stdout] 87 | / match num.parse::().map(|i| i * 2) { [INFO] [stdout] 88 | | Ok(n) => println!("{}", n), [INFO] [stdout] 89 | | Err(..) => {} [INFO] [stdout] 90 | | } [INFO] [stdout] | |_________^ help: try: `if let Ok(n) = num.parse::().map(|i| i * 2) { println!("{}", n) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `map` over `inspect` [INFO] [stdout] --> a_standard/src/bin/res.rs:152:26 [INFO] [stdout] | [INFO] [stdout] 152 | x.as_deref_mut().map(|x| { [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_inspect [INFO] [stdout] = note: `#[warn(clippy::manual_inspect)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 152 ~ x.as_deref_mut().inspect(|x| { [INFO] [stdout] 153 ~ x.make_ascii_uppercase(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `map` over `inspect` [INFO] [stdout] --> a_standard/src/bin/res.rs:163:26 [INFO] [stdout] | [INFO] [stdout] 163 | x.as_deref_mut().map(|x| { [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_inspect [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 163 ~ x.as_deref_mut().inspect(|x| { [INFO] [stdout] 164 ~ x.make_ascii_uppercase(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> a_standard/src/bin/res.rs:179:5 [INFO] [stdout] | [INFO] [stdout] 179 | / match x.iter_mut().next() { [INFO] [stdout] 180 | | Some(v) => *v = 40, [INFO] [stdout] 181 | | None => {} [INFO] [stdout] 182 | | } [INFO] [stdout] | |_____^ help: try: `if let Some(v) = x.iter_mut().next() { *v = 40 }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `unwrap()` on `Ok` value [INFO] [stdout] --> a_standard/src/bin/res.rs:196:16 [INFO] [stdout] | [INFO] [stdout] 196 | assert_eq!(x.unwrap(), 2); [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: remove the `Ok` and `unwrap()` [INFO] [stdout] --> a_standard/src/bin/res.rs:195:32 [INFO] [stdout] | [INFO] [stdout] 195 | let x: Result = Ok(2); [INFO] [stdout] | ^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_literal_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_literal_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `unwrap_err()` on `Err` value [INFO] [stdout] --> a_standard/src/bin/res.rs:219:16 [INFO] [stdout] | [INFO] [stdout] 219 | assert_eq!(x.unwrap_err(), "emergency failure"); [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: remove the `Err` and `unwrap_err()` [INFO] [stdout] --> a_standard/src/bin/res.rs:218:32 [INFO] [stdout] | [INFO] [stdout] 218 | let x: Result = Err("emergency failure"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_literal_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `unwrap_or()` on `Ok` value [INFO] [stdout] --> a_standard/src/bin/res.rs:302:16 [INFO] [stdout] | [INFO] [stdout] 302 | assert_eq!(x.unwrap_or(default), 9); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: remove the `Ok` and `unwrap_or()` [INFO] [stdout] --> a_standard/src/bin/res.rs:301:32 [INFO] [stdout] | [INFO] [stdout] 301 | let x: Result = Ok(9); [INFO] [stdout] | ^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_literal_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `unwrap_or()` on `Err` value [INFO] [stdout] --> a_standard/src/bin/res.rs:305:16 [INFO] [stdout] | [INFO] [stdout] 305 | assert_eq!(x.unwrap_or(default), default); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: remove the `Err` and `unwrap_or()` [INFO] [stdout] --> a_standard/src/bin/res.rs:304:32 [INFO] [stdout] | [INFO] [stdout] 304 | let x: Result = Err("error"); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_literal_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `unwrap_or_else()` on `Ok` value [INFO] [stdout] --> a_standard/src/bin/res.rs:308:16 [INFO] [stdout] | [INFO] [stdout] 308 | assert_eq!(Ok(2).unwrap_or_else(|x| x), 2); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_literal_unwrap [INFO] [stdout] help: remove the `Ok` and `unwrap_or_else()` [INFO] [stdout] | [INFO] [stdout] 308 - assert_eq!(Ok(2).unwrap_or_else(|x| x), 2); [INFO] [stdout] 308 + assert_eq!(2, 2); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `unwrap_or_else()` on `Err` value [INFO] [stdout] --> a_standard/src/bin/res.rs:309:16 [INFO] [stdout] | [INFO] [stdout] 309 | assert_eq!(Err("foo").unwrap_or_else(|x| x.len()), 3); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_literal_unwrap [INFO] [stdout] help: remove the `Err` and `unwrap_or_else()` [INFO] [stdout] | [INFO] [stdout] 309 - assert_eq!(Err("foo").unwrap_or_else(|x| x.len()), 3); [INFO] [stdout] 309 + assert_eq!("foo", 3); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `unwrap_unchecked()` on `Ok` value [INFO] [stdout] --> a_standard/src/bin/res.rs:313:25 [INFO] [stdout] | [INFO] [stdout] 313 | assert_eq!(unsafe { x.unwrap_unchecked() }, 2); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: remove the `Ok` and `unwrap_unchecked()` [INFO] [stdout] --> a_standard/src/bin/res.rs:312:32 [INFO] [stdout] | [INFO] [stdout] 312 | let x: Result = Ok(2); [INFO] [stdout] | ^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_literal_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `unwrap_err_unchecked()` on `Err` value [INFO] [stdout] --> a_standard/src/bin/res.rs:325:25 [INFO] [stdout] | [INFO] [stdout] 325 | assert_eq!(unsafe { x.unwrap_err_unchecked() }, "emergency failure"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: remove the `Err` and `unwrap_err_unchecked()` [INFO] [stdout] --> a_standard/src/bin/res.rs:324:32 [INFO] [stdout] | [INFO] [stdout] 324 | let x: Result = Err("emergency failure"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_literal_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `x` and `y` are never read [INFO] [stdout] --> chapt10_trait/src/bin/generics.rs:80:5 [INFO] [stdout] | [INFO] [stdout] 79 | struct De { [INFO] [stdout] | -- fields in this struct [INFO] [stdout] 80 | x: T, [INFO] [stdout] | ^ [INFO] [stdout] 81 | y: U, [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = note: `De` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `x` and `y` are never used [INFO] [stdout] --> chapt10_trait/src/bin/generics.rs:100:8 [INFO] [stdout] | [INFO] [stdout] 99 | impl Point { [INFO] [stdout] | ---------------- methods in this implementation [INFO] [stdout] 100 | fn x(&self) -> &T { [INFO] [stdout] | ^ [INFO] [stdout] ... [INFO] [stdout] 103 | fn y(&self) -> &T { [INFO] [stdout] | ^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `distance_from_origin` is never used [INFO] [stdout] --> chapt10_trait/src/bin/generics.rs:109:8 [INFO] [stdout] | [INFO] [stdout] 108 | impl Point { [INFO] [stdout] | --------------- method in this implementation [INFO] [stdout] 109 | fn distance_from_origin(&self) -> f64 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant slicing of the whole range [INFO] [stdout] --> chapt4_ownership/src/bin/slice.rs:49:27 [INFO] [stdout] | [INFO] [stdout] 49 | let word = first_word(&my_string_literal[..]); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: use the original value instead: `my_string_literal` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_slicing [INFO] [stdout] = note: `#[warn(clippy::redundant_slicing)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant slicing of the whole range [INFO] [stdout] --> chapt4_ownership/src/bin/slice.rs:75:5 [INFO] [stdout] | [INFO] [stdout] 75 | &s[..] [INFO] [stdout] | ^^^^^^ help: use the original value instead: `s` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_slicing [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> chapt18_patterns/src/main.rs:6:5 [INFO] [stdout] | [INFO] [stdout] 6 | / match x { [INFO] [stdout] 7 | | Some(i) => Some(i + 1), [INFO] [stdout] 8 | | None => None, [INFO] [stdout] 9 | | }; [INFO] [stdout] | |_____^ help: try: `x.map(|i| i + 1)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] = note: `#[warn(clippy::manual_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> a_standard/src/bin/str.rs:84:13 [INFO] [stdout] | [INFO] [stdout] 84 | assert!(!v.get(1..).is_none()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `v.get(1..).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: this expression always evaluates to true [INFO] [stdout] --> a_standard/src/bin/str.rs:31:13 [INFO] [stdout] | [INFO] [stdout] 31 | assert!(s.is_empty()); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#const_is_empty [INFO] [stdout] = note: `#[warn(clippy::const_is_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression always evaluates to false [INFO] [stdout] --> a_standard/src/bin/str.rs:33:14 [INFO] [stdout] | [INFO] [stdout] 33 | assert!(!s.is_empty()); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#const_is_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> chapt18_patterns/src/main.rs:82:12 [INFO] [stdout] | [INFO] [stdout] 82 | if let Some(_) = s { [INFO] [stdout] | -------^^^^^^^---- help: try: `if s.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: type `List_Rc` should have an upper camel case name [INFO] [stdout] --> chapt15_smart_pointer/src/bin/rc.rs:45:6 [INFO] [stdout] | [INFO] [stdout] 45 | enum List_Rc { [INFO] [stdout] | ^^^^^^^ help: convert the identifier to upper camel case: `ListRc` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(non_camel_case_types)]` (part of `#[warn(nonstandard_style)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> chapt18_patterns/src/main.rs:43:13 [INFO] [stdout] | [INFO] [stdout] 43 | let v = vec!['a', 'b', 'c']; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `['a', 'b', 'c']` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> a_standard/src/bin/str.rs:287:33 [INFO] [stdout] | [INFO] [stdout] 287 | assert!(bananas.starts_with(&['b', 'a', 'n', 'a'])); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: change this to: `['b', 'a', 'n', 'a']` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> a_standard/src/bin/str.rs:288:33 [INFO] [stdout] | [INFO] [stdout] 288 | assert!(bananas.starts_with(&['a', 'b', 'c', 'd'])); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: change this to: `['a', 'b', 'c', 'd']` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this manual char comparison can be written more succinctly [INFO] [stdout] --> a_standard/src/bin/str.rs:350:44 [INFO] [stdout] | [INFO] [stdout] 350 | let v: Vec<&str> = "abc1defXghi".split(|c| c == '1' || c == 'X').collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using an array of `char`: `['1', 'X']` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_pattern_char_comparison [INFO] [stdout] = note: `#[warn(clippy::manual_pattern_char_comparison)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `b` [INFO] [stdout] --> chapt15_smart_pointer/src/bin/rc.rs:32:9 [INFO] [stdout] | [INFO] [stdout] 32 | let b = List_Rc::Cons(3, Rc::clone(&a)); [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_b` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `c` [INFO] [stdout] --> chapt15_smart_pointer/src/bin/rc.rs:35:13 [INFO] [stdout] | [INFO] [stdout] 35 | let c = List_Rc::Cons(4, Rc::clone(&a)); [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_c` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `1` is never read [INFO] [stdout] --> chapt15_smart_pointer/src/bin/rc.rs:46:13 [INFO] [stdout] | [INFO] [stdout] 46 | Cons(T, Rc>), [INFO] [stdout] | ---- ^^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `List_Rc` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 46 - Cons(T, Rc>), [INFO] [stdout] 46 + Cons(T, ()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `1` is never read [INFO] [stdout] --> chapt15_smart_pointer/src/bin/rc.rs:52:13 [INFO] [stdout] | [INFO] [stdout] 52 | Cons(T, Rc>>), [INFO] [stdout] | ---- ^^^^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `List` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 52 - Cons(T, Rc>>), [INFO] [stdout] 52 + Cons(T, ()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of `Rc>>` [INFO] [stdout] --> chapt15_smart_pointer/src/bin/rc.rs:52:13 [INFO] [stdout] | [INFO] [stdout] 52 | Cons(T, Rc>>), [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Box>` is already on the heap, `Rc>>` makes an extra allocation [INFO] [stdout] = help: consider using just `Rc>` or `Box>` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_allocation [INFO] [stdout] = note: `#[warn(clippy::redundant_allocation)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> chapt6_enum_match/src/bin/iflet.rs:6:5 [INFO] [stdout] | [INFO] [stdout] 6 | / match config_max { [INFO] [stdout] 7 | | Some(max) => println!("The maximum is configured to be {}", max), [INFO] [stdout] 8 | | _ => (), [INFO] [stdout] 9 | | } [INFO] [stdout] | |_____^ help: try: `if let Some(max) = config_max { println!("The maximum is configured to be {}", max) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> chapt4_ownership/src/bin/refbow.rs:60:24 [INFO] [stdout] | [INFO] [stdout] 60 | fn calculate_length(s: &String) -> 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] 60 - fn calculate_length(s: &String) -> usize { [INFO] [stdout] 60 + fn calculate_length(s: &str) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> a_standard/src/bin/hash.rs:136:9 [INFO] [stdout] | [INFO] [stdout] 136 | *val = *val + 10; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace it with: `*val += 10` [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: variants `Penny` and `Nickel` are never constructed [INFO] [stdout] --> chapt6_enum_match/src/bin/match.rs:6:5 [INFO] [stdout] | [INFO] [stdout] 5 | enum Coin { [INFO] [stdout] | ---- variants in this enum [INFO] [stdout] 6 | Penny, [INFO] [stdout] | ^^^^^ [INFO] [stdout] 7 | Nickel, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Coin` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variant `Alabama` is never constructed [INFO] [stdout] --> chapt6_enum_match/src/bin/match.rs:14:5 [INFO] [stdout] | [INFO] [stdout] 13 | enum UsState { [INFO] [stdout] | ------- variant in this enum [INFO] [stdout] 14 | Alabama, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `UsState` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/hash.rs:279:5 [INFO] [stdout] | [INFO] [stdout] 279 | assert_eq!(map.contains_key(&1), 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] 279 - assert_eq!(map.contains_key(&1), true); [INFO] [stdout] 279 + assert!(map.contains_key(&1)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/hash.rs:280:5 [INFO] [stdout] | [INFO] [stdout] 280 | assert_eq!(map.contains_key(&2), 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] 280 - assert_eq!(map.contains_key(&2), false); [INFO] [stdout] 280 + assert!(!map.contains_key(&2)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/hash.rs:294:5 [INFO] [stdout] | [INFO] [stdout] 294 | assert_eq!(map.is_empty(), 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] 294 - assert_eq!(map.is_empty(), false); [INFO] [stdout] 294 + assert!(!map.is_empty()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the feature `const_slice_flatten` has been stable since 1.87.0 and no longer requires an attribute to enable [INFO] [stdout] --> a_standard/src/bin/vect.rs:7:5 [INFO] [stdout] | [INFO] [stdout] 7 | const_slice_flatten, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(stable_features)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the feature `slice_as_chunks` has been stable since 1.88.0 and no longer requires an attribute to enable [INFO] [stdout] --> a_standard/src/bin/vect.rs:11:5 [INFO] [stdout] | [INFO] [stdout] 11 | slice_as_chunks [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> chapt9_error/src/bin/result.rs:61:44 [INFO] [stdout] | [INFO] [stdout] 61 | println!("{}", last_char_of_first_line(&"text").unwrap()); [INFO] [stdout] | ^^^^^^^ help: change this to: `"text"` [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: the feature `extract_if` has been stable since 1.87.0 and no longer requires an attribute to enable [INFO] [stdout] --> a_standard/src/bin/vect.rs:8:5 [INFO] [stdout] | [INFO] [stdout] 8 | extract_if, [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the feature `vec_into_raw_parts` has been stable since 1.93.0 and no longer requires an attribute to enable [INFO] [stdout] --> a_standard/src/bin/vect.rs:3:5 [INFO] [stdout] | [INFO] [stdout] 3 | vec_into_raw_parts, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the feature `vec_pop_if` has been stable since 1.86.0 and no longer requires an attribute to enable [INFO] [stdout] --> a_standard/src/bin/vect.rs:5:5 [INFO] [stdout] | [INFO] [stdout] 5 | vec_pop_if, [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` expression can be replaced with `?` [INFO] [stdout] --> chapt9_error/src/bin/result.rs:84:29 [INFO] [stdout] | [INFO] [stdout] 84 | let mut greeting_file = match greeting_file_res { [INFO] [stdout] | _____________________________^ [INFO] [stdout] 85 | | Ok(file) => file, [INFO] [stdout] 86 | | Err(e) => return Err(e), [INFO] [stdout] 87 | | }; [INFO] [stdout] | |_____^ help: try instead: `greeting_file_res?` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] = note: `#[warn(clippy::question_mark)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> chapt6_enum_match/src/bin/match.rs:41:5 [INFO] [stdout] | [INFO] [stdout] 41 | / match x { [INFO] [stdout] 42 | | Some(x) => Some(x + 1), [INFO] [stdout] 43 | | None => None, [INFO] [stdout] 44 | | } [INFO] [stdout] | |_____^ help: try: `x.map(|x| x + 1)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] = note: `#[warn(clippy::manual_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Checking getrandom v0.2.15 [INFO] [stdout] warning: unused import: `Duration` [INFO] [stdout] --> chapt11_test/src/lib.rs:61:36 [INFO] [stdout] | [INFO] [stdout] 61 | use std::{thread, time::{self, Duration}}; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> chapt18_patterns/src/main.rs:6:5 [INFO] [stdout] | [INFO] [stdout] 6 | / match x { [INFO] [stdout] 7 | | Some(i) => Some(i + 1), [INFO] [stdout] 8 | | None => None, [INFO] [stdout] 9 | | }; [INFO] [stdout] | |_____^ help: try: `x.map(|i| i + 1)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] = note: `#[warn(clippy::manual_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> chapt18_patterns/src/main.rs:82:12 [INFO] [stdout] | [INFO] [stdout] 82 | if let Some(_) = s { [INFO] [stdout] | -------^^^^^^^---- help: try: `if s.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> chapt18_patterns/src/main.rs:43:13 [INFO] [stdout] | [INFO] [stdout] 43 | let v = vec!['a', 'b', 'c']; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `['a', 'b', 'c']` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty line after doc comment [INFO] [stdout] --> a_standard/src/bin/option.rs:4:1 [INFO] [stdout] | [INFO] [stdout] 4 | / /** Option 枚举 方法 */ [INFO] [stdout] 5 | | [INFO] [stdout] | |_^ [INFO] [stdout] 6 | fn main() { [INFO] [stdout] | ------- the comment documents this function [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments [INFO] [stdout] = note: `#[warn(clippy::empty_line_after_doc_comments)]` on by default [INFO] [stdout] = help: if the empty line is unintentional, remove it [INFO] [stdout] help: if the comment should document the crate use an inner doc comment [INFO] [stdout] | [INFO] [stdout] 4 - /** Option 枚举 方法 */ [INFO] [stdout] 4 + /*! Option 枚举 方法 */ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty line after doc comment [INFO] [stdout] --> a_standard/src/bin/option.rs:4:1 [INFO] [stdout] | [INFO] [stdout] 4 | / /** Option 枚举 方法 */ [INFO] [stdout] 5 | | [INFO] [stdout] | |_^ [INFO] [stdout] 6 | fn main() { [INFO] [stdout] | ------- the comment documents this function [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments [INFO] [stdout] = note: `#[warn(clippy::empty_line_after_doc_comments)]` on by default [INFO] [stdout] = help: if the empty line is unintentional, remove it [INFO] [stdout] help: if the comment should document the crate use an inner doc comment [INFO] [stdout] | [INFO] [stdout] 4 - /** Option 枚举 方法 */ [INFO] [stdout] 4 + /*! Option 枚举 方法 */ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the feature `option_get_or_insert_default` has been stable since 1.83.0 and no longer requires an attribute to enable [INFO] [stdout] --> a_standard/src/bin/option.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | #![feature(option_get_or_insert_default)] [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(stable_features)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the feature `option_get_or_insert_default` has been stable since 1.83.0 and no longer requires an attribute to enable [INFO] [stdout] --> a_standard/src/bin/option.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | #![feature(option_get_or_insert_default)] [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(stable_features)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error: this boolean expression contains a logic bug [INFO] [stdout] --> chapt3_variables/src/bin/exercise.rs:44:20 [INFO] [stdout] | [INFO] [stdout] 44 | if j == 0 && j != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: it would look like the following: `false` [INFO] [stdout] | [INFO] [stdout] help: this expression can be optimized out by applying boolean operations to the outer expression [INFO] [stdout] --> chapt3_variables/src/bin/exercise.rs:44:20 [INFO] [stdout] | [INFO] [stdout] 44 | if j == 0 && j != 0 { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#overly_complex_bool_expr [INFO] [stdout] = note: `#[deny(clippy::overly_complex_bool_expr)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> chapt3_variables/src/bin/exercise.rs:119:30 [INFO] [stdout] | [INFO] [stdout] 119 | Temp::HuaShiDu(v) => return (v - 32 as f64) / 1.8, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 119 - Temp::HuaShiDu(v) => return (v - 32 as f64) / 1.8, [INFO] [stdout] 119 + Temp::HuaShiDu(v) => (v - 32 as f64) / 1.8, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> chapt3_variables/src/bin/exercise.rs:120:30 [INFO] [stdout] | [INFO] [stdout] 120 | Temp::SheShiDu(v) => return 32 as f64 + v * 1.8, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 120 - Temp::SheShiDu(v) => return 32 as f64 + v * 1.8, [INFO] [stdout] 120 + Temp::SheShiDu(v) => 32 as f64 + v * 1.8, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `f64` is unnecessary [INFO] [stdout] --> chapt3_variables/src/bin/exercise.rs:119:42 [INFO] [stdout] | [INFO] [stdout] 119 | Temp::HuaShiDu(v) => return (v - 32 as f64) / 1.8, [INFO] [stdout] | ^^^^^^^^^ help: try: `32_f64` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `f64` is unnecessary [INFO] [stdout] --> chapt3_variables/src/bin/exercise.rs:120:37 [INFO] [stdout] | [INFO] [stdout] 120 | Temp::SheShiDu(v) => return 32 as f64 + v * 1.8, [INFO] [stdout] | ^^^^^^^^^ help: try: `32_f64` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `name` [INFO] [stdout] --> chapt11_test/src/lib.rs:32:17 [INFO] [stdout] | [INFO] [stdout] 32 | pub fn greeting(name: &str) -> String { [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_name` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] error: could not compile `chapt3_variables` (bin "exercise" test) due to 1 previous error; 4 warnings emitted [INFO] [stderr] warning: build failed, waiting for other jobs to finish... [INFO] [stdout] warning: field `value` is never read [INFO] [stdout] --> chapt11_test/src/lib.rs:37:5 [INFO] [stdout] | [INFO] [stdout] 36 | struct Guess { [INFO] [stdout] | ----- field in this struct [INFO] [stdout] 37 | value: i32, [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> chapt11_test/src/lib.rs:33:5 [INFO] [stdout] | [INFO] [stdout] 33 | format!("Hello!") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Hello!".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0282]: type annotations needed [INFO] [stdout] --> a_standard/src/bin/vect.rs:707:37 [INFO] [stdout] | [INFO] [stdout] 707 | let evens = numbers.extract_if(|x| *x % 2 == 0).collect::>(); [INFO] [stdout] | ^ -- type must be known at this point [INFO] [stdout] | [INFO] [stdout] help: consider giving this closure parameter an explicit type [INFO] [stdout] | [INFO] [stdout] 707 | let evens = numbers.extract_if(|x: /* Type */| *x % 2 == 0).collect::>(); [INFO] [stdout] | ++++++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0061]: this method takes 2 arguments but 1 argument was supplied [INFO] [stdout] --> a_standard/src/bin/vect.rs:707:25 [INFO] [stdout] | [INFO] [stdout] 707 | let evens = numbers.extract_if(|x| *x % 2 == 0).collect::>(); [INFO] [stdout] | ^^^^^^^^^^----------------- argument #2 is missing [INFO] [stdout] | [INFO] [stdout] note: method defined here [INFO] [stdout] --> /rustc/3645249d79dfb136b5d8de3ce153d19d6698d92d/library/alloc/src/vec/mod.rs:4167:11 [INFO] [stdout] help: provide the argument [INFO] [stdout] | [INFO] [stdout] 707 | let evens = numbers.extract_if(|x| *x % 2 == 0, /* filter */).collect::>(); [INFO] [stdout] | ++++++++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/res.rs:12:5 [INFO] [stdout] | [INFO] [stdout] 12 | assert_eq!(x.is_ok(), 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] 12 - assert_eq!(x.is_ok(), true); [INFO] [stdout] 12 + assert!(x.is_ok()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/res.rs:15:5 [INFO] [stdout] | [INFO] [stdout] 15 | assert_eq!(x.is_ok(), 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] 15 - assert_eq!(x.is_ok(), false); [INFO] [stdout] 15 + assert!(!x.is_ok()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> chapt13_closures_iterators/src/bin/iterators.rs:5:14 [INFO] [stdout] | [INFO] [stdout] 5 | let v1 = vec![1, 2, 3]; [INFO] [stdout] | ^^^^^^^^^^^^^ help: you can use an array directly: `[1, 2, 3]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/res.rs:19:5 [INFO] [stdout] | [INFO] [stdout] 19 | assert_eq!(x.is_ok_and(|x| x > 1), 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] 19 - assert_eq!(x.is_ok_and(|x| x > 1), true); [INFO] [stdout] 19 + assert!(x.is_ok_and(|x| x > 1)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> chapt13_closures_iterators/src/bin/iterators.rs:8:14 [INFO] [stdout] | [INFO] [stdout] 8 | let v1 = vec![1, 2, 3]; [INFO] [stdout] | ^^^^^^^^^^^^^ help: you can use an array directly: `[1, 2, 3]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> chapt13_closures_iterators/src/bin/iterators.rs:30:14 [INFO] [stdout] | [INFO] [stdout] 30 | let v1 = vec![1, 2, 3]; [INFO] [stdout] | ^^^^^^^^^^^^^ help: you can use an array directly: `[1, 2, 3]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> chapt13_closures_iterators/src/bin/iterators.rs:41:14 [INFO] [stdout] | [INFO] [stdout] 41 | let v1 = vec![1, 2, 3]; [INFO] [stdout] | ^^^^^^^^^^^^^ help: you can use an array directly: `[1, 2, 3]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> chapt13_closures_iterators/src/bin/iterators.rs:97:14 [INFO] [stdout] | [INFO] [stdout] 97 | let v1 = vec![1, 2, 3]; [INFO] [stdout] | ^^^^^^^^^^^^^ help: you can use an array directly: `[1, 2, 3]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/res.rs:22:5 [INFO] [stdout] | [INFO] [stdout] 22 | assert_eq!(x.is_ok_and(|x| x > 1), 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] 22 - assert_eq!(x.is_ok_and(|x| x > 1), false); [INFO] [stdout] 22 + assert!(!x.is_ok_and(|x| x > 1)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/res.rs:25:5 [INFO] [stdout] | [INFO] [stdout] 25 | assert_eq!(x.is_ok_and(|x| x > 1), 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] 25 - assert_eq!(x.is_ok_and(|x| x > 1), false); [INFO] [stdout] 25 + assert!(!x.is_ok_and(|x| x > 1)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/res.rs:29:5 [INFO] [stdout] | [INFO] [stdout] 29 | assert_eq!(x.is_err(), 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] 29 - assert_eq!(x.is_err(), false); [INFO] [stdout] 29 + assert!(!x.is_err()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/res.rs:32:5 [INFO] [stdout] | [INFO] [stdout] 32 | assert_eq!(x.is_err(), 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] 32 - assert_eq!(x.is_err(), true); [INFO] [stdout] 32 + assert!(x.is_err()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/res.rs:36:5 [INFO] [stdout] | [INFO] [stdout] 36 | assert_eq!(x.is_err_and(|x| x.kind() == ErrorKind::NotFound), 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] 36 - assert_eq!(x.is_err_and(|x| x.kind() == ErrorKind::NotFound), true); [INFO] [stdout] 36 + assert!(x.is_err_and(|x| x.kind() == ErrorKind::NotFound)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/res.rs:39:5 [INFO] [stdout] | [INFO] [stdout] 39 | assert_eq!(x.is_err_and(|x| x.kind() == ErrorKind::NotFound), 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] 39 - assert_eq!(x.is_err_and(|x| x.kind() == ErrorKind::NotFound), false); [INFO] [stdout] 39 + assert!(!x.is_err_and(|x| x.kind() == ErrorKind::NotFound)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/res.rs:42:5 [INFO] [stdout] | [INFO] [stdout] 42 | assert_eq!(x.is_err_and(|x| x.kind() == ErrorKind::NotFound), 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] 42 - assert_eq!(x.is_err_and(|x| x.kind() == ErrorKind::NotFound), false); [INFO] [stdout] 42 + assert!(!x.is_err_and(|x| x.kind() == ErrorKind::NotFound)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/option.rs:10:5 [INFO] [stdout] | [INFO] [stdout] 10 | assert_eq!(x, 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] 10 - assert_eq!(x, true); [INFO] [stdout] 10 + assert!(x); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/option.rs:14:5 [INFO] [stdout] | [INFO] [stdout] 14 | assert_eq!(x, 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] 14 - assert_eq!(x, false); [INFO] [stdout] 14 + assert!(!x); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/option.rs:20:5 [INFO] [stdout] | [INFO] [stdout] 20 | assert_eq!(x, 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] 20 - assert_eq!(x, true); [INFO] [stdout] 20 + assert!(x); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/option.rs:24:5 [INFO] [stdout] | [INFO] [stdout] 24 | assert_eq!(x, 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] 24 - assert_eq!(x, false); [INFO] [stdout] 24 + assert!(!x); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/option.rs:28:5 [INFO] [stdout] | [INFO] [stdout] 28 | assert_eq!(x, 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!(x, false); [INFO] [stdout] 28 + assert!(!x); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/option.rs:33:5 [INFO] [stdout] | [INFO] [stdout] 33 | assert_eq!(x, 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!(x, false); [INFO] [stdout] 33 + assert!(!x); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/option.rs:37:5 [INFO] [stdout] | [INFO] [stdout] 37 | assert_eq!(x, 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] 37 - assert_eq!(x, true); [INFO] [stdout] 37 + assert!(x); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> a_standard/src/bin/option.rs:48:5 [INFO] [stdout] | [INFO] [stdout] 48 | / match x.as_mut() { [INFO] [stdout] 49 | | Some(v) => *v = 43, [INFO] [stdout] 50 | | None => {} [INFO] [stdout] 51 | | } [INFO] [stdout] | |_____^ help: try: `if let Some(v) = x.as_mut() { *v = 43 }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `expect()` on `Some` value [INFO] [stdout] --> a_standard/src/bin/option.rs:71:13 [INFO] [stdout] | [INFO] [stdout] 71 | let x = x.expect("fruits are healthy"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: remove the `Some` and `expect()` [INFO] [stdout] --> a_standard/src/bin/option.rs:69:13 [INFO] [stdout] | [INFO] [stdout] 69 | let x = Some("value"); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_literal_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_literal_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `x.get(0)` [INFO] [stdout] --> a_standard/src/bin/option.rs:76:16 [INFO] [stdout] | [INFO] [stdout] 76 | let item = x.get(0).expect("slice should not be empty"); [INFO] [stdout] | ^^^^^^^^ help: try: `x.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `unwrap()` on `Some` value [INFO] [stdout] --> a_standard/src/bin/option.rs:83:16 [INFO] [stdout] | [INFO] [stdout] 83 | assert_eq!(x.unwrap(), "air"); [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: remove the `Some` and `unwrap()` [INFO] [stdout] --> a_standard/src/bin/option.rs:82:13 [INFO] [stdout] | [INFO] [stdout] 82 | let x = Some("air"); [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_literal_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `unwrap_or()` on `Some` value [INFO] [stdout] --> a_standard/src/bin/option.rs:91:13 [INFO] [stdout] | [INFO] [stdout] 91 | let x = x.unwrap_or("bike"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: remove the `Some` and `unwrap_or()` [INFO] [stdout] --> a_standard/src/bin/option.rs:90:13 [INFO] [stdout] | [INFO] [stdout] 90 | let x = Some("car"); [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_literal_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `unwrap_or()` on `None` value [INFO] [stdout] --> a_standard/src/bin/option.rs:96:13 [INFO] [stdout] | [INFO] [stdout] 96 | let x = x.unwrap_or("bike"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: remove the `None` and `unwrap_or()` [INFO] [stdout] --> a_standard/src/bin/option.rs:95:27 [INFO] [stdout] | [INFO] [stdout] 95 | let x: Option<&str> = None; [INFO] [stdout] | ^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_literal_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> a_standard/src/bin/res.rs:87:9 [INFO] [stdout] | [INFO] [stdout] 87 | / match num.parse::().map(|i| i * 2) { [INFO] [stdout] 88 | | Ok(n) => println!("{}", n), [INFO] [stdout] 89 | | Err(..) => {} [INFO] [stdout] 90 | | } [INFO] [stdout] | |_________^ help: try: `if let Ok(n) = num.parse::().map(|i| i * 2) { println!("{}", n) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `unwrap_or_else()` on `Some` value [INFO] [stdout] --> a_standard/src/bin/option.rs:103:13 [INFO] [stdout] | [INFO] [stdout] 103 | let x = x.unwrap_or_else(|| 2 * k); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: remove the `Some` and `unwrap_or_else()` [INFO] [stdout] --> a_standard/src/bin/option.rs:102:13 [INFO] [stdout] | [INFO] [stdout] 102 | let x = Some(4); [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_literal_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `unwrap_or_else()` on `None` value [INFO] [stdout] --> a_standard/src/bin/option.rs:108:13 [INFO] [stdout] | [INFO] [stdout] 108 | let x = x.unwrap_or_else(|| 2 * k); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: remove the `None` and `unwrap_or_else()` [INFO] [stdout] --> a_standard/src/bin/option.rs:107:26 [INFO] [stdout] | [INFO] [stdout] 107 | let x: Option = None; [INFO] [stdout] | ^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_literal_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `unwrap_or_default()` on `Some` value [INFO] [stdout] --> a_standard/src/bin/option.rs:115:13 [INFO] [stdout] | [INFO] [stdout] 115 | let x = x.unwrap_or_default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: remove the `Some` and `unwrap_or_default()` [INFO] [stdout] --> a_standard/src/bin/option.rs:114:13 [INFO] [stdout] | [INFO] [stdout] 114 | let x = Some(12); [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_literal_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `unwrap_or_default()` on `None` value [INFO] [stdout] --> a_standard/src/bin/option.rs:120:13 [INFO] [stdout] | [INFO] [stdout] 120 | let x = x.unwrap_or_default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: remove the `None` and `unwrap_or_default()` [INFO] [stdout] --> a_standard/src/bin/option.rs:119:26 [INFO] [stdout] | [INFO] [stdout] 119 | let x: Option = None; [INFO] [stdout] | ^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_literal_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `unwrap_unchecked()` on `Some` value [INFO] [stdout] --> a_standard/src/bin/option.rs:127:22 [INFO] [stdout] | [INFO] [stdout] 127 | let x = unsafe { x.unwrap_unchecked() }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: remove the `Some` and `unwrap_unchecked()` [INFO] [stdout] --> a_standard/src/bin/option.rs:126:13 [INFO] [stdout] | [INFO] [stdout] 126 | let x = Some("air"); [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_literal_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used to substitute value for `Option::None` [INFO] [stdout] --> a_standard/src/bin/option.rs:201:13 [INFO] [stdout] | [INFO] [stdout] 201 | let x = x.ok_or_else(|| 0); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] = note: `#[warn(clippy::unnecessary_lazy_evaluations)]` on by default [INFO] [stdout] help: use `ok_or` instead [INFO] [stdout] | [INFO] [stdout] 201 - let x = x.ok_or_else(|| 0); [INFO] [stdout] 201 + let x = x.ok_or(0); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used to substitute value for `Option::None` [INFO] [stdout] --> a_standard/src/bin/option.rs:206:13 [INFO] [stdout] | [INFO] [stdout] 206 | let x = x.ok_or_else(|| "bar"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] help: use `ok_or` instead [INFO] [stdout] | [INFO] [stdout] 206 - let x = x.ok_or_else(|| "bar"); [INFO] [stdout] 206 + let x = x.ok_or("bar"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `map` over `inspect` [INFO] [stdout] --> a_standard/src/bin/option.rs:225:30 [INFO] [stdout] | [INFO] [stdout] 225 | let x = x.as_deref_mut().map(|x| { [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_inspect [INFO] [stdout] = note: `#[warn(clippy::manual_inspect)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 225 ~ let x = x.as_deref_mut().inspect(|x| { [INFO] [stdout] 226 ~ x.make_ascii_uppercase(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> a_standard/src/bin/option.rs:240:5 [INFO] [stdout] | [INFO] [stdout] 240 | / match x.iter_mut().next() { [INFO] [stdout] 241 | | Some(v) => *v = 42, [INFO] [stdout] 242 | | None => {} [INFO] [stdout] 243 | | } [INFO] [stdout] | |_____^ help: try: `if let Some(v) = x.iter_mut().next() { *v = 42 }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `map` over `inspect` [INFO] [stdout] --> a_standard/src/bin/res.rs:152:26 [INFO] [stdout] | [INFO] [stdout] 152 | x.as_deref_mut().map(|x| { [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_inspect [INFO] [stdout] = note: `#[warn(clippy::manual_inspect)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 152 ~ x.as_deref_mut().inspect(|x| { [INFO] [stdout] 153 ~ x.make_ascii_uppercase(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `arr_2d.get(0)` [INFO] [stdout] --> a_standard/src/bin/option.rs:295:20 [INFO] [stdout] | [INFO] [stdout] 295 | let item_0_1 = arr_2d.get(0).and_then(|row| row.get(1)); [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `arr_2d.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `map` over `inspect` [INFO] [stdout] --> a_standard/src/bin/res.rs:163:26 [INFO] [stdout] | [INFO] [stdout] 163 | x.as_deref_mut().map(|x| { [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_inspect [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 163 ~ x.as_deref_mut().inspect(|x| { [INFO] [stdout] 164 ~ x.make_ascii_uppercase(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `row.get(0)` [INFO] [stdout] --> a_standard/src/bin/option.rs:299:49 [INFO] [stdout] | [INFO] [stdout] 299 | let item_1_0 = arr_2d.get(1).and_then(|row| row.get(0)); [INFO] [stdout] | ^^^^^^^^^^ help: try: `row.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `row.get(0)` [INFO] [stdout] --> a_standard/src/bin/option.rs:303:49 [INFO] [stdout] | [INFO] [stdout] 303 | let item_2_0 = arr_2d.get(2).and_then(|row| row.get(0)); [INFO] [stdout] | ^^^^^^^^^^ help: try: `row.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> a_standard/src/bin/res.rs:179:5 [INFO] [stdout] | [INFO] [stdout] 179 | / match x.iter_mut().next() { [INFO] [stdout] 180 | | Some(v) => *v = 40, [INFO] [stdout] 181 | | None => {} [INFO] [stdout] 182 | | } [INFO] [stdout] | |_____^ help: try: `if let Some(v) = x.iter_mut().next() { *v = 40 }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `1` is never read [INFO] [stdout] --> chapt15_smart_pointer/src/bin/refcell.rs:69:13 [INFO] [stdout] | [INFO] [stdout] 69 | Cons(T, Rc>), [INFO] [stdout] | ---- ^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `List` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 69 - Cons(T, Rc>), [INFO] [stdout] 69 + Cons(T, ()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/option.rs:10:5 [INFO] [stdout] | [INFO] [stdout] 10 | assert_eq!(x, 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] 10 - assert_eq!(x, true); [INFO] [stdout] 10 + assert!(x); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `username` and `age` are never read [INFO] [stdout] --> chapt15_smart_pointer/src/bin/refcell.rs:78:5 [INFO] [stdout] | [INFO] [stdout] 77 | struct User { [INFO] [stdout] | ---- fields in this struct [INFO] [stdout] 78 | username: String, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] 79 | age: usize, [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/option.rs:14:5 [INFO] [stdout] | [INFO] [stdout] 14 | assert_eq!(x, 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] 14 - assert_eq!(x, false); [INFO] [stdout] 14 + assert!(!x); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/option.rs:20:5 [INFO] [stdout] | [INFO] [stdout] 20 | assert_eq!(x, 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] 20 - assert_eq!(x, true); [INFO] [stdout] 20 + assert!(x); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/option.rs:24:5 [INFO] [stdout] | [INFO] [stdout] 24 | assert_eq!(x, 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] 24 - assert_eq!(x, false); [INFO] [stdout] 24 + assert!(!x); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/option.rs:28:5 [INFO] [stdout] | [INFO] [stdout] 28 | assert_eq!(x, 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!(x, false); [INFO] [stdout] 28 + assert!(!x); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/option.rs:33:5 [INFO] [stdout] | [INFO] [stdout] 33 | assert_eq!(x, 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!(x, false); [INFO] [stdout] 33 + assert!(!x); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/option.rs:37:5 [INFO] [stdout] | [INFO] [stdout] 37 | assert_eq!(x, 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] 37 - assert_eq!(x, true); [INFO] [stdout] 37 + assert!(x); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `unwrap()` on `Ok` value [INFO] [stdout] --> a_standard/src/bin/res.rs:196:16 [INFO] [stdout] | [INFO] [stdout] 196 | assert_eq!(x.unwrap(), 2); [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: remove the `Ok` and `unwrap()` [INFO] [stdout] --> a_standard/src/bin/res.rs:195:32 [INFO] [stdout] | [INFO] [stdout] 195 | let x: Result = Ok(2); [INFO] [stdout] | ^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_literal_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_literal_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> a_standard/src/bin/option.rs:48:5 [INFO] [stdout] | [INFO] [stdout] 48 | / match x.as_mut() { [INFO] [stdout] 49 | | Some(v) => *v = 43, [INFO] [stdout] 50 | | None => {} [INFO] [stdout] 51 | | } [INFO] [stdout] | |_____^ help: try: `if let Some(v) = x.as_mut() { *v = 43 }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `unwrap_err()` on `Err` value [INFO] [stdout] --> a_standard/src/bin/res.rs:219:16 [INFO] [stdout] | [INFO] [stdout] 219 | assert_eq!(x.unwrap_err(), "emergency failure"); [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: remove the `Err` and `unwrap_err()` [INFO] [stdout] --> a_standard/src/bin/res.rs:218:32 [INFO] [stdout] | [INFO] [stdout] 218 | let x: Result = Err("emergency failure"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_literal_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `expect()` on `Some` value [INFO] [stdout] --> a_standard/src/bin/option.rs:71:13 [INFO] [stdout] | [INFO] [stdout] 71 | let x = x.expect("fruits are healthy"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: remove the `Some` and `expect()` [INFO] [stdout] --> a_standard/src/bin/option.rs:69:13 [INFO] [stdout] | [INFO] [stdout] 69 | let x = Some("value"); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_literal_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_literal_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `x.get(0)` [INFO] [stdout] --> a_standard/src/bin/option.rs:76:16 [INFO] [stdout] | [INFO] [stdout] 76 | let item = x.get(0).expect("slice should not be empty"); [INFO] [stdout] | ^^^^^^^^ help: try: `x.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `unwrap()` on `Some` value [INFO] [stdout] --> a_standard/src/bin/option.rs:83:16 [INFO] [stdout] | [INFO] [stdout] 83 | assert_eq!(x.unwrap(), "air"); [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: remove the `Some` and `unwrap()` [INFO] [stdout] --> a_standard/src/bin/option.rs:82:13 [INFO] [stdout] | [INFO] [stdout] 82 | let x = Some("air"); [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_literal_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `unwrap_or()` on `Some` value [INFO] [stdout] --> a_standard/src/bin/option.rs:91:13 [INFO] [stdout] | [INFO] [stdout] 91 | let x = x.unwrap_or("bike"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: remove the `Some` and `unwrap_or()` [INFO] [stdout] --> a_standard/src/bin/option.rs:90:13 [INFO] [stdout] | [INFO] [stdout] 90 | let x = Some("car"); [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_literal_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `unwrap_or()` on `None` value [INFO] [stdout] --> a_standard/src/bin/option.rs:96:13 [INFO] [stdout] | [INFO] [stdout] 96 | let x = x.unwrap_or("bike"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: remove the `None` and `unwrap_or()` [INFO] [stdout] --> a_standard/src/bin/option.rs:95:27 [INFO] [stdout] | [INFO] [stdout] 95 | let x: Option<&str> = None; [INFO] [stdout] | ^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_literal_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `unwrap_or_else()` on `Some` value [INFO] [stdout] --> a_standard/src/bin/option.rs:103:13 [INFO] [stdout] | [INFO] [stdout] 103 | let x = x.unwrap_or_else(|| 2 * k); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: remove the `Some` and `unwrap_or_else()` [INFO] [stdout] --> a_standard/src/bin/option.rs:102:13 [INFO] [stdout] | [INFO] [stdout] 102 | let x = Some(4); [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_literal_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `unwrap_or_else()` on `None` value [INFO] [stdout] --> a_standard/src/bin/option.rs:108:13 [INFO] [stdout] | [INFO] [stdout] 108 | let x = x.unwrap_or_else(|| 2 * k); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: remove the `None` and `unwrap_or_else()` [INFO] [stdout] --> a_standard/src/bin/option.rs:107:26 [INFO] [stdout] | [INFO] [stdout] 107 | let x: Option = None; [INFO] [stdout] | ^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_literal_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `unwrap_or_default()` on `Some` value [INFO] [stdout] --> a_standard/src/bin/option.rs:115:13 [INFO] [stdout] | [INFO] [stdout] 115 | let x = x.unwrap_or_default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: remove the `Some` and `unwrap_or_default()` [INFO] [stdout] --> a_standard/src/bin/option.rs:114:13 [INFO] [stdout] | [INFO] [stdout] 114 | let x = Some(12); [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_literal_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `unwrap_or_default()` on `None` value [INFO] [stdout] --> a_standard/src/bin/option.rs:120:13 [INFO] [stdout] | [INFO] [stdout] 120 | let x = x.unwrap_or_default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: remove the `None` and `unwrap_or_default()` [INFO] [stdout] --> a_standard/src/bin/option.rs:119:26 [INFO] [stdout] | [INFO] [stdout] 119 | let x: Option = None; [INFO] [stdout] | ^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_literal_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `unwrap_unchecked()` on `Some` value [INFO] [stdout] --> a_standard/src/bin/option.rs:127:22 [INFO] [stdout] | [INFO] [stdout] 127 | let x = unsafe { x.unwrap_unchecked() }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: remove the `Some` and `unwrap_unchecked()` [INFO] [stdout] --> a_standard/src/bin/option.rs:126:13 [INFO] [stdout] | [INFO] [stdout] 126 | let x = Some("air"); [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_literal_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used to substitute value for `Option::None` [INFO] [stdout] --> a_standard/src/bin/option.rs:395:27 [INFO] [stdout] | [INFO] [stdout] 395 | let y: &mut u32 = x.get_or_insert_with(|| 5); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] help: use `get_or_insert` instead [INFO] [stdout] | [INFO] [stdout] 395 - let y: &mut u32 = x.get_or_insert_with(|| 5); [INFO] [stdout] 395 + let y: &mut u32 = x.get_or_insert(5); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used to substitute value for `Option::None` [INFO] [stdout] --> a_standard/src/bin/option.rs:201:13 [INFO] [stdout] | [INFO] [stdout] 201 | let x = x.ok_or_else(|| 0); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] = note: `#[warn(clippy::unnecessary_lazy_evaluations)]` on by default [INFO] [stdout] help: use `ok_or` instead [INFO] [stdout] | [INFO] [stdout] 201 - let x = x.ok_or_else(|| 0); [INFO] [stdout] 201 + let x = x.ok_or(0); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used to substitute value for `Option::None` [INFO] [stdout] --> a_standard/src/bin/option.rs:206:13 [INFO] [stdout] | [INFO] [stdout] 206 | let x = x.ok_or_else(|| "bar"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] help: use `ok_or` instead [INFO] [stdout] | [INFO] [stdout] 206 - let x = x.ok_or_else(|| "bar"); [INFO] [stdout] 206 + let x = x.ok_or("bar"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `map` over `inspect` [INFO] [stdout] --> a_standard/src/bin/option.rs:225:30 [INFO] [stdout] | [INFO] [stdout] 225 | let x = x.as_deref_mut().map(|x| { [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_inspect [INFO] [stdout] = note: `#[warn(clippy::manual_inspect)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 225 ~ let x = x.as_deref_mut().inspect(|x| { [INFO] [stdout] 226 ~ x.make_ascii_uppercase(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> a_standard/src/bin/option.rs:240:5 [INFO] [stdout] | [INFO] [stdout] 240 | / match x.iter_mut().next() { [INFO] [stdout] 241 | | Some(v) => *v = 42, [INFO] [stdout] 242 | | None => {} [INFO] [stdout] 243 | | } [INFO] [stdout] | |_____^ help: try: `if let Some(v) = x.iter_mut().next() { *v = 42 }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `arr_2d.get(0)` [INFO] [stdout] --> a_standard/src/bin/option.rs:295:20 [INFO] [stdout] | [INFO] [stdout] 295 | let item_0_1 = arr_2d.get(0).and_then(|row| row.get(1)); [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `arr_2d.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `row.get(0)` [INFO] [stdout] --> a_standard/src/bin/option.rs:299:49 [INFO] [stdout] | [INFO] [stdout] 299 | let item_1_0 = arr_2d.get(1).and_then(|row| row.get(0)); [INFO] [stdout] | ^^^^^^^^^^ help: try: `row.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `row.get(0)` [INFO] [stdout] --> a_standard/src/bin/option.rs:303:49 [INFO] [stdout] | [INFO] [stdout] 303 | let item_2_0 = arr_2d.get(2).and_then(|row| row.get(0)); [INFO] [stdout] | ^^^^^^^^^^ help: try: `row.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> a_standard/src/bin/option.rs:138:16 [INFO] [stdout] | [INFO] [stdout] 138 | let list = vec![1, 2, 3]; [INFO] [stdout] | ^^^^^^^^^^^^^ help: you can use an array directly: `[1, 2, 3]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used to substitute value for `Option::None` [INFO] [stdout] --> a_standard/src/bin/option.rs:395:27 [INFO] [stdout] | [INFO] [stdout] 395 | let y: &mut u32 = x.get_or_insert_with(|| 5); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] help: use `get_or_insert` instead [INFO] [stdout] | [INFO] [stdout] 395 - let y: &mut u32 = x.get_or_insert_with(|| 5); [INFO] [stdout] 395 + let y: &mut u32 = x.get_or_insert(5); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> a_standard/src/bin/option.rs:138:16 [INFO] [stdout] | [INFO] [stdout] 138 | let list = vec![1, 2, 3]; [INFO] [stdout] | ^^^^^^^^^^^^^ help: you can use an array directly: `[1, 2, 3]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `unwrap_or()` on `Ok` value [INFO] [stdout] --> a_standard/src/bin/res.rs:302:16 [INFO] [stdout] | [INFO] [stdout] 302 | assert_eq!(x.unwrap_or(default), 9); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: remove the `Ok` and `unwrap_or()` [INFO] [stdout] --> a_standard/src/bin/res.rs:301:32 [INFO] [stdout] | [INFO] [stdout] 301 | let x: Result = Ok(9); [INFO] [stdout] | ^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_literal_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `unwrap_or()` on `Err` value [INFO] [stdout] --> a_standard/src/bin/res.rs:305:16 [INFO] [stdout] | [INFO] [stdout] 305 | assert_eq!(x.unwrap_or(default), default); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: remove the `Err` and `unwrap_or()` [INFO] [stdout] --> a_standard/src/bin/res.rs:304:32 [INFO] [stdout] | [INFO] [stdout] 304 | let x: Result = Err("error"); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_literal_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `unwrap_or_else()` on `Ok` value [INFO] [stdout] --> a_standard/src/bin/res.rs:308:16 [INFO] [stdout] | [INFO] [stdout] 308 | assert_eq!(Ok(2).unwrap_or_else(|x| x), 2); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_literal_unwrap [INFO] [stdout] help: remove the `Ok` and `unwrap_or_else()` [INFO] [stdout] | [INFO] [stdout] 308 - assert_eq!(Ok(2).unwrap_or_else(|x| x), 2); [INFO] [stdout] 308 + assert_eq!(2, 2); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `unwrap_or_else()` on `Err` value [INFO] [stdout] --> a_standard/src/bin/res.rs:309:16 [INFO] [stdout] | [INFO] [stdout] 309 | assert_eq!(Err("foo").unwrap_or_else(|x| x.len()), 3); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_literal_unwrap [INFO] [stdout] help: remove the `Err` and `unwrap_or_else()` [INFO] [stdout] | [INFO] [stdout] 309 - assert_eq!(Err("foo").unwrap_or_else(|x| x.len()), 3); [INFO] [stdout] 309 + assert_eq!("foo", 3); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `unwrap_unchecked()` on `Ok` value [INFO] [stdout] --> a_standard/src/bin/res.rs:313:25 [INFO] [stdout] | [INFO] [stdout] 313 | assert_eq!(unsafe { x.unwrap_unchecked() }, 2); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: remove the `Ok` and `unwrap_unchecked()` [INFO] [stdout] --> a_standard/src/bin/res.rs:312:32 [INFO] [stdout] | [INFO] [stdout] 312 | let x: Result = Ok(2); [INFO] [stdout] | ^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_literal_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `unwrap_err_unchecked()` on `Err` value [INFO] [stdout] --> a_standard/src/bin/res.rs:325:25 [INFO] [stdout] | [INFO] [stdout] 325 | assert_eq!(unsafe { x.unwrap_err_unchecked() }, "emergency failure"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: remove the `Err` and `unwrap_err_unchecked()` [INFO] [stdout] --> a_standard/src/bin/res.rs:324:32 [INFO] [stdout] | [INFO] [stdout] 324 | let x: Result = Err("emergency failure"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_literal_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the feature `const_slice_flatten` has been stable since 1.87.0 and no longer requires an attribute to enable [INFO] [stdout] --> a_standard/src/bin/vect.rs:7:5 [INFO] [stdout] | [INFO] [stdout] 7 | const_slice_flatten, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(stable_features)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the feature `slice_as_chunks` has been stable since 1.88.0 and no longer requires an attribute to enable [INFO] [stdout] --> a_standard/src/bin/vect.rs:11:5 [INFO] [stdout] | [INFO] [stdout] 11 | slice_as_chunks [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the feature `extract_if` has been stable since 1.87.0 and no longer requires an attribute to enable [INFO] [stdout] --> a_standard/src/bin/vect.rs:8:5 [INFO] [stdout] | [INFO] [stdout] 8 | extract_if, [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the feature `vec_into_raw_parts` has been stable since 1.93.0 and no longer requires an attribute to enable [INFO] [stdout] --> a_standard/src/bin/vect.rs:3:5 [INFO] [stdout] | [INFO] [stdout] 3 | vec_into_raw_parts, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the feature `vec_pop_if` has been stable since 1.86.0 and no longer requires an attribute to enable [INFO] [stdout] --> a_standard/src/bin/vect.rs:5:5 [INFO] [stdout] | [INFO] [stdout] 5 | vec_pop_if, [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.iter().nth()` on a slice [INFO] [stdout] --> a_standard/src/bin/iterator.rs:69:16 [INFO] [stdout] | [INFO] [stdout] 69 | assert_eq!(a.iter().nth(1), Some(&2)); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth [INFO] [stdout] = note: `#[warn(clippy::iter_nth)]` on by default [INFO] [stdout] help: `get` is equivalent but more concise [INFO] [stdout] | [INFO] [stdout] 69 - assert_eq!(a.iter().nth(1), Some(&2)); [INFO] [stdout] 69 + assert_eq!(a.get(1), Some(&2)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.iter().nth()` on a slice [INFO] [stdout] --> a_standard/src/bin/iterator.rs:79:16 [INFO] [stdout] | [INFO] [stdout] 79 | assert_eq!(a.iter().nth(10), None); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth [INFO] [stdout] help: `get` is equivalent but more concise [INFO] [stdout] | [INFO] [stdout] 79 - assert_eq!(a.iter().nth(10), None); [INFO] [stdout] 79 + assert_eq!(a.get(10), None); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `filter` for `Ok` followed by `unwrap` [INFO] [stdout] --> a_standard/src/bin/iterator.rs:264:10 [INFO] [stdout] | [INFO] [stdout] 264 | .filter(|s| s.is_ok()) [INFO] [stdout] | __________^ [INFO] [stdout] 265 | | .map(|s| s.unwrap()); [INFO] [stdout] | |____________________________^ help: consider using `flatten` instead: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_filter_map [INFO] [stdout] = note: `#[warn(clippy::result_filter_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.take()` call takes more items than the iterator will produce [INFO] [stdout] --> a_standard/src/bin/iterator.rs:473:20 [INFO] [stdout] | [INFO] [stdout] 473 | let mut iter = v.into_iter().take(5); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: this operation is useless and the returned iterator will simply yield the same items [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_out_of_bounds [INFO] [stdout] = note: `#[warn(clippy::iter_out_of_bounds)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> a_standard/src/bin/iterator.rs:486:9 [INFO] [stdout] | [INFO] [stdout] 486 | *state = *state * x; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: replace it with: `*state *= x` [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: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> a_standard/src/bin/iterator.rs:521:39 [INFO] [stdout] | [INFO] [stdout] 521 | let merged: String = words.iter().map(|s| s.chars()).flatten().collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|s| s.chars())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] = note: `#[warn(clippy::map_flatten)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.fold` can be written more succinctly using another method [INFO] [stdout] --> a_standard/src/bin/iterator.rs:569:10 [INFO] [stdout] | [INFO] [stdout] 569 | .fold(0, |sum, i| sum + i); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `sum::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold [INFO] [stdout] = note: `#[warn(clippy::unnecessary_fold)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.fold` can be written more succinctly using another method [INFO] [stdout] --> a_standard/src/bin/iterator.rs:579:10 [INFO] [stdout] | [INFO] [stdout] 579 | .fold(0, |sum, i| sum + i); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `sum::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.fold` can be written more succinctly using another method [INFO] [stdout] --> a_standard/src/bin/iterator.rs:747:24 [INFO] [stdout] | [INFO] [stdout] 747 | let sum = a.iter().fold(0, |acc, x| acc + x); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `sum::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> a_standard/src/bin/iterator.rs:767:9 [INFO] [stdout] | [INFO] [stdout] 767 | result = result + i; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: replace it with: `result += i` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.fold` can be written more succinctly using another method [INFO] [stdout] --> a_standard/src/bin/iterator.rs:771:34 [INFO] [stdout] | [INFO] [stdout] 771 | let result2 = numbers.iter().fold(0, |acc, &x| acc + x); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `sum::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.fold` can be written more succinctly using another method [INFO] [stdout] --> a_standard/src/bin/iterator.rs:780:26 [INFO] [stdout] | [INFO] [stdout] 780 | let folded = (1..10).fold(0, |acc, e| acc + e); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `sum::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0282]: type annotations needed [INFO] [stdout] --> a_standard/src/bin/vect.rs:707:37 [INFO] [stdout] | [INFO] [stdout] 707 | let evens = numbers.extract_if(|x| *x % 2 == 0).collect::>(); [INFO] [stdout] | ^ -- type must be known at this point [INFO] [stdout] | [INFO] [stdout] help: consider giving this closure parameter an explicit type [INFO] [stdout] | [INFO] [stdout] 707 | let evens = numbers.extract_if(|x: /* Type */| *x % 2 == 0).collect::>(); [INFO] [stdout] | ++++++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `iter().copied().collect()` on a slice to create a `Vec`. Calling `to_vec()` is both faster and more readable [INFO] [stdout] --> a_standard/src/bin/iterator.rs:942:21 [INFO] [stdout] | [INFO] [stdout] 942 | let v_copied = a.iter().copied().collect::>(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `.to_vec()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_cloned_collect [INFO] [stdout] = note: `#[warn(clippy::iter_cloned_collect)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> a_standard/src/bin/iterator.rs:945:17 [INFO] [stdout] | [INFO] [stdout] 945 | let v_map = a.iter().map(|&x| x).collect::>(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `a.iter().copied()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] = note: `#[warn(clippy::map_clone)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0061]: this method takes 2 arguments but 1 argument was supplied [INFO] [stdout] --> a_standard/src/bin/vect.rs:707:25 [INFO] [stdout] | [INFO] [stdout] 707 | let evens = numbers.extract_if(|x| *x % 2 == 0).collect::>(); [INFO] [stdout] | ^^^^^^^^^^----------------- argument #2 is missing [INFO] [stdout] | [INFO] [stdout] note: method defined here [INFO] [stdout] --> /rustc/3645249d79dfb136b5d8de3ce153d19d6698d92d/library/alloc/src/vec/mod.rs:4167:11 [INFO] [stdout] help: provide the argument [INFO] [stdout] | [INFO] [stdout] 707 | let evens = numbers.extract_if(|x| *x % 2 == 0, /* filter */).collect::>(); [INFO] [stdout] | ++++++++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `iter().cloned().collect()` on a slice to create a `Vec`. Calling `to_vec()` is both faster and more readable [INFO] [stdout] --> a_standard/src/bin/iterator.rs:955:21 [INFO] [stdout] | [INFO] [stdout] 955 | let v_cloned = a.iter().cloned().collect::>(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `.to_vec()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_cloned_collect [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> a_standard/src/bin/iterator.rs:958:17 [INFO] [stdout] | [INFO] [stdout] 958 | let v_map = a.iter().map(|&x| x).collect::>(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `a.iter().copied()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessarily eager cloning of iterator items [INFO] [stdout] --> a_standard/src/bin/iterator.rs:968:18 [INFO] [stdout] | [INFO] [stdout] 968 | let slower = a [INFO] [stdout] | ___________________^ [INFO] [stdout] 969 | | .iter() [INFO] [stdout] | | ________________- [INFO] [stdout] 970 | || .cloned() [INFO] [stdout] 971 | || .filter(|s| s.len() == 1) [INFO] [stdout] | ||_________________________________^ [INFO] [stdout] | |_________________________________| [INFO] [stdout] | help: try: `.filter(|&s| s.len() == 1).cloned()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_overeager_cloned [INFO] [stdout] = note: `#[warn(clippy::iter_overeager_cloned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/iterator.rs:1047:5 [INFO] [stdout] | [INFO] [stdout] 1047 | assert_eq!([1].iter().eq([1].iter()), 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] 1047 - assert_eq!([1].iter().eq([1].iter()), true); [INFO] [stdout] 1047 + assert!([1].iter().eq([1].iter())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/iterator.rs:1048:5 [INFO] [stdout] | [INFO] [stdout] 1048 | assert_eq!([1].iter().eq([1, 2].iter()), 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] 1048 - assert_eq!([1].iter().eq([1, 2].iter()), false); [INFO] [stdout] 1048 + assert!(![1].iter().eq([1, 2].iter())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/iterator.rs:1051:5 [INFO] [stdout] | [INFO] [stdout] 1051 | assert_eq!([1].iter().ne([1].iter()), 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] 1051 - assert_eq!([1].iter().ne([1].iter()), false); [INFO] [stdout] 1051 + assert!(![1].iter().ne([1].iter())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/iterator.rs:1052:5 [INFO] [stdout] | [INFO] [stdout] 1052 | assert_eq!([1].iter().ne([1, 2].iter()), 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] 1052 - assert_eq!([1].iter().ne([1, 2].iter()), true); [INFO] [stdout] 1052 + assert!([1].iter().ne([1, 2].iter())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/iterator.rs:1055:5 [INFO] [stdout] | [INFO] [stdout] 1055 | assert_eq!([1].iter().lt([1].iter()), 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] 1055 - assert_eq!([1].iter().lt([1].iter()), false); [INFO] [stdout] 1055 + assert!(![1].iter().lt([1].iter())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/iterator.rs:1056:5 [INFO] [stdout] | [INFO] [stdout] 1056 | assert_eq!([1].iter().lt([1, 2].iter()), 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] 1056 - assert_eq!([1].iter().lt([1, 2].iter()), true); [INFO] [stdout] 1056 + assert!([1].iter().lt([1, 2].iter())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/iterator.rs:1057:5 [INFO] [stdout] | [INFO] [stdout] 1057 | assert_eq!([1, 2].iter().lt([1].iter()), 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] 1057 - assert_eq!([1, 2].iter().lt([1].iter()), false); [INFO] [stdout] 1057 + assert!(![1, 2].iter().lt([1].iter())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/iterator.rs:1058:5 [INFO] [stdout] | [INFO] [stdout] 1058 | assert_eq!([1, 2].iter().lt([1, 2].iter()), 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] 1058 - assert_eq!([1, 2].iter().lt([1, 2].iter()), false); [INFO] [stdout] 1058 + assert!(![1, 2].iter().lt([1, 2].iter())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/iterator.rs:1061:5 [INFO] [stdout] | [INFO] [stdout] 1061 | assert_eq!([1].iter().le([1].iter()), 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] 1061 - assert_eq!([1].iter().le([1].iter()), true); [INFO] [stdout] 1061 + assert!([1].iter().le([1].iter())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/iterator.rs:1062:5 [INFO] [stdout] | [INFO] [stdout] 1062 | assert_eq!([1].iter().le([1, 2].iter()), 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] 1062 - assert_eq!([1].iter().le([1, 2].iter()), true); [INFO] [stdout] 1062 + assert!([1].iter().le([1, 2].iter())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/iterator.rs:1063:5 [INFO] [stdout] | [INFO] [stdout] 1063 | assert_eq!([1, 2].iter().le([1].iter()), 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] 1063 - assert_eq!([1, 2].iter().le([1].iter()), false); [INFO] [stdout] 1063 + assert!(![1, 2].iter().le([1].iter())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/iterator.rs:1064:5 [INFO] [stdout] | [INFO] [stdout] 1064 | assert_eq!([1, 2].iter().le([1, 2].iter()), 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] 1064 - assert_eq!([1, 2].iter().le([1, 2].iter()), true); [INFO] [stdout] 1064 + assert!([1, 2].iter().le([1, 2].iter())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/iterator.rs:1067:5 [INFO] [stdout] | [INFO] [stdout] 1067 | assert_eq!([1].iter().gt([1].iter()), 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] 1067 - assert_eq!([1].iter().gt([1].iter()), false); [INFO] [stdout] 1067 + assert!(![1].iter().gt([1].iter())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/iterator.rs:1068:5 [INFO] [stdout] | [INFO] [stdout] 1068 | assert_eq!([1].iter().gt([1, 2].iter()), 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] 1068 - assert_eq!([1].iter().gt([1, 2].iter()), false); [INFO] [stdout] 1068 + assert!(![1].iter().gt([1, 2].iter())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/iterator.rs:1069:5 [INFO] [stdout] | [INFO] [stdout] 1069 | assert_eq!([1, 2].iter().gt([1].iter()), 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] 1069 - assert_eq!([1, 2].iter().gt([1].iter()), true); [INFO] [stdout] 1069 + assert!([1, 2].iter().gt([1].iter())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/iterator.rs:1070:5 [INFO] [stdout] | [INFO] [stdout] 1070 | assert_eq!([1, 2].iter().gt([1, 2].iter()), 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] 1070 - assert_eq!([1, 2].iter().gt([1, 2].iter()), false); [INFO] [stdout] 1070 + assert!(![1, 2].iter().gt([1, 2].iter())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/iterator.rs:1073:5 [INFO] [stdout] | [INFO] [stdout] 1073 | assert_eq!([1].iter().ge([1].iter()), 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] 1073 - assert_eq!([1].iter().ge([1].iter()), true); [INFO] [stdout] 1073 + assert!([1].iter().ge([1].iter())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/iterator.rs:1074:5 [INFO] [stdout] | [INFO] [stdout] 1074 | assert_eq!([1].iter().ge([1, 2].iter()), 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] 1074 - assert_eq!([1].iter().ge([1, 2].iter()), false); [INFO] [stdout] 1074 + assert!(![1].iter().ge([1, 2].iter())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/iterator.rs:1075:5 [INFO] [stdout] | [INFO] [stdout] 1075 | assert_eq!([1, 2].iter().ge([1].iter()), 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] 1075 - assert_eq!([1, 2].iter().ge([1].iter()), true); [INFO] [stdout] 1075 + assert!([1, 2].iter().ge([1].iter())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/iterator.rs:1076:5 [INFO] [stdout] | [INFO] [stdout] 1076 | assert_eq!([1, 2].iter().ge([1, 2].iter()), 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] 1076 - assert_eq!([1, 2].iter().ge([1, 2].iter()), true); [INFO] [stdout] 1076 + assert!([1, 2].iter().ge([1, 2].iter())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> a_standard/src/bin/iterator.rs:1091:9 [INFO] [stdout] | [INFO] [stdout] 1091 | self.state = self.state + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `self.state += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0277]: the trait bound `u32: std::ops::Neg` is not satisfied [INFO] [stdout] --> a_standard/src/bin/vect.rs:226:18 [INFO] [stdout] | [INFO] [stdout] 226 | let v = vec![-1, 0, 1]; [INFO] [stdout] | ^^ the trait `std::ops::Neg` is not implemented for `u32` [INFO] [stdout] | [INFO] [stdout] help: consider specifying an integer type that can be negative [INFO] [stdout] | [INFO] [stdout] 226 | let v = vec![-1i32, 0, 1]; [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.iter().nth()` on a slice [INFO] [stdout] --> a_standard/src/bin/iterator.rs:69:16 [INFO] [stdout] | [INFO] [stdout] 69 | assert_eq!(a.iter().nth(1), Some(&2)); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth [INFO] [stdout] = note: `#[warn(clippy::iter_nth)]` on by default [INFO] [stdout] help: `get` is equivalent but more concise [INFO] [stdout] | [INFO] [stdout] 69 - assert_eq!(a.iter().nth(1), Some(&2)); [INFO] [stdout] 69 + assert_eq!(a.get(1), Some(&2)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.iter().nth()` on a slice [INFO] [stdout] --> a_standard/src/bin/iterator.rs:79:16 [INFO] [stdout] | [INFO] [stdout] 79 | assert_eq!(a.iter().nth(10), None); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth [INFO] [stdout] help: `get` is equivalent but more concise [INFO] [stdout] | [INFO] [stdout] 79 - assert_eq!(a.iter().nth(10), None); [INFO] [stdout] 79 + assert_eq!(a.get(10), None); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] Some errors have detailed explanations: E0061, E0277, E0282. [INFO] [stdout] [INFO] [stdout] For more information about an error, try `rustc --explain E0061`. [INFO] [stdout] [INFO] [stderr] error: could not compile `a_standard` (bin "vect") due to 3 previous errors; 5 warnings emitted [INFO] [stdout] warning: `filter` for `Ok` followed by `unwrap` [INFO] [stdout] --> a_standard/src/bin/iterator.rs:264:10 [INFO] [stdout] | [INFO] [stdout] 264 | .filter(|s| s.is_ok()) [INFO] [stdout] | __________^ [INFO] [stdout] 265 | | .map(|s| s.unwrap()); [INFO] [stdout] | |____________________________^ help: consider using `flatten` instead: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_filter_map [INFO] [stdout] = note: `#[warn(clippy::result_filter_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.take()` call takes more items than the iterator will produce [INFO] [stdout] --> a_standard/src/bin/iterator.rs:473:20 [INFO] [stdout] | [INFO] [stdout] 473 | let mut iter = v.into_iter().take(5); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: this operation is useless and the returned iterator will simply yield the same items [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_out_of_bounds [INFO] [stdout] = note: `#[warn(clippy::iter_out_of_bounds)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> a_standard/src/bin/iterator.rs:486:9 [INFO] [stdout] | [INFO] [stdout] 486 | *state = *state * x; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: replace it with: `*state *= x` [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: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> a_standard/src/bin/iterator.rs:521:39 [INFO] [stdout] | [INFO] [stdout] 521 | let merged: String = words.iter().map(|s| s.chars()).flatten().collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|s| s.chars())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] = note: `#[warn(clippy::map_flatten)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.fold` can be written more succinctly using another method [INFO] [stdout] --> a_standard/src/bin/iterator.rs:569:10 [INFO] [stdout] | [INFO] [stdout] 569 | .fold(0, |sum, i| sum + i); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `sum::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold [INFO] [stdout] = note: `#[warn(clippy::unnecessary_fold)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.fold` can be written more succinctly using another method [INFO] [stdout] --> a_standard/src/bin/iterator.rs:579:10 [INFO] [stdout] | [INFO] [stdout] 579 | .fold(0, |sum, i| sum + i); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `sum::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.fold` can be written more succinctly using another method [INFO] [stdout] --> a_standard/src/bin/iterator.rs:747:24 [INFO] [stdout] | [INFO] [stdout] 747 | let sum = a.iter().fold(0, |acc, x| acc + x); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `sum::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> a_standard/src/bin/iterator.rs:767:9 [INFO] [stdout] | [INFO] [stdout] 767 | result = result + i; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: replace it with: `result += i` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.fold` can be written more succinctly using another method [INFO] [stdout] --> a_standard/src/bin/iterator.rs:771:34 [INFO] [stdout] | [INFO] [stdout] 771 | let result2 = numbers.iter().fold(0, |acc, &x| acc + x); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `sum::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.fold` can be written more succinctly using another method [INFO] [stdout] --> a_standard/src/bin/iterator.rs:780:26 [INFO] [stdout] | [INFO] [stdout] 780 | let folded = (1..10).fold(0, |acc, e| acc + e); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `sum::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0277]: the trait bound `u32: std::ops::Neg` is not satisfied [INFO] [stdout] --> a_standard/src/bin/vect.rs:226:18 [INFO] [stdout] | [INFO] [stdout] 226 | let v = vec![-1, 0, 1]; [INFO] [stdout] | ^^ the trait `std::ops::Neg` is not implemented for `u32` [INFO] [stdout] | [INFO] [stdout] help: consider specifying an integer type that can be negative [INFO] [stdout] | [INFO] [stdout] 226 | let v = vec![-1i32, 0, 1]; [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `iter().copied().collect()` on a slice to create a `Vec`. Calling `to_vec()` is both faster and more readable [INFO] [stdout] --> a_standard/src/bin/iterator.rs:942:21 [INFO] [stdout] | [INFO] [stdout] 942 | let v_copied = a.iter().copied().collect::>(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `.to_vec()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_cloned_collect [INFO] [stdout] = note: `#[warn(clippy::iter_cloned_collect)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> a_standard/src/bin/iterator.rs:945:17 [INFO] [stdout] | [INFO] [stdout] 945 | let v_map = a.iter().map(|&x| x).collect::>(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `a.iter().copied()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] = note: `#[warn(clippy::map_clone)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `iter().cloned().collect()` on a slice to create a `Vec`. Calling `to_vec()` is both faster and more readable [INFO] [stdout] --> a_standard/src/bin/iterator.rs:955:21 [INFO] [stdout] | [INFO] [stdout] 955 | let v_cloned = a.iter().cloned().collect::>(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `.to_vec()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_cloned_collect [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> a_standard/src/bin/iterator.rs:958:17 [INFO] [stdout] | [INFO] [stdout] 958 | let v_map = a.iter().map(|&x| x).collect::>(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `a.iter().copied()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessarily eager cloning of iterator items [INFO] [stdout] --> a_standard/src/bin/iterator.rs:968:18 [INFO] [stdout] | [INFO] [stdout] 968 | let slower = a [INFO] [stdout] | ___________________^ [INFO] [stdout] 969 | | .iter() [INFO] [stdout] | | ________________- [INFO] [stdout] 970 | || .cloned() [INFO] [stdout] 971 | || .filter(|s| s.len() == 1) [INFO] [stdout] | ||_________________________________^ [INFO] [stdout] | |_________________________________| [INFO] [stdout] | help: try: `.filter(|&s| s.len() == 1).cloned()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_overeager_cloned [INFO] [stdout] = note: `#[warn(clippy::iter_overeager_cloned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/iterator.rs:1047:5 [INFO] [stdout] | [INFO] [stdout] 1047 | assert_eq!([1].iter().eq([1].iter()), 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] 1047 - assert_eq!([1].iter().eq([1].iter()), true); [INFO] [stdout] 1047 + assert!([1].iter().eq([1].iter())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/iterator.rs:1048:5 [INFO] [stdout] | [INFO] [stdout] 1048 | assert_eq!([1].iter().eq([1, 2].iter()), 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] 1048 - assert_eq!([1].iter().eq([1, 2].iter()), false); [INFO] [stdout] 1048 + assert!(![1].iter().eq([1, 2].iter())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/iterator.rs:1051:5 [INFO] [stdout] | [INFO] [stdout] 1051 | assert_eq!([1].iter().ne([1].iter()), 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] 1051 - assert_eq!([1].iter().ne([1].iter()), false); [INFO] [stdout] 1051 + assert!(![1].iter().ne([1].iter())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/iterator.rs:1052:5 [INFO] [stdout] | [INFO] [stdout] 1052 | assert_eq!([1].iter().ne([1, 2].iter()), 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] 1052 - assert_eq!([1].iter().ne([1, 2].iter()), true); [INFO] [stdout] 1052 + assert!([1].iter().ne([1, 2].iter())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/iterator.rs:1055:5 [INFO] [stdout] | [INFO] [stdout] 1055 | assert_eq!([1].iter().lt([1].iter()), 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] 1055 - assert_eq!([1].iter().lt([1].iter()), false); [INFO] [stdout] 1055 + assert!(![1].iter().lt([1].iter())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/iterator.rs:1056:5 [INFO] [stdout] | [INFO] [stdout] 1056 | assert_eq!([1].iter().lt([1, 2].iter()), 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] 1056 - assert_eq!([1].iter().lt([1, 2].iter()), true); [INFO] [stdout] 1056 + assert!([1].iter().lt([1, 2].iter())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/iterator.rs:1057:5 [INFO] [stdout] | [INFO] [stdout] 1057 | assert_eq!([1, 2].iter().lt([1].iter()), 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] 1057 - assert_eq!([1, 2].iter().lt([1].iter()), false); [INFO] [stdout] 1057 + assert!(![1, 2].iter().lt([1].iter())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/iterator.rs:1058:5 [INFO] [stdout] | [INFO] [stdout] 1058 | assert_eq!([1, 2].iter().lt([1, 2].iter()), 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] 1058 - assert_eq!([1, 2].iter().lt([1, 2].iter()), false); [INFO] [stdout] 1058 + assert!(![1, 2].iter().lt([1, 2].iter())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/iterator.rs:1061:5 [INFO] [stdout] | [INFO] [stdout] 1061 | assert_eq!([1].iter().le([1].iter()), 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] 1061 - assert_eq!([1].iter().le([1].iter()), true); [INFO] [stdout] 1061 + assert!([1].iter().le([1].iter())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/iterator.rs:1062:5 [INFO] [stdout] | [INFO] [stdout] 1062 | assert_eq!([1].iter().le([1, 2].iter()), 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] 1062 - assert_eq!([1].iter().le([1, 2].iter()), true); [INFO] [stdout] 1062 + assert!([1].iter().le([1, 2].iter())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/iterator.rs:1063:5 [INFO] [stdout] | [INFO] [stdout] 1063 | assert_eq!([1, 2].iter().le([1].iter()), 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] 1063 - assert_eq!([1, 2].iter().le([1].iter()), false); [INFO] [stdout] 1063 + assert!(![1, 2].iter().le([1].iter())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/iterator.rs:1064:5 [INFO] [stdout] | [INFO] [stdout] 1064 | assert_eq!([1, 2].iter().le([1, 2].iter()), 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] 1064 - assert_eq!([1, 2].iter().le([1, 2].iter()), true); [INFO] [stdout] 1064 + assert!([1, 2].iter().le([1, 2].iter())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/iterator.rs:1067:5 [INFO] [stdout] | [INFO] [stdout] 1067 | assert_eq!([1].iter().gt([1].iter()), 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] 1067 - assert_eq!([1].iter().gt([1].iter()), false); [INFO] [stdout] 1067 + assert!(![1].iter().gt([1].iter())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/iterator.rs:1068:5 [INFO] [stdout] | [INFO] [stdout] 1068 | assert_eq!([1].iter().gt([1, 2].iter()), 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] 1068 - assert_eq!([1].iter().gt([1, 2].iter()), false); [INFO] [stdout] 1068 + assert!(![1].iter().gt([1, 2].iter())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/iterator.rs:1069:5 [INFO] [stdout] | [INFO] [stdout] 1069 | assert_eq!([1, 2].iter().gt([1].iter()), 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] 1069 - assert_eq!([1, 2].iter().gt([1].iter()), true); [INFO] [stdout] 1069 + assert!([1, 2].iter().gt([1].iter())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/iterator.rs:1070:5 [INFO] [stdout] | [INFO] [stdout] 1070 | assert_eq!([1, 2].iter().gt([1, 2].iter()), 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] 1070 - assert_eq!([1, 2].iter().gt([1, 2].iter()), false); [INFO] [stdout] 1070 + assert!(![1, 2].iter().gt([1, 2].iter())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/iterator.rs:1073:5 [INFO] [stdout] | [INFO] [stdout] 1073 | assert_eq!([1].iter().ge([1].iter()), 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] 1073 - assert_eq!([1].iter().ge([1].iter()), true); [INFO] [stdout] 1073 + assert!([1].iter().ge([1].iter())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/iterator.rs:1074:5 [INFO] [stdout] | [INFO] [stdout] 1074 | assert_eq!([1].iter().ge([1, 2].iter()), 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] 1074 - assert_eq!([1].iter().ge([1, 2].iter()), false); [INFO] [stdout] 1074 + assert!(![1].iter().ge([1, 2].iter())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/iterator.rs:1075:5 [INFO] [stdout] | [INFO] [stdout] 1075 | assert_eq!([1, 2].iter().ge([1].iter()), 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] 1075 - assert_eq!([1, 2].iter().ge([1].iter()), true); [INFO] [stdout] 1075 + assert!([1, 2].iter().ge([1].iter())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> a_standard/src/bin/iterator.rs:1076:5 [INFO] [stdout] | [INFO] [stdout] 1076 | assert_eq!([1, 2].iter().ge([1, 2].iter()), 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] 1076 - assert_eq!([1, 2].iter().ge([1, 2].iter()), true); [INFO] [stdout] 1076 + assert!([1, 2].iter().ge([1, 2].iter())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> a_standard/src/bin/iterator.rs:1091:9 [INFO] [stdout] | [INFO] [stdout] 1091 | self.state = self.state + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `self.state += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] Some errors have detailed explanations: E0061, E0277, E0282. [INFO] [stdout] [INFO] [stdout] For more information about an error, try `rustc --explain E0061`. [INFO] [stdout] [INFO] [stderr] error: could not compile `a_standard` (bin "vect" test) due to 3 previous errors; 5 warnings emitted [INFO] running `Command { std: "docker" "inspect" "0e583ac1fe0abc3e7136ac09f420544f46be5130553ddbc676981ad63105b84f", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "0e583ac1fe0abc3e7136ac09f420544f46be5130553ddbc676981ad63105b84f", kill_on_drop: false }` [INFO] [stdout] 0e583ac1fe0abc3e7136ac09f420544f46be5130553ddbc676981ad63105b84f