[INFO] cloning repository https://github.com/cbbfcd/fuck-leetcode [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/cbbfcd/fuck-leetcode" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fcbbfcd%2Ffuck-leetcode", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fcbbfcd%2Ffuck-leetcode'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] a13b0586be03daed9952c53f7b036f8eeef2d63f [INFO] linting cbbfcd/fuck-leetcode against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fcbbfcd%2Ffuck-leetcode" "/workspace/builds/worker-6-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-6-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/cbbfcd/fuck-leetcode [INFO] finished tweaking git repo https://github.com/cbbfcd/fuck-leetcode [INFO] tweaked toml for git repo https://github.com/cbbfcd/fuck-leetcode written to /workspace/builds/worker-6-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/cbbfcd/fuck-leetcode 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/cbbfcd/fuck-leetcode already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Updating crates.io index [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded leetcode_test v0.1.2 [INFO] [stderr] Downloaded leetcode_prelude v0.2.3 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-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] 4878173e5e0b84f34d8c66fe16ba3e54fd0c5cd661b9e14842adf2958a80e6d4 [INFO] running `Command { std: "docker" "start" "-a" "4878173e5e0b84f34d8c66fe16ba3e54fd0c5cd661b9e14842adf2958a80e6d4", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "4878173e5e0b84f34d8c66fe16ba3e54fd0c5cd661b9e14842adf2958a80e6d4", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "4878173e5e0b84f34d8c66fe16ba3e54fd0c5cd661b9e14842adf2958a80e6d4", kill_on_drop: false }` [INFO] [stdout] 4878173e5e0b84f34d8c66fe16ba3e54fd0c5cd661b9e14842adf2958a80e6d4 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-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] bff21e4cae9abd7e52b18cc31f723a706ab6b1b06db5e4b14306f85d0304a7e8 [INFO] running `Command { std: "docker" "start" "-a" "bff21e4cae9abd7e52b18cc31f723a706ab6b1b06db5e4b14306f85d0304a7e8", kill_on_drop: false }` [INFO] [stderr] Compiling autocfg v0.1.7 [INFO] [stderr] Checking rand_core v0.4.2 [INFO] [stderr] Compiling ryu v1.0.5 [INFO] [stderr] Compiling serde v1.0.126 [INFO] [stderr] Compiling libc v0.2.95 [INFO] [stderr] Compiling serde_json v1.0.64 [INFO] [stderr] Compiling itoa v0.4.7 [INFO] [stderr] Compiling rand_chacha v0.1.1 [INFO] [stderr] Checking rand_core v0.3.1 [INFO] [stderr] Compiling rand_pcg v0.1.2 [INFO] [stderr] Compiling rand v0.6.5 [INFO] [stderr] Checking rand_jitter v0.1.4 [INFO] [stderr] Checking rand_xorshift v0.1.1 [INFO] [stderr] Checking rand_hc v0.1.0 [INFO] [stderr] Checking rand_isaac v0.1.1 [INFO] [stderr] Checking rand_os v0.1.3 [INFO] [stderr] Compiling leetcode_test v0.1.2 [INFO] [stderr] Checking leetcode_prelude v0.2.3 [INFO] [stderr] Checking fuck-leetcode v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: fields `a` and `b` are never read [INFO] [stdout] --> src/two_stack_2_queue.rs:4:3 [INFO] [stdout] | [INFO] [stdout] 3 | pub struct CQueue { [INFO] [stdout] | ------ fields in this struct [INFO] [stdout] 4 | a: Vec, [INFO] [stdout] | ^ [INFO] [stdout] 5 | b: Vec [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 items `new`, `append_tail`, and `delete_head` are never used [INFO] [stdout] --> src/two_stack_2_queue.rs:13:6 [INFO] [stdout] | [INFO] [stdout] 12 | impl CQueue { [INFO] [stdout] | ----------- associated items in this implementation [INFO] [stdout] 13 | fn new() -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 19 | fn append_tail(&mut self, value: i32) { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 22 | fn delete_head(&mut self) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `nums` [INFO] [stdout] --> src/find_repeat_number.rs:38:12 [INFO] [stdout] | [INFO] [stdout] 38 | for i in 0..nums.len() { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 38 - for i in 0..nums.len() { [INFO] [stdout] 38 + for in &nums { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `matrix` [INFO] [stdout] --> src/find_number_in2_d_array.rs:21:14 [INFO] [stdout] | [INFO] [stdout] 21 | for i in 0..matrix.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 21 - for i in 0..matrix.len() { [INFO] [stdout] 21 + for in &matrix { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is only used to index `matrix` [INFO] [stdout] --> src/find_number_in2_d_array.rs:22:16 [INFO] [stdout] | [INFO] [stdout] 22 | for j in 0..matrix[i].len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 22 - for j in 0..matrix[i].len() { [INFO] [stdout] 22 + for in matrix.iter().take(matrix[i].len()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is only used to index `matrix` [INFO] [stdout] --> src/find_number_in2_d_array.rs:36:14 [INFO] [stdout] | [INFO] [stdout] 36 | for j in 0..matrix.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 36 - for j in 0..matrix.len() { [INFO] [stdout] 36 + for in &matrix { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `new_vec` [INFO] [stdout] --> src/find_number_in2_d_array.rs:40:14 [INFO] [stdout] | [INFO] [stdout] 40 | for i in 0..new_vec.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 40 - for i in 0..new_vec.len() { [INFO] [stdout] 40 + for in &new_vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/find_number_in2_d_array.rs:60:8 [INFO] [stdout] | [INFO] [stdout] 60 | if matrix.len() == 0 || matrix[0].len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `matrix.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/find_number_in2_d_array.rs:60:29 [INFO] [stdout] | [INFO] [stdout] 60 | if matrix.len() == 0 || matrix[0].len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `matrix[0].is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/replace_space.rs:10:5 [INFO] [stdout] | [INFO] [stdout] 10 | return s.replace(" ", "%20"); [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] 10 - return s.replace(" ", "%20"); [INFO] [stdout] 10 + s.replace(" ", "%20") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/inorder_traversal.rs:60:13 [INFO] [stdout] | [INFO] [stdout] 60 | while !root.is_none() || stack.len() != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `root.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 boolean expression can be simplified [INFO] [stdout] --> src/inorder_traversal.rs:61:15 [INFO] [stdout] | [INFO] [stdout] 61 | while !root.is_none() { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `root.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] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/inorder_traversal.rs:60:32 [INFO] [stdout] | [INFO] [stdout] 60 | while !root.is_none() || stack.len() != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!stack.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/two_stack_2_queue.rs:14:5 [INFO] [stdout] | [INFO] [stdout] 14 | / return CQueue { [INFO] [stdout] 15 | | a: Vec::new(), [INFO] [stdout] 16 | | b: Vec::new() [INFO] [stdout] 17 | | } [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] 14 ~ CQueue { [INFO] [stdout] 15 + a: Vec::new(), [INFO] [stdout] 16 + b: Vec::new() [INFO] [stdout] 17 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/two_stack_2_queue.rs:29:5 [INFO] [stdout] | [INFO] [stdout] 29 | return self.b.pop().unwrap_or(-1); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 29 - return self.b.pop().unwrap_or(-1); [INFO] [stdout] 29 + self.b.pop().unwrap_or(-1) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty line after doc comment [INFO] [stdout] --> src/two_stack_2_queue.rs:33:1 [INFO] [stdout] | [INFO] [stdout] 33 | / /** [INFO] [stdout] 34 | | * Your CQueue object will be instantiated and called as such: [INFO] [stdout] 35 | | * let obj = CQueue::new(); [INFO] [stdout] 36 | | * obj.append_tail(value); [INFO] [stdout] 37 | | * let ret_2: i32 = obj.delete_head(); [INFO] [stdout] 38 | | */ [INFO] [stdout] 39 | | [INFO] [stdout] | |_^ [INFO] [stdout] 40 | #[cfg(test)] [INFO] [stdout] 41 | mod test { [INFO] [stdout] | -------- the comment documents this module [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] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `nums` [INFO] [stdout] --> src/find_repeat_number.rs:38:12 [INFO] [stdout] | [INFO] [stdout] 38 | for i in 0..nums.len() { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 38 - for i in 0..nums.len() { [INFO] [stdout] 38 + for in &nums { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `matrix` [INFO] [stdout] --> src/find_number_in2_d_array.rs:21:14 [INFO] [stdout] | [INFO] [stdout] 21 | for i in 0..matrix.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 21 - for i in 0..matrix.len() { [INFO] [stdout] 21 + for in &matrix { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is only used to index `matrix` [INFO] [stdout] --> src/find_number_in2_d_array.rs:22:16 [INFO] [stdout] | [INFO] [stdout] 22 | for j in 0..matrix[i].len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 22 - for j in 0..matrix[i].len() { [INFO] [stdout] 22 + for in matrix.iter().take(matrix[i].len()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is only used to index `matrix` [INFO] [stdout] --> src/find_number_in2_d_array.rs:36:14 [INFO] [stdout] | [INFO] [stdout] 36 | for j in 0..matrix.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 36 - for j in 0..matrix.len() { [INFO] [stdout] 36 + for in &matrix { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `new_vec` [INFO] [stdout] --> src/find_number_in2_d_array.rs:40:14 [INFO] [stdout] | [INFO] [stdout] 40 | for i in 0..new_vec.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 40 - for i in 0..new_vec.len() { [INFO] [stdout] 40 + for in &new_vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/find_number_in2_d_array.rs:60:8 [INFO] [stdout] | [INFO] [stdout] 60 | if matrix.len() == 0 || matrix[0].len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `matrix.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/find_number_in2_d_array.rs:60:29 [INFO] [stdout] | [INFO] [stdout] 60 | if matrix.len() == 0 || matrix[0].len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `matrix[0].is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/find_number_in2_d_array.rs:91:5 [INFO] [stdout] | [INFO] [stdout] 91 | assert_eq!(Solution::find_number_in2_d_array(matrix.clone(), 5), 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] 91 - assert_eq!(Solution::find_number_in2_d_array(matrix.clone(), 5), true); [INFO] [stdout] 91 + assert!(Solution::find_number_in2_d_array(matrix.clone(), 5)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/find_number_in2_d_array.rs:92:5 [INFO] [stdout] | [INFO] [stdout] 92 | assert_eq!(Solution::find_number_in2_d_array(matrix.clone(), 20), false); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 92 - assert_eq!(Solution::find_number_in2_d_array(matrix.clone(), 20), false); [INFO] [stdout] 92 + assert!(!Solution::find_number_in2_d_array(matrix.clone(), 20)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/find_number_in2_d_array.rs:93:5 [INFO] [stdout] | [INFO] [stdout] 93 | assert_eq!(Solution::find_number_in2_d_array_01(matrix.clone(), 5), true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 93 - assert_eq!(Solution::find_number_in2_d_array_01(matrix.clone(), 5), true); [INFO] [stdout] 93 + assert!(Solution::find_number_in2_d_array_01(matrix.clone(), 5)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/find_number_in2_d_array.rs:94:5 [INFO] [stdout] | [INFO] [stdout] 94 | assert_eq!(Solution::find_number_in2_d_array_01(matrix.clone(), 20), false); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 94 - assert_eq!(Solution::find_number_in2_d_array_01(matrix.clone(), 20), false); [INFO] [stdout] 94 + assert!(!Solution::find_number_in2_d_array_01(matrix.clone(), 20)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/find_number_in2_d_array.rs:95:5 [INFO] [stdout] | [INFO] [stdout] 95 | assert_eq!(Solution::find_number_in2_d_array_02(matrix.clone(), 5), 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] 95 - assert_eq!(Solution::find_number_in2_d_array_02(matrix.clone(), 5), true); [INFO] [stdout] 95 + assert!(Solution::find_number_in2_d_array_02(matrix.clone(), 5)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/find_number_in2_d_array.rs:96:5 [INFO] [stdout] | [INFO] [stdout] 96 | assert_eq!(Solution::find_number_in2_d_array_02(matrix.clone(), 20), 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] 96 - assert_eq!(Solution::find_number_in2_d_array_02(matrix.clone(), 20), false); [INFO] [stdout] 96 + assert!(!Solution::find_number_in2_d_array_02(matrix.clone(), 20)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/find_number_in2_d_array.rs:97:5 [INFO] [stdout] | [INFO] [stdout] 97 | assert_eq!(Solution::find_number_in2_d_array_02(vec![vec![-5]], -5), 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] 97 - assert_eq!(Solution::find_number_in2_d_array_02(vec![vec![-5]], -5), true); [INFO] [stdout] 97 + assert!(Solution::find_number_in2_d_array_02(vec![vec![-5]], -5)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/replace_space.rs:10:5 [INFO] [stdout] | [INFO] [stdout] 10 | return s.replace(" ", "%20"); [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] 10 - return s.replace(" ", "%20"); [INFO] [stdout] 10 + s.replace(" ", "%20") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/inorder_traversal.rs:60:13 [INFO] [stdout] | [INFO] [stdout] 60 | while !root.is_none() || stack.len() != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `root.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 boolean expression can be simplified [INFO] [stdout] --> src/inorder_traversal.rs:61:15 [INFO] [stdout] | [INFO] [stdout] 61 | while !root.is_none() { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `root.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] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/inorder_traversal.rs:60:32 [INFO] [stdout] | [INFO] [stdout] 60 | while !root.is_none() || stack.len() != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!stack.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/two_stack_2_queue.rs:14:5 [INFO] [stdout] | [INFO] [stdout] 14 | / return CQueue { [INFO] [stdout] 15 | | a: Vec::new(), [INFO] [stdout] 16 | | b: Vec::new() [INFO] [stdout] 17 | | } [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] 14 ~ CQueue { [INFO] [stdout] 15 + a: Vec::new(), [INFO] [stdout] 16 + b: Vec::new() [INFO] [stdout] 17 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/two_stack_2_queue.rs:29:5 [INFO] [stdout] | [INFO] [stdout] 29 | return self.b.pop().unwrap_or(-1); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 29 - return self.b.pop().unwrap_or(-1); [INFO] [stdout] 29 + self.b.pop().unwrap_or(-1) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 7.24s [INFO] running `Command { std: "docker" "inspect" "bff21e4cae9abd7e52b18cc31f723a706ab6b1b06db5e4b14306f85d0304a7e8", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "bff21e4cae9abd7e52b18cc31f723a706ab6b1b06db5e4b14306f85d0304a7e8", kill_on_drop: false }` [INFO] [stdout] bff21e4cae9abd7e52b18cc31f723a706ab6b1b06db5e4b14306f85d0304a7e8