[INFO] cloning repository https://github.com/AmberCrafter/Rust-leetcode [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/AmberCrafter/Rust-leetcode" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FAmberCrafter%2FRust-leetcode", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FAmberCrafter%2FRust-leetcode'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] ad98fdb6dc954c8e9530d19edb222ec447f70ecd [INFO] linting AmberCrafter/Rust-leetcode against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FAmberCrafter%2FRust-leetcode" "/workspace/builds/worker-2-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-2-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/AmberCrafter/Rust-leetcode [INFO] finished tweaking git repo https://github.com/AmberCrafter/Rust-leetcode [INFO] tweaked toml for git repo https://github.com/AmberCrafter/Rust-leetcode written to /workspace/builds/worker-2-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/AmberCrafter/Rust-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/AmberCrafter/Rust-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] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-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] 127a73e6c851e5cbff89bf0b8eefaa33842b025fdcb473aef948c661e55b1288 [INFO] running `Command { std: "docker" "start" "-a" "127a73e6c851e5cbff89bf0b8eefaa33842b025fdcb473aef948c661e55b1288", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "127a73e6c851e5cbff89bf0b8eefaa33842b025fdcb473aef948c661e55b1288", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "127a73e6c851e5cbff89bf0b8eefaa33842b025fdcb473aef948c661e55b1288", kill_on_drop: false }` [INFO] [stdout] 127a73e6c851e5cbff89bf0b8eefaa33842b025fdcb473aef948c661e55b1288 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-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] 1dc56851d715b256c679f1035c9844129e0031419809a6126b3dbc9d24e4f7a2 [INFO] running `Command { std: "docker" "start" "-a" "1dc56851d715b256c679f1035c9844129e0031419809a6126b3dbc9d24e4f7a2", kill_on_drop: false }` [INFO] [stderr] Checking leetcode v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: found module declaration for lib.rs [INFO] [stdout] --> src/main.rs:1:1 [INFO] [stdout] | [INFO] [stdout] 1 | mod lib; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: lib.rs is the root of this crate's library target [INFO] [stdout] = help: to refer to it from other targets, use the library's name as the path [INFO] [stdout] = note: `#[warn(special_module_name)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses [INFO] [stdout] --> src/problems/no123_best_time_to_buy_and_sell_stock_iii.rs:35:25 [INFO] [stdout] | [INFO] [stdout] 35 | lt[j] = ((gt[j-1] + diff.max(0))).max(lt[j] + diff); // choosing 0 menas no bought stock yesterday or before yesterday [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove them: `(gt[j-1] + diff.max(0))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_parens [INFO] [stdout] = note: `#[warn(clippy::double_parens)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `>= y + 1` or `x - 1 >=` [INFO] [stdout] --> src/problems/no132_palindrome_partitioning_ii.rs:28:19 [INFO] [stdout] | [INFO] [stdout] 28 | while i>=half_len+1 && i+half_len half_len` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#int_plus_one [INFO] [stdout] = note: `#[warn(clippy::int_plus_one)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::collections::HashMap` [INFO] [stdout] --> src/problems/no139_word_break.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use std::collections::HashMap; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::ops::Deref` [INFO] [stdout] --> src/problems/no147_insertion_sort_list.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use std::ops::Deref; [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::collections::HashMap` [INFO] [stdout] --> src/problems/no149_max_points_on_a_line.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use std::collections::HashMap; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary trailing semicolon [INFO] [stdout] --> src/problems/no150_evaluate_reverse_polish_natation.rs:21:33 [INFO] [stdout] | [INFO] [stdout] 21 | stack.push(tmp2 / tmp1);; [INFO] [stdout] | ^ help: remove this semicolon [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(redundant_semicolons)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `core::num` [INFO] [stdout] --> src/problems/no68_text_justification.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use core::num; [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `core::slice` [INFO] [stdout] --> src/problems/no75_sort_colors.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use core::slice; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around function argument [INFO] [stdout] --> src/problems/no85_maximal_rectangle.rs:10:47 [INFO] [stdout] | [INFO] [stdout] 10 | let mut histogram: Vec = vec![0; (matrix[0].len() + 2)]; [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_parens)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 10 - let mut histogram: Vec = vec![0; (matrix[0].len() + 2)]; [INFO] [stdout] 10 + let mut histogram: Vec = vec![0; matrix[0].len() + 2 ]; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: found module declaration for lib.rs [INFO] [stdout] --> src/main.rs:1:1 [INFO] [stdout] | [INFO] [stdout] 1 | mod lib; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: lib.rs is the root of this crate's library target [INFO] [stdout] = help: to refer to it from other targets, use the library's name as the path [INFO] [stdout] = note: `#[warn(special_module_name)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `crate::lib::treenode` [INFO] [stdout] --> src/problems/no107_binary_tree_level_order_traversal_ii.rs:60:13 [INFO] [stdout] | [INFO] [stdout] 60 | use crate::lib::treenode; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses [INFO] [stdout] --> src/problems/no123_best_time_to_buy_and_sell_stock_iii.rs:35:25 [INFO] [stdout] | [INFO] [stdout] 35 | lt[j] = ((gt[j-1] + diff.max(0))).max(lt[j] + diff); // choosing 0 menas no bought stock yesterday or before yesterday [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove them: `(gt[j-1] + diff.max(0))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_parens [INFO] [stdout] = note: `#[warn(clippy::double_parens)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `>= y + 1` or `x - 1 >=` [INFO] [stdout] --> src/problems/no132_palindrome_partitioning_ii.rs:28:19 [INFO] [stdout] | [INFO] [stdout] 28 | while i>=half_len+1 && i+half_len half_len` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#int_plus_one [INFO] [stdout] = note: `#[warn(clippy::int_plus_one)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::collections::HashMap` [INFO] [stdout] --> src/problems/no139_word_break.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use std::collections::HashMap; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty line after doc comment [INFO] [stdout] --> src/problems/no146_lru_cache.rs:188:1 [INFO] [stdout] | [INFO] [stdout] 188 | / /** [INFO] [stdout] 189 | | * Your LRUCache object will be instantiated and called as such: [INFO] [stdout] 190 | | * let obj = LRUCache::new(capacity); [INFO] [stdout] 191 | | * let ret_1: i32 = obj.get(key); [INFO] [stdout] 192 | | * obj.put(key, value); [INFO] [stdout] 193 | | */ [INFO] [stdout] 194 | | [INFO] [stdout] | |_^ [INFO] [stdout] 195 | #[cfg(test)] [INFO] [stdout] 196 | 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: unused import: `std::ops::Deref` [INFO] [stdout] --> src/problems/no147_insertion_sort_list.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use std::ops::Deref; [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::collections::HashMap` [INFO] [stdout] --> src/problems/no149_max_points_on_a_line.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use std::collections::HashMap; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary trailing semicolon [INFO] [stdout] --> src/problems/no150_evaluate_reverse_polish_natation.rs:21:33 [INFO] [stdout] | [INFO] [stdout] 21 | stack.push(tmp2 / tmp1);; [INFO] [stdout] | ^ help: remove this semicolon [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(redundant_semicolons)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty line after doc comment [INFO] [stdout] --> src/problems/no155_min_stack.rs:39:1 [INFO] [stdout] | [INFO] [stdout] 39 | / /** [INFO] [stdout] 40 | | * Your MinStack object will be instantiated and called as such: [INFO] [stdout] 41 | | * let obj = MinStack::new(); [INFO] [stdout] 42 | | * obj.push(val); [INFO] [stdout] ... | [INFO] [stdout] 46 | | */ [INFO] [stdout] 47 | | [INFO] [stdout] | |_^ [INFO] [stdout] 48 | #[cfg(test)] [INFO] [stdout] 49 | 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] = help: if the empty line is unintentional, remove it [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `core::num` [INFO] [stdout] --> src/problems/no68_text_justification.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use core::num; [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `core::slice` [INFO] [stdout] --> src/problems/no75_sort_colors.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use core::slice; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around function argument [INFO] [stdout] --> src/problems/no85_maximal_rectangle.rs:10:47 [INFO] [stdout] | [INFO] [stdout] 10 | let mut histogram: Vec = vec![0; (matrix[0].len() + 2)]; [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_parens)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 10 - let mut histogram: Vec = vec![0; (matrix[0].len() + 2)]; [INFO] [stdout] 10 + let mut histogram: Vec = vec![0; matrix[0].len() + 2 ]; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `null_value` [INFO] [stdout] --> src/lib/treenode.rs:22:39 [INFO] [stdout] | [INFO] [stdout] 22 | pub fn layer_gen(array: Vec, null_value: i32) -> Option>> { [INFO] [stdout] | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_null_value` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `val` is never read [INFO] [stdout] --> src/problems/no113_path_sum_ii.rs:33:27 [INFO] [stdout] | [INFO] [stdout] 33 | let mut val = 0; [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] = note: `#[warn(unused_assignments)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/problems/no115_distinct_subsequence.rs:19:13 [INFO] [stdout] | [INFO] [stdout] 19 | let mut repeat_times = 0; [INFO] [stdout] | ----^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `repeat_times` [INFO] [stdout] --> src/problems/no115_distinct_subsequence.rs:19:13 [INFO] [stdout] | [INFO] [stdout] 19 | let mut repeat_times = 0; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_repeat_times` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/problems/no118_pascals_triangle.rs:14:25 [INFO] [stdout] | [INFO] [stdout] 14 | let mut prev_vec = res.last().unwrap(); [INFO] [stdout] | ----^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `i` [INFO] [stdout] --> src/problems/no118_pascals_triangle.rs:12:21 [INFO] [stdout] | [INFO] [stdout] 12 | for i in 2..num_rows { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_i` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/problems/no148_sort_list.rs:20:14 [INFO] [stdout] | [INFO] [stdout] 20 | fn merge(mut left: Option>, mut right: Option>) -> Option> { [INFO] [stdout] | ----^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/problems/no148_sort_list.rs:20:47 [INFO] [stdout] | [INFO] [stdout] 20 | fn merge(mut left: Option>, mut right: Option>) -> Option> { [INFO] [stdout] | ----^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: irrefutable `while let` pattern [INFO] [stdout] --> src/problems/no165_compare_version_numbers.rs:38:15 [INFO] [stdout] | [INFO] [stdout] 38 | while let (v1, v2) = (v1_iter.next(), v2_iter.next()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: this pattern will always match, so the loop will never exit [INFO] [stdout] = help: consider instead using a `loop { ... }` with a `let` inside it [INFO] [stdout] = note: `#[warn(irrefutable_let_patterns)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unreachable pattern [INFO] [stdout] --> src/problems/no67_add_binary.rs:19:21 [INFO] [stdout] | [INFO] [stdout] 18 | val => val - 48, [INFO] [stdout] | --- matches any value [INFO] [stdout] 19 | _ => 0, [INFO] [stdout] | ^ no value can reach this [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unreachable_patterns)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unreachable pattern [INFO] [stdout] --> src/problems/no67_add_binary.rs:27:21 [INFO] [stdout] | [INFO] [stdout] 26 | val => val - 48, [INFO] [stdout] | --- matches any value [INFO] [stdout] 27 | _ => 0, [INFO] [stdout] | ^ no value can reach this [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/problems/no67_add_binary.rs:8:13 [INFO] [stdout] | [INFO] [stdout] 8 | let mut a = a.as_bytes(); [INFO] [stdout] | ----^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/problems/no67_add_binary.rs:9:13 [INFO] [stdout] | [INFO] [stdout] 9 | let mut b = b.as_bytes(); [INFO] [stdout] | ----^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `space` is never read [INFO] [stdout] --> src/problems/no68_text_justification.rs:18:29 [INFO] [stdout] | [INFO] [stdout] 18 | let mut space = "".to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/problems/no74_search_matrix.rs:5:13 [INFO] [stdout] | [INFO] [stdout] 5 | let mut ncol = matrix[0].len(); [INFO] [stdout] | ----^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `right` [INFO] [stdout] --> src/problems/no75_sort_colors.rs:46:17 [INFO] [stdout] | [INFO] [stdout] 46 | let right = right + 1; [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_right` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/problems/no77_combine.rs:19:13 [INFO] [stdout] | [INFO] [stdout] 19 | let mut count = 0; [INFO] [stdout] | ----^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `count` [INFO] [stdout] --> src/problems/no77_combine.rs:19:13 [INFO] [stdout] | [INFO] [stdout] 19 | let mut count = 0; [INFO] [stdout] | ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_count` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `i` [INFO] [stdout] --> src/problems/no90_subsets_ii.rs:17:13 [INFO] [stdout] | [INFO] [stdout] 17 | for i in 0..map[0].1 { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_i` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `TreeNode` is never constructed [INFO] [stdout] --> src/lib/treenode.rs:6:12 [INFO] [stdout] | [INFO] [stdout] 6 | pub struct TreeNode { [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 functions `new` and `layer_gen` are never used [INFO] [stdout] --> src/lib/treenode.rs:14:12 [INFO] [stdout] | [INFO] [stdout] 12 | impl TreeNode { [INFO] [stdout] | ------------- associated functions in this implementation [INFO] [stdout] 13 | #[inline] [INFO] [stdout] 14 | pub fn new(val: i32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 22 | pub fn layer_gen(array: Vec, null_value: i32) -> Option>> { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait `Generator` is never used [INFO] [stdout] --> src/lib/treenode.rs:58:11 [INFO] [stdout] | [INFO] [stdout] 58 | pub trait Generator { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no100_same_tree.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 3 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `TreeNode` is never constructed [INFO] [stdout] --> src/problems/no100_same_tree.rs:6:12 [INFO] [stdout] | [INFO] [stdout] 6 | pub struct TreeNode { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/problems/no100_same_tree.rs:14:12 [INFO] [stdout] | [INFO] [stdout] 12 | impl TreeNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 13 | #[inline] [INFO] [stdout] 14 | pub fn new(val: i32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `is_same_tree` is never used [INFO] [stdout] --> src/problems/no100_same_tree.rs:23:12 [INFO] [stdout] | [INFO] [stdout] 22 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 23 | pub fn is_same_tree( [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no101_symmetric_tree.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 3 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `TreeNode` is never constructed [INFO] [stdout] --> src/problems/no101_symmetric_tree.rs:6:12 [INFO] [stdout] | [INFO] [stdout] 6 | pub struct TreeNode { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/problems/no101_symmetric_tree.rs:14:12 [INFO] [stdout] | [INFO] [stdout] 12 | impl TreeNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 13 | #[inline] [INFO] [stdout] 14 | pub fn new(val: i32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `is_symmetric` is never used [INFO] [stdout] --> src/problems/no101_symmetric_tree.rs:23:12 [INFO] [stdout] | [INFO] [stdout] 22 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 23 | pub fn is_symmetric(root: Option>>) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no102_binary_tree_level_order_traversal.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 3 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `TreeNode` is never constructed [INFO] [stdout] --> src/problems/no102_binary_tree_level_order_traversal.rs:6:12 [INFO] [stdout] | [INFO] [stdout] 6 | pub struct TreeNode { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/problems/no102_binary_tree_level_order_traversal.rs:14:12 [INFO] [stdout] | [INFO] [stdout] 12 | impl TreeNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 13 | #[inline] [INFO] [stdout] 14 | pub fn new(val: i32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `level_order` is never used [INFO] [stdout] --> src/problems/no102_binary_tree_level_order_traversal.rs:26:12 [INFO] [stdout] | [INFO] [stdout] 25 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 26 | pub fn level_order(root: Option>>) -> Vec> { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no103_binary_tree_zigzag_level_order_traversal.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 3 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `TreeNode` is never constructed [INFO] [stdout] --> src/problems/no103_binary_tree_zigzag_level_order_traversal.rs:6:12 [INFO] [stdout] | [INFO] [stdout] 6 | pub struct TreeNode { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/problems/no103_binary_tree_zigzag_level_order_traversal.rs:14:12 [INFO] [stdout] | [INFO] [stdout] 12 | impl TreeNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 13 | #[inline] [INFO] [stdout] 14 | pub fn new(val: i32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `zigzag_level_order` is never used [INFO] [stdout] --> src/problems/no103_binary_tree_zigzag_level_order_traversal.rs:26:12 [INFO] [stdout] | [INFO] [stdout] 25 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 26 | pub fn zigzag_level_order(root: Option>>) -> Vec> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no104_maximum_depth_of_binary_tree.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 3 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `TreeNode` is never constructed [INFO] [stdout] --> src/problems/no104_maximum_depth_of_binary_tree.rs:6:12 [INFO] [stdout] | [INFO] [stdout] 6 | pub struct TreeNode { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/problems/no104_maximum_depth_of_binary_tree.rs:14:12 [INFO] [stdout] | [INFO] [stdout] 12 | impl TreeNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 13 | #[inline] [INFO] [stdout] 14 | pub fn new(val: i32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `max_depth` is never used [INFO] [stdout] --> src/problems/no104_maximum_depth_of_binary_tree.rs:23:12 [INFO] [stdout] | [INFO] [stdout] 22 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 23 | pub fn max_depth(root: Option>>) -> i32 { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no105_construct_binary_tree_from_preorder_and_inorder_traversal.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `TreeNode` is never constructed [INFO] [stdout] --> src/problems/no105_construct_binary_tree_from_preorder_and_inorder_traversal.rs:4:12 [INFO] [stdout] | [INFO] [stdout] 4 | pub struct TreeNode { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/problems/no105_construct_binary_tree_from_preorder_and_inorder_traversal.rs:12:12 [INFO] [stdout] | [INFO] [stdout] 10 | impl TreeNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 11 | #[inline] [INFO] [stdout] 12 | pub fn new(val: i32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `build_tree` is never used [INFO] [stdout] --> src/problems/no105_construct_binary_tree_from_preorder_and_inorder_traversal.rs:25:12 [INFO] [stdout] | [INFO] [stdout] 23 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 24 | // ref. https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/discuss/962765/Rust-recursive [INFO] [stdout] 25 | pub fn build_tree(preorder: Vec, inorder: Vec) -> Option>> { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no106_construct_binary_tree_from_inorder_and_postorder_traversal.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 3 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `TreeNode` is never constructed [INFO] [stdout] --> src/problems/no106_construct_binary_tree_from_inorder_and_postorder_traversal.rs:6:12 [INFO] [stdout] | [INFO] [stdout] 6 | pub struct TreeNode { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/problems/no106_construct_binary_tree_from_inorder_and_postorder_traversal.rs:14:12 [INFO] [stdout] | [INFO] [stdout] 12 | impl TreeNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 13 | #[inline] [INFO] [stdout] 14 | pub fn new(val: i32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `build_tree` is never used [INFO] [stdout] --> src/problems/no106_construct_binary_tree_from_inorder_and_postorder_traversal.rs:23:12 [INFO] [stdout] | [INFO] [stdout] 22 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 23 | pub fn build_tree(inorder: Vec, postorder: Vec) -> Option>> { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no107_binary_tree_level_order_traversal_ii.rs:4:12 [INFO] [stdout] | [INFO] [stdout] 4 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `TreeNode` is never constructed [INFO] [stdout] --> src/problems/no107_binary_tree_level_order_traversal_ii.rs:7:12 [INFO] [stdout] | [INFO] [stdout] 7 | pub struct TreeNode { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/problems/no107_binary_tree_level_order_traversal_ii.rs:15:12 [INFO] [stdout] | [INFO] [stdout] 13 | impl TreeNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 14 | #[inline] [INFO] [stdout] 15 | pub fn new(val: i32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `level_order_bottom` is never used [INFO] [stdout] --> src/problems/no107_binary_tree_level_order_traversal_ii.rs:24:12 [INFO] [stdout] | [INFO] [stdout] 23 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 24 | pub fn level_order_bottom(root: Option>>) -> Vec> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `layer_gen` is never used [INFO] [stdout] --> src/problems/no107_binary_tree_level_order_traversal_ii.rs:69:8 [INFO] [stdout] | [INFO] [stdout] 68 | impl TreeNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 69 | fn layer_gen(array: Vec) -> Option>> { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no108_convert_sorted_array_to_binary_search.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 3 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `TreeNode` is never constructed [INFO] [stdout] --> src/problems/no108_convert_sorted_array_to_binary_search.rs:6:12 [INFO] [stdout] | [INFO] [stdout] 6 | pub struct TreeNode { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/problems/no108_convert_sorted_array_to_binary_search.rs:14:12 [INFO] [stdout] | [INFO] [stdout] 12 | impl TreeNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 13 | #[inline] [INFO] [stdout] 14 | pub fn new(val: i32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `sorted_array_to_bst` is never used [INFO] [stdout] --> src/problems/no108_convert_sorted_array_to_binary_search.rs:23:12 [INFO] [stdout] | [INFO] [stdout] 22 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 23 | pub fn sorted_array_to_bst(nums: Vec) -> Option>> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `layer_gen` is never used [INFO] [stdout] --> src/problems/no108_convert_sorted_array_to_binary_search.rs:56:8 [INFO] [stdout] | [INFO] [stdout] 55 | impl TreeNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 56 | fn layer_gen(array: Vec) -> Option>> { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no109_convert_sorted_list_to_binary_search_tree.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 3 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `ListNode` is never constructed [INFO] [stdout] --> src/problems/no109_convert_sorted_list_to_binary_search_tree.rs:6:12 [INFO] [stdout] | [INFO] [stdout] 6 | pub struct ListNode { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/problems/no109_convert_sorted_list_to_binary_search_tree.rs:13:8 [INFO] [stdout] | [INFO] [stdout] 11 | impl ListNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 12 | #[inline] [INFO] [stdout] 13 | fn new(val: i32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `TreeNode` is never constructed [INFO] [stdout] --> src/problems/no109_convert_sorted_list_to_binary_search_tree.rs:19:12 [INFO] [stdout] | [INFO] [stdout] 19 | pub struct TreeNode { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/problems/no109_convert_sorted_list_to_binary_search_tree.rs:27:12 [INFO] [stdout] | [INFO] [stdout] 25 | impl TreeNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 26 | #[inline] [INFO] [stdout] 27 | pub fn new(val: i32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `sorted_list_to_bst` is never used [INFO] [stdout] --> src/problems/no109_convert_sorted_list_to_binary_search_tree.rs:37:12 [INFO] [stdout] | [INFO] [stdout] 36 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 37 | pub fn sorted_list_to_bst(head: Option>) -> Option>> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no110_balanced_binary_tree.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 3 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `TreeNode` is never constructed [INFO] [stdout] --> src/problems/no110_balanced_binary_tree.rs:6:12 [INFO] [stdout] | [INFO] [stdout] 6 | pub struct TreeNode { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/problems/no110_balanced_binary_tree.rs:14:12 [INFO] [stdout] | [INFO] [stdout] 12 | impl TreeNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 13 | #[inline] [INFO] [stdout] 14 | pub fn new(val: i32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `is_balanced` is never used [INFO] [stdout] --> src/problems/no110_balanced_binary_tree.rs:23:12 [INFO] [stdout] | [INFO] [stdout] 22 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 23 | pub fn is_balanced(root: Option>>) -> bool { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `layer_gen` is never used [INFO] [stdout] --> src/problems/no110_balanced_binary_tree.rs:71:8 [INFO] [stdout] | [INFO] [stdout] 70 | impl TreeNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 71 | fn layer_gen(array: Vec) -> Option>> { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no111_minimum_depth_of_binary_tree.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 3 | pub struct Solution; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `TreeNode` is never constructed [INFO] [stdout] --> src/problems/no111_minimum_depth_of_binary_tree.rs:6:12 [INFO] [stdout] | [INFO] [stdout] 6 | pub struct TreeNode { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/problems/no111_minimum_depth_of_binary_tree.rs:14:12 [INFO] [stdout] | [INFO] [stdout] 12 | impl TreeNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 13 | #[inline] [INFO] [stdout] 14 | pub fn new(val: i32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `min_depth` is never used [INFO] [stdout] --> src/problems/no111_minimum_depth_of_binary_tree.rs:23:12 [INFO] [stdout] | [INFO] [stdout] 22 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 23 | pub fn min_depth(root: Option>>) -> i32 { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `layer_gen` is never used [INFO] [stdout] --> src/problems/no111_minimum_depth_of_binary_tree.rs:85:8 [INFO] [stdout] | [INFO] [stdout] 84 | impl TreeNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 85 | fn layer_gen(array: Vec) -> Option>> { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no112_path_sum.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 3 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `TreeNode` is never constructed [INFO] [stdout] --> src/problems/no112_path_sum.rs:6:12 [INFO] [stdout] | [INFO] [stdout] 6 | pub struct TreeNode { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/problems/no112_path_sum.rs:14:12 [INFO] [stdout] | [INFO] [stdout] 12 | impl TreeNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 13 | #[inline] [INFO] [stdout] 14 | pub fn new(val: i32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `has_path_sum` is never used [INFO] [stdout] --> src/problems/no112_path_sum.rs:23:12 [INFO] [stdout] | [INFO] [stdout] 22 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 23 | pub fn has_path_sum(root: Option>>, target_sum: i32) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `layer_gen` is never used [INFO] [stdout] --> src/problems/no112_path_sum.rs:85:8 [INFO] [stdout] | [INFO] [stdout] 84 | impl TreeNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 85 | fn layer_gen(array: Vec) -> Option>> { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no113_path_sum_ii.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 3 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `TreeNode` is never constructed [INFO] [stdout] --> src/problems/no113_path_sum_ii.rs:6:12 [INFO] [stdout] | [INFO] [stdout] 6 | pub struct TreeNode { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/problems/no113_path_sum_ii.rs:14:12 [INFO] [stdout] | [INFO] [stdout] 12 | impl TreeNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 13 | #[inline] [INFO] [stdout] 14 | pub fn new(val: i32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `path_sum` is never used [INFO] [stdout] --> src/problems/no113_path_sum_ii.rs:23:12 [INFO] [stdout] | [INFO] [stdout] 22 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 23 | pub fn path_sum(root: Option>>, target_sum: i32) -> Vec> { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `layer_gen` is never used [INFO] [stdout] --> src/problems/no113_path_sum_ii.rs:92:8 [INFO] [stdout] | [INFO] [stdout] 91 | impl TreeNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 92 | fn layer_gen(array: Vec) -> Option>> { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no114_flatten_binary_tree_to_linked_list.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 3 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `TreeNode` is never constructed [INFO] [stdout] --> src/problems/no114_flatten_binary_tree_to_linked_list.rs:6:12 [INFO] [stdout] | [INFO] [stdout] 6 | pub struct TreeNode { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/problems/no114_flatten_binary_tree_to_linked_list.rs:14:12 [INFO] [stdout] | [INFO] [stdout] 12 | impl TreeNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 13 | #[inline] [INFO] [stdout] 14 | pub fn new(val: i32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated functions `recusive` and `flatten` are never used [INFO] [stdout] --> src/problems/no114_flatten_binary_tree_to_linked_list.rs:23:8 [INFO] [stdout] | [INFO] [stdout] 22 | impl Solution { [INFO] [stdout] | ------------- associated functions in this implementation [INFO] [stdout] 23 | fn recusive( [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 37 | pub fn flatten(root: &mut Option>>) { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `layer_gen` is never used [INFO] [stdout] --> src/problems/no114_flatten_binary_tree_to_linked_list.rs:81:8 [INFO] [stdout] | [INFO] [stdout] 80 | impl TreeNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 81 | fn layer_gen(array: Vec) -> Option>> { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no115_distinct_subsequence.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `num_distinct` is never used [INFO] [stdout] --> src/problems/no115_distinct_subsequence.rs:4:12 [INFO] [stdout] | [INFO] [stdout] 2 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 3 | // best solution: https://leetcode.com/problems/distinct-subsequences/discuss/236467/Rust-Bottom-Up-DP-with-0-ms-and-O(N)-space [INFO] [stdout] 4 | pub fn num_distinct(s: String, t: String) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no116_populating_next_right_pointers_in_each_node.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 3 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `TreeNode` is never constructed [INFO] [stdout] --> src/problems/no116_populating_next_right_pointers_in_each_node.rs:6:12 [INFO] [stdout] | [INFO] [stdout] 6 | pub struct TreeNode { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/problems/no116_populating_next_right_pointers_in_each_node.rs:15:10 [INFO] [stdout] | [INFO] [stdout] 13 | impl TreeNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 14 | #[inline] [INFO] [stdout] 15 | pub fn new(val: i32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `connect` is never used [INFO] [stdout] --> src/problems/no116_populating_next_right_pointers_in_each_node.rs:27:12 [INFO] [stdout] | [INFO] [stdout] 26 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 27 | pub fn connect(root: &mut Option>>) { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `layer_gen` is never used [INFO] [stdout] --> src/problems/no116_populating_next_right_pointers_in_each_node.rs:64:8 [INFO] [stdout] | [INFO] [stdout] 63 | impl TreeNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 64 | fn layer_gen(array: Vec, null_value: i32) -> Option>> { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no117_populating_next_right_pointers_in_each_node_ii.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 3 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `TreeNode` is never constructed [INFO] [stdout] --> src/problems/no117_populating_next_right_pointers_in_each_node_ii.rs:6:12 [INFO] [stdout] | [INFO] [stdout] 6 | pub struct TreeNode { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/problems/no117_populating_next_right_pointers_in_each_node_ii.rs:15:10 [INFO] [stdout] | [INFO] [stdout] 13 | impl TreeNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 14 | #[inline] [INFO] [stdout] 15 | pub fn new(val: i32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `connect` is never used [INFO] [stdout] --> src/problems/no117_populating_next_right_pointers_in_each_node_ii.rs:27:12 [INFO] [stdout] | [INFO] [stdout] 26 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 27 | pub fn connect(root: &mut Option>>) { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `layer_gen` is never used [INFO] [stdout] --> src/problems/no117_populating_next_right_pointers_in_each_node_ii.rs:64:8 [INFO] [stdout] | [INFO] [stdout] 63 | impl TreeNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 64 | fn layer_gen(array: Vec, null_value: i32) -> Option>> { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no118_pascals_triangle.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `generate` is never used [INFO] [stdout] --> src/problems/no118_pascals_triangle.rs:4:12 [INFO] [stdout] | [INFO] [stdout] 2 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 3 | // best: https://leetcode.com/problems/pascals-triangle/discuss/2242371/Rust-solution-(rule) [INFO] [stdout] 4 | pub fn generate(num_rows: i32) -> Vec> { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no119_pascals_truangle_ii.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `get_row` is never used [INFO] [stdout] --> src/problems/no119_pascals_truangle_ii.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 2 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 3 | pub fn get_row(row_index: i32) -> Vec { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no120_triangle.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `minimum_total` is never used [INFO] [stdout] --> src/problems/no120_triangle.rs:4:12 [INFO] [stdout] | [INFO] [stdout] 2 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 3 | // best: https://leetcode.com/problems/triangle/discuss/727074/Rust-0ms-DP [INFO] [stdout] 4 | pub fn minimum_total(triangle: Vec>) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no121_best_time_to_buy_and_sell_stock.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `max_profit` is never used [INFO] [stdout] --> src/problems/no121_best_time_to_buy_and_sell_stock.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 2 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 3 | pub fn max_profit(prices: Vec) -> i32 { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no122_best_time_to_buy_and_sell_stock_ii.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `max_profit` is never used [INFO] [stdout] --> src/problems/no122_best_time_to_buy_and_sell_stock_ii.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 2 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 3 | pub fn max_profit(prices: Vec) -> i32 { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no123_best_time_to_buy_and_sell_stock_iii.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `max_profit` is never used [INFO] [stdout] --> src/problems/no123_best_time_to_buy_and_sell_stock_iii.rs:4:12 [INFO] [stdout] | [INFO] [stdout] 2 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 3 | // ref: https://www.cnblogs.com/grandyang/p/4281975.html [INFO] [stdout] 4 | pub fn max_profit(prices: Vec) -> i32 { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no124_binary_tree_maximum_path_sum.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 3 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `TreeNode` is never constructed [INFO] [stdout] --> src/problems/no124_binary_tree_maximum_path_sum.rs:6:12 [INFO] [stdout] | [INFO] [stdout] 6 | pub struct TreeNode { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/problems/no124_binary_tree_maximum_path_sum.rs:14:12 [INFO] [stdout] | [INFO] [stdout] 12 | impl TreeNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 13 | #[inline] [INFO] [stdout] 14 | pub fn new(val: i32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `max_path_sum` is never used [INFO] [stdout] --> src/problems/no124_binary_tree_maximum_path_sum.rs:23:12 [INFO] [stdout] | [INFO] [stdout] 22 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 23 | pub fn max_path_sum(root: Option>>) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `layer_gen` is never used [INFO] [stdout] --> src/problems/no124_binary_tree_maximum_path_sum.rs:100:8 [INFO] [stdout] | [INFO] [stdout] 99 | impl TreeNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 100 | fn layer_gen(array: Vec, null_value: i32) -> Option>> { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no125_valid_palindrome.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `is_palindrome` is never used [INFO] [stdout] --> src/problems/no125_valid_palindrome.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 2 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 3 | pub fn is_palindrome(s: String) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no126_word_ladder_ii.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated functions `find_valid_index`, `gen_graph_map`, `calculate_dist`, `gen_shortest_paths`, and `find_ladders` are never used [INFO] [stdout] --> src/problems/no126_word_ladder_ii.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 2 | impl Solution { [INFO] [stdout] | ------------- associated functions in this implementation [INFO] [stdout] 3 | pub fn find_valid_index(target: &str, word_list: &Vec) -> Vec { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 20 | pub fn gen_graph_map(graph: &mut Graph, word_list: &Vec) { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 31 | pub fn calculate_dist(graph: &Graph, sp: &String, ep: &String) -> Vec { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 60 | pub fn gen_shortest_paths( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 93 | pub fn find_ladders( [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Graph` is never constructed [INFO] [stdout] --> src/problems/no126_word_ladder_ii.rs:147:12 [INFO] [stdout] | [INFO] [stdout] 147 | pub struct Graph { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated items `new`, `insert_bidirection`, and `insert_direction` are never used [INFO] [stdout] --> src/problems/no126_word_ladder_ii.rs:153:12 [INFO] [stdout] | [INFO] [stdout] 152 | impl Graph { [INFO] [stdout] | ---------- associated items in this implementation [INFO] [stdout] 153 | pub fn new(members: &Vec) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 160 | pub fn insert_bidirection(&mut self, p1: usize, p2: usize) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 165 | pub fn insert_direction(&mut self, sp: usize, ep: usize) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no127_word_ladder.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated functions `find_valid_index`, `gen_graph_map`, `calculate_dist`, and `ladder_length` are never used [INFO] [stdout] --> src/problems/no127_word_ladder.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 2 | impl Solution { [INFO] [stdout] | ------------- associated functions in this implementation [INFO] [stdout] 3 | pub fn find_valid_index(target: &str, word_list: &Vec) -> Vec { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 20 | pub fn gen_graph_map(graph: &mut Graph, word_list: &Vec) { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 31 | pub fn calculate_dist(graph: &Graph, sp: &String, ep: &String) -> Vec { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 60 | pub fn ladder_length(begin_word: String, end_word: String, word_list: Vec) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Graph` is never constructed [INFO] [stdout] --> src/problems/no127_word_ladder.rs:83:12 [INFO] [stdout] | [INFO] [stdout] 83 | pub struct Graph { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated items `new`, `insert_bidirection`, and `insert_direction` are never used [INFO] [stdout] --> src/problems/no127_word_ladder.rs:89:12 [INFO] [stdout] | [INFO] [stdout] 88 | impl Graph { [INFO] [stdout] | ---------- associated items in this implementation [INFO] [stdout] 89 | pub fn new(members: &Vec) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 96 | pub fn insert_bidirection(&mut self, p1: usize, p2: usize) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 101 | pub fn insert_direction(&mut self, sp: usize, ep: usize) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no128_longesst_consecutive_sequence.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `longest_consecutive` is never used [INFO] [stdout] --> src/problems/no128_longesst_consecutive_sequence.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 2 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 3 | pub fn longest_consecutive(nums: Vec) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no129_sum_root_to_leaf_numbers.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 3 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `TreeNode` is never constructed [INFO] [stdout] --> src/problems/no129_sum_root_to_leaf_numbers.rs:6:12 [INFO] [stdout] | [INFO] [stdout] 6 | pub struct TreeNode { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/problems/no129_sum_root_to_leaf_numbers.rs:14:12 [INFO] [stdout] | [INFO] [stdout] 12 | impl TreeNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 13 | #[inline] [INFO] [stdout] 14 | pub fn new(val: i32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `sum_numbers` is never used [INFO] [stdout] --> src/problems/no129_sum_root_to_leaf_numbers.rs:23:12 [INFO] [stdout] | [INFO] [stdout] 22 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 23 | pub fn sum_numbers(root: Option>>) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `layer_gen` is never used [INFO] [stdout] --> src/problems/no129_sum_root_to_leaf_numbers.rs:78:8 [INFO] [stdout] | [INFO] [stdout] 77 | impl TreeNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 78 | fn layer_gen(array: Vec, null_value: i32) -> Option>> { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no130_surrounded_regions.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `solve` is never used [INFO] [stdout] --> src/problems/no130_surrounded_regions.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 2 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 3 | pub fn solve(board: &mut Vec>) { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no131_palindrome_partitioning.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `partition` is never used [INFO] [stdout] --> src/problems/no131_palindrome_partitioning.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 2 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 3 | pub fn partition(s: String) -> Vec> { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no132_palindrome_partitioning_ii.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 3 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `min_cut` is never used [INFO] [stdout] --> src/problems/no132_palindrome_partitioning_ii.rs:5:12 [INFO] [stdout] | [INFO] [stdout] 4 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 5 | pub fn min_cut(s: String) -> i32 { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no134_gas_station.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 3 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `can_complete_circuit` is never used [INFO] [stdout] --> src/problems/no134_gas_station.rs:5:12 [INFO] [stdout] | [INFO] [stdout] 4 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 5 | pub fn can_complete_circuit(gas: Vec, cost: Vec) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no135_candy.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 3 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `candy` is never used [INFO] [stdout] --> src/problems/no135_candy.rs:25:12 [INFO] [stdout] | [INFO] [stdout] 4 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] ... [INFO] [stdout] 25 | pub fn candy(ratings: Vec) -> i32 { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no136_single_number.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 3 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `single_number` is never used [INFO] [stdout] --> src/problems/no136_single_number.rs:13:12 [INFO] [stdout] | [INFO] [stdout] 4 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] ... [INFO] [stdout] 13 | pub fn single_number(nums: Vec) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no137_single_number_ii.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 3 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `single_number` is never used [INFO] [stdout] --> src/problems/no137_single_number_ii.rs:19:12 [INFO] [stdout] | [INFO] [stdout] 4 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] ... [INFO] [stdout] 19 | pub fn single_number(nums: Vec) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no139_word_break.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 3 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `word_break` is never used [INFO] [stdout] --> src/problems/no139_word_break.rs:5:12 [INFO] [stdout] | [INFO] [stdout] 4 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 5 | pub fn word_break(s: String, word_dict: Vec) -> bool { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no140_word_break_ii.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `word_break` is never used [INFO] [stdout] --> src/problems/no140_word_break_ii.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 2 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 3 | pub fn word_break(s: String, word_dict: Vec) -> Vec { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no143_reorder_list.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 3 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `ListNode` is never constructed [INFO] [stdout] --> src/problems/no143_reorder_list.rs:6:12 [INFO] [stdout] | [INFO] [stdout] 6 | pub struct ListNode { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/problems/no143_reorder_list.rs:13:6 [INFO] [stdout] | [INFO] [stdout] 11 | impl ListNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 12 | #[inline] [INFO] [stdout] 13 | fn new(val: i32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `reorder_list` is never used [INFO] [stdout] --> src/problems/no143_reorder_list.rs:21:12 [INFO] [stdout] | [INFO] [stdout] 20 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 21 | pub fn reorder_list(head: &mut Option>) { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `gen` is never used [INFO] [stdout] --> src/problems/no143_reorder_list.rs:76:8 [INFO] [stdout] | [INFO] [stdout] 75 | impl ListNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 76 | fn gen(arr: Vec) -> Option> { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `LRUCache` is never constructed [INFO] [stdout] --> src/problems/no146_lru_cache.rs:3:8 [INFO] [stdout] | [INFO] [stdout] 3 | struct LRUCache { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `ListNode` is never constructed [INFO] [stdout] --> src/problems/no146_lru_cache.rs:10:8 [INFO] [stdout] | [INFO] [stdout] 10 | struct ListNode { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/problems/no146_lru_cache.rs:18:12 [INFO] [stdout] | [INFO] [stdout] 17 | impl ListNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 18 | pub fn new(key: i32, value: i32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `DoubleListNode` is never constructed [INFO] [stdout] --> src/problems/no146_lru_cache.rs:24:8 [INFO] [stdout] | [INFO] [stdout] 24 | struct DoubleListNode { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: multiple associated items are never used [INFO] [stdout] --> src/problems/no146_lru_cache.rs:31:12 [INFO] [stdout] | [INFO] [stdout] 30 | impl DoubleListNode { [INFO] [stdout] | ------------------- associated items in this implementation [INFO] [stdout] 31 | pub fn new() -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 35 | fn get_head(&self) -> Option>> { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 43 | fn get_tail(&self) -> Option>> { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 51 | pub fn add_front(&mut self, key: i32, value: i32) { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 61 | pub fn add_back(&mut self, key: i32, value: i32) { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 71 | pub fn add_front_node(&mut self, node: Rc>) { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 83 | pub fn add_back_node(&mut self, node: Rc>) { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 95 | pub fn remove(&mut self, target: Rc>) { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 122 | pub fn move_head(&mut self, target: Rc>) { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 129 | pub fn move_tail(&mut self, target: Rc>) { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated items `new`, `get`, and `put` are never used [INFO] [stdout] --> src/problems/no146_lru_cache.rs:142:8 [INFO] [stdout] | [INFO] [stdout] 141 | impl LRUCache { [INFO] [stdout] | ------------- associated items in this implementation [INFO] [stdout] 142 | fn new(capacity: i32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 150 | fn get(&mut self, key: i32) -> i32 { [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 160 | fn put(&mut self, key: i32, value: i32) { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no147_insertion_sort_list.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 3 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `ListNode` is never constructed [INFO] [stdout] --> src/problems/no147_insertion_sort_list.rs:6:12 [INFO] [stdout] | [INFO] [stdout] 6 | pub struct ListNode { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/problems/no147_insertion_sort_list.rs:13:8 [INFO] [stdout] | [INFO] [stdout] 11 | impl ListNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 12 | #[inline] [INFO] [stdout] 13 | fn new(val: i32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `insertion_sort_list` is never used [INFO] [stdout] --> src/problems/no147_insertion_sort_list.rs:18:12 [INFO] [stdout] | [INFO] [stdout] 17 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 18 | pub fn insertion_sort_list(mut head: Option>) -> Option> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `gen` is never used [INFO] [stdout] --> src/problems/no147_insertion_sort_list.rs:48:8 [INFO] [stdout] | [INFO] [stdout] 47 | impl ListNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 48 | fn gen(arr: Vec) -> Option> { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no148_sort_list.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `ListNode` is never constructed [INFO] [stdout] --> src/problems/no148_sort_list.rs:4:12 [INFO] [stdout] | [INFO] [stdout] 4 | pub struct ListNode { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/problems/no148_sort_list.rs:11:8 [INFO] [stdout] | [INFO] [stdout] 9 | impl ListNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 10 | #[inline] [INFO] [stdout] 11 | fn new(val: i32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated functions `merge`, `merge_sort`, and `sort_list` are never used [INFO] [stdout] --> src/problems/no148_sort_list.rs:20:8 [INFO] [stdout] | [INFO] [stdout] 18 | impl Solution { [INFO] [stdout] | ------------- associated functions in this implementation [INFO] [stdout] 19 | // ref: https://leetcode.com/problems/sort-list/discuss/2525275/Rust-Merge-Sort [INFO] [stdout] 20 | fn merge(mut left: Option>, mut right: Option>) -> Option> { [INFO] [stdout] | ^^^^^ [INFO] [stdout] ... [INFO] [stdout] 34 | fn merge_sort(mut head: Option>) -> Option> { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 50 | pub fn sort_list(head: Option>) -> Option> { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `gen` is never used [INFO] [stdout] --> src/problems/no148_sort_list.rs:68:8 [INFO] [stdout] | [INFO] [stdout] 67 | impl ListNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 68 | fn gen(arr: Vec) -> Option> { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no149_max_points_on_a_line.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 3 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `max_points` is never used [INFO] [stdout] --> src/problems/no149_max_points_on_a_line.rs:5:12 [INFO] [stdout] | [INFO] [stdout] 4 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 5 | pub fn max_points(points: Vec>) -> i32 { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no150_evaluate_reverse_polish_natation.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated functions `plus`, `minus`, `power`, `divide`, and `eval_rpn` are never used [INFO] [stdout] --> src/problems/no150_evaluate_reverse_polish_natation.rs:3:8 [INFO] [stdout] | [INFO] [stdout] 2 | impl Solution { [INFO] [stdout] | ------------- associated functions in this implementation [INFO] [stdout] 3 | fn plus(stack: &mut Vec) { [INFO] [stdout] | ^^^^ [INFO] [stdout] ... [INFO] [stdout] 8 | fn minus(stack: &mut Vec) { [INFO] [stdout] | ^^^^^ [INFO] [stdout] ... [INFO] [stdout] 13 | fn power(stack: &mut Vec) { [INFO] [stdout] | ^^^^^ [INFO] [stdout] ... [INFO] [stdout] 18 | fn divide(stack: &mut Vec) { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 24 | pub fn eval_rpn(mut tokens: Vec) -> i32 { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no151_reverse_words_in_a_string.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `reverse_words` is never used [INFO] [stdout] --> src/problems/no151_reverse_words_in_a_string.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 2 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 3 | pub fn reverse_words(s: String) -> String { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no152_maximum_product_subarray.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `max_product` is never used [INFO] [stdout] --> src/problems/no152_maximum_product_subarray.rs:5:12 [INFO] [stdout] | [INFO] [stdout] 2 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] ... [INFO] [stdout] 5 | pub fn max_product(nums: Vec) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no153_find_minimum_in_rotated_sorted_array.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `find_min` is never used [INFO] [stdout] --> src/problems/no153_find_minimum_in_rotated_sorted_array.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 2 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 3 | pub fn find_min(nums: Vec) -> i32 { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no154_find_minimum_in_rotated_sorted_array_ii.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `find_min` is never used [INFO] [stdout] --> src/problems/no154_find_minimum_in_rotated_sorted_array_ii.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 2 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 3 | pub fn find_min(nums: Vec) -> i32 { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no155_min_stack.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `MinStack` is never constructed [INFO] [stdout] --> src/problems/no155_min_stack.rs:2:8 [INFO] [stdout] | [INFO] [stdout] 2 | struct MinStack { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated items `new`, `push`, `pop`, `top`, and `get_min` are never used [INFO] [stdout] --> src/problems/no155_min_stack.rs:13:8 [INFO] [stdout] | [INFO] [stdout] 11 | impl MinStack { [INFO] [stdout] | ------------- associated items in this implementation [INFO] [stdout] 12 | [INFO] [stdout] 13 | fn new() -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 17 | fn push(&mut self, val: i32) { [INFO] [stdout] | ^^^^ [INFO] [stdout] ... [INFO] [stdout] 26 | fn pop(&mut self) { [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 30 | fn top(&self) -> i32 { [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 34 | fn get_min(&self) -> i32 { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no162_find_peak_element.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `find_peak_element` is never used [INFO] [stdout] --> src/problems/no162_find_peak_element.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 2 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 3 | pub fn find_peak_element(nums: Vec) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no164_maximum_gap.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 3 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `maximum_gap` is never used [INFO] [stdout] --> src/problems/no164_maximum_gap.rs:5:12 [INFO] [stdout] | [INFO] [stdout] 4 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 5 | pub fn maximum_gap(nums: Vec) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no165_compare_version_numbers.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `compare_version` is never used [INFO] [stdout] --> src/problems/no165_compare_version_numbers.rs:34:12 [INFO] [stdout] | [INFO] [stdout] 2 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] ... [INFO] [stdout] 34 | pub fn compare_version(version1: String, version2: String) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no48_rotate_image.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `rotate` is never used [INFO] [stdout] --> src/problems/no48_rotate_image.rs:4:12 [INFO] [stdout] | [INFO] [stdout] 3 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 4 | pub fn rotate(matrix: &mut Vec>) { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no49_group_anagrams.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `group_anagrams` is never used [INFO] [stdout] --> src/problems/no49_group_anagrams.rs:6:12 [INFO] [stdout] | [INFO] [stdout] 5 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 6 | pub fn group_anagrams(strs: Vec) -> Vec> { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no50_pow_xn.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `my_pow` is never used [INFO] [stdout] --> src/problems/no50_pow_xn.rs:4:12 [INFO] [stdout] | [INFO] [stdout] 3 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 4 | pub fn my_pow(x: f64, n: i32) -> f64 { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no51_n_queens.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `Chess` is never used [INFO] [stdout] --> src/problems/no51_n_queens.rs:4:6 [INFO] [stdout] | [INFO] [stdout] 4 | enum Chess { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `CheeseBoard` is never constructed [INFO] [stdout] --> src/problems/no51_n_queens.rs:9:8 [INFO] [stdout] | [INFO] [stdout] 9 | struct CheeseBoard { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: multiple associated items are never used [INFO] [stdout] --> src/problems/no51_n_queens.rs:15:12 [INFO] [stdout] | [INFO] [stdout] 14 | impl CheeseBoard { [INFO] [stdout] | ---------------- associated items in this implementation [INFO] [stdout] 15 | pub fn new(n: i32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 24 | fn test_row(&self, row: usize) -> bool { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 30 | fn test_col(&self, col: usize) -> bool { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 36 | fn test_leftoblique(&self, row: usize, col: usize) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 50 | fn test_rightoblique(&self, row: usize, col: usize) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 70 | fn is_valid(&self, row: usize, col: usize) -> bool { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 77 | fn put_queen(&mut self, row: usize, col: usize) -> bool { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 85 | fn take_queen(&mut self, row: usize, col: usize) { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated functions `dfs_player` and `solve_n_queens` are never used [INFO] [stdout] --> src/problems/no51_n_queens.rs:91:8 [INFO] [stdout] | [INFO] [stdout] 90 | impl Solution { [INFO] [stdout] | ------------- associated functions in this implementation [INFO] [stdout] 91 | fn dfs_player(result: &mut Vec>, board: &mut CheeseBoard, row: usize, col: usize) { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 116 | pub fn solve_n_queens(n: i32) -> Vec> { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no52_n_queens_ii.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `Chess` is never used [INFO] [stdout] --> src/problems/no52_n_queens_ii.rs:4:6 [INFO] [stdout] | [INFO] [stdout] 4 | enum Chess { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `CheeseBoard` is never constructed [INFO] [stdout] --> src/problems/no52_n_queens_ii.rs:10:8 [INFO] [stdout] | [INFO] [stdout] 10 | struct CheeseBoard { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: multiple associated items are never used [INFO] [stdout] --> src/problems/no52_n_queens_ii.rs:16:12 [INFO] [stdout] | [INFO] [stdout] 15 | impl CheeseBoard { [INFO] [stdout] | ---------------- associated items in this implementation [INFO] [stdout] 16 | pub fn new(n: i32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 25 | fn test_row(&self, row: usize) -> bool { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 31 | fn test_col(&self, col: usize) -> bool { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 37 | fn test_leftoblique(&self, row: usize, col: usize) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 51 | fn test_rightoblique(&self, row: usize, col: usize) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 71 | fn is_valid(&self, row: usize, col: usize) -> bool { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 78 | fn put_queen(&mut self, row: usize, col: usize) -> bool { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 86 | fn take_queen(&mut self, row: usize, col: usize) { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated functions `dfs_player` and `total_n_queens` are never used [INFO] [stdout] --> src/problems/no52_n_queens_ii.rs:92:8 [INFO] [stdout] | [INFO] [stdout] 91 | impl Solution { [INFO] [stdout] | ------------- associated functions in this implementation [INFO] [stdout] 92 | fn dfs_player(result: &mut i32, board: &mut CheeseBoard, row: usize, col: usize) { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 106 | pub fn total_n_queens(n: i32) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no53_maximun_subarray.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `max_sub_array` is never used [INFO] [stdout] --> src/problems/no53_maximun_subarray.rs:5:12 [INFO] [stdout] | [INFO] [stdout] 3 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 4 | // ref: https://leetcode.com/problems/maximum-subarray/discuss/937879/Rust%3A-linear-solution [INFO] [stdout] 5 | pub fn max_sub_array(nums: Vec) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no54_spiral_matrix.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `spiral_order` is never used [INFO] [stdout] --> src/problems/no54_spiral_matrix.rs:4:12 [INFO] [stdout] | [INFO] [stdout] 3 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 4 | pub fn spiral_order(matrix: Vec>) -> Vec { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no55_jump_game.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `can_jump` is never used [INFO] [stdout] --> src/problems/no55_jump_game.rs:4:12 [INFO] [stdout] | [INFO] [stdout] 3 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 4 | pub fn can_jump(nums: Vec) -> bool { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no56_merge_intervals.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `merge` is never used [INFO] [stdout] --> src/problems/no56_merge_intervals.rs:4:12 [INFO] [stdout] | [INFO] [stdout] 3 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 4 | pub fn merge(intervals: Vec>) -> Vec> { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no57_insert_interval.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `insert` is never used [INFO] [stdout] --> src/problems/no57_insert_interval.rs:4:12 [INFO] [stdout] | [INFO] [stdout] 3 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 4 | pub fn insert(intervals: Vec>, new_interval: Vec) -> Vec> { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no58_length_of_last_word.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `length_of_last_word` is never used [INFO] [stdout] --> src/problems/no58_length_of_last_word.rs:4:12 [INFO] [stdout] | [INFO] [stdout] 3 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 4 | pub fn length_of_last_word(s: String) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no59_spiral_matrix_ii.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `generate_matrix` is never used [INFO] [stdout] --> src/problems/no59_spiral_matrix_ii.rs:4:12 [INFO] [stdout] | [INFO] [stdout] 3 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 4 | pub fn generate_matrix(n: i32) -> Vec> { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no60_permutation_sequence.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `get_permutation` is never used [INFO] [stdout] --> src/problems/no60_permutation_sequence.rs:55:12 [INFO] [stdout] | [INFO] [stdout] 3 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] ... [INFO] [stdout] 55 | pub fn get_permutation(n: i32, k: i32) -> String { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no61_rotate_list.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `ListNode` is never constructed [INFO] [stdout] --> src/problems/no61_rotate_list.rs:5:12 [INFO] [stdout] | [INFO] [stdout] 5 | pub struct ListNode { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/problems/no61_rotate_list.rs:12:8 [INFO] [stdout] | [INFO] [stdout] 10 | impl ListNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 11 | #[inline] [INFO] [stdout] 12 | fn new(val: i32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `rotate_right` is never used [INFO] [stdout] --> src/problems/no61_rotate_list.rs:18:12 [INFO] [stdout] | [INFO] [stdout] 17 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 18 | pub fn rotate_right(head: Option>, k: i32) -> Option> { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no62_unique_paths.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `unique_paths` is never used [INFO] [stdout] --> src/problems/no62_unique_paths.rs:4:12 [INFO] [stdout] | [INFO] [stdout] 3 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 4 | pub fn unique_paths(m: i32, n: i32) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no63_unique_paths_ii.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `unique_paths_with_obstacles` is never used [INFO] [stdout] --> src/problems/no63_unique_paths_ii.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 2 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 3 | pub fn unique_paths_with_obstacles(obstacle_grid: Vec>) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no64_minimum_path_sum.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `min_path_sum` is never used [INFO] [stdout] --> src/problems/no64_minimum_path_sum.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 2 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 3 | pub fn min_path_sum(grid: Vec>) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no65_valid_number.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated functions `all_valid_char`, `is_correct_sign_position_and_float_point`, `get_exp_position`, and `is_number` are never used [INFO] [stdout] --> src/problems/no65_valid_number.rs:4:8 [INFO] [stdout] | [INFO] [stdout] 3 | impl Solution { [INFO] [stdout] | ------------- associated functions in this implementation [INFO] [stdout] 4 | fn all_valid_char(s: &str) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 26 | fn is_correct_sign_position_and_float_point(s: &str) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 62 | fn get_exp_position(s: &str) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 66 | pub fn is_number(s: String) -> bool { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no66_plus_one.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `plus_one` is never used [INFO] [stdout] --> src/problems/no66_plus_one.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 2 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 3 | pub fn plus_one(digits: Vec) -> Vec { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no67_add_binary.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `add_binary` is never used [INFO] [stdout] --> src/problems/no67_add_binary.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 2 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 3 | pub fn add_binary(a: String, b: String) -> String { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no68_text_justification.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 3 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `full_justify` is never used [INFO] [stdout] --> src/problems/no68_text_justification.rs:5:12 [INFO] [stdout] | [INFO] [stdout] 4 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 5 | pub fn full_justify(words: Vec, max_width: i32) -> Vec { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no69_sqrt.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `my_sqrt` is never used [INFO] [stdout] --> src/problems/no69_sqrt.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 2 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 3 | pub fn my_sqrt(x: i32) -> i32 { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no70_climbing_stairs.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `climb_stairs` is never used [INFO] [stdout] --> src/problems/no70_climbing_stairs.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 2 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 3 | pub fn climb_stairs(n: i32) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no71_simplify_path.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `simplify_path` is never used [INFO] [stdout] --> src/problems/no71_simplify_path.rs:4:12 [INFO] [stdout] | [INFO] [stdout] 3 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 4 | pub fn simplify_path(path: String) -> String { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no72_edit_distance.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `min_distance` is never used [INFO] [stdout] --> src/problems/no72_edit_distance.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 2 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 3 | pub fn min_distance(word1: String, word2: String) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no73_set_matrix_zeros.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `set_zeroes` is never used [INFO] [stdout] --> src/problems/no73_set_matrix_zeros.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 2 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 3 | pub fn set_zeroes(matrix: &mut Vec>) { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no74_search_matrix.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `search_matrix` is never used [INFO] [stdout] --> src/problems/no74_search_matrix.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 2 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 3 | pub fn search_matrix(matrix: Vec>, target: i32) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no75_sort_colors.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 3 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `sort_colors` is never used [INFO] [stdout] --> src/problems/no75_sort_colors.rs:5:12 [INFO] [stdout] | [INFO] [stdout] 4 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 5 | pub fn sort_colors(nums: &mut Vec) { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no76_min_window.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 3 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `min_window` is never used [INFO] [stdout] --> src/problems/no76_min_window.rs:6:12 [INFO] [stdout] | [INFO] [stdout] 4 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 5 | // ref. https://leetcode.com/problems/minimum-window-substring/discuss/2142884/rust-solution [INFO] [stdout] 6 | pub fn min_window(s: String, t: String) -> String { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no77_combine.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `combine` is never used [INFO] [stdout] --> src/problems/no77_combine.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 2 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 3 | pub fn combine(n: i32, k: i32) -> Vec> { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no78_subsets.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated functions `append` and `subsets` are never used [INFO] [stdout] --> src/problems/no78_subsets.rs:3:8 [INFO] [stdout] | [INFO] [stdout] 2 | impl Solution { [INFO] [stdout] | ------------- associated functions in this implementation [INFO] [stdout] 3 | fn append(result: &mut Vec>, buf: &Vec, nums: &[i32]) { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 11 | pub fn subsets(nums: Vec) -> Vec> { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no79_word_search.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated functions `next` and `exist` are never used [INFO] [stdout] --> src/problems/no79_word_search.rs:4:8 [INFO] [stdout] | [INFO] [stdout] 2 | impl Solution { [INFO] [stdout] | ------------- associated functions in this implementation [INFO] [stdout] 3 | // backtracking [INFO] [stdout] 4 | fn next(board: &mut Vec>, word: &[u8], i: usize, j: usize) -> bool { [INFO] [stdout] | ^^^^ [INFO] [stdout] ... [INFO] [stdout] 39 | pub fn exist(board: Vec>, word: String) -> bool { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no80_remove_duplicates_from_sorted_array_ii.rs:54:12 [INFO] [stdout] | [INFO] [stdout] 54 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `remove_duplicates` is never used [INFO] [stdout] --> src/problems/no80_remove_duplicates_from_sorted_array_ii.rs:56:12 [INFO] [stdout] | [INFO] [stdout] 55 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 56 | pub fn remove_duplicates(nums: &mut Vec) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no81_search_in_rotated_sorted_array_ii.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `search` is never used [INFO] [stdout] --> src/problems/no81_search_in_rotated_sorted_array_ii.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 2 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 3 | pub fn search(nums: Vec, target: i32) -> bool { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `ListNode` is never constructed [INFO] [stdout] --> src/problems/no82_remove_duplicates_from_sorted_list_ii.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 3 | pub struct ListNode { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/problems/no82_remove_duplicates_from_sorted_list_ii.rs:10:8 [INFO] [stdout] | [INFO] [stdout] 8 | impl ListNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 9 | #[inline] [INFO] [stdout] 10 | fn new(val: i32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no82_remove_duplicates_from_sorted_list_ii.rs:15:12 [INFO] [stdout] | [INFO] [stdout] 15 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `delete_duplicates` is never used [INFO] [stdout] --> src/problems/no82_remove_duplicates_from_sorted_list_ii.rs:17:12 [INFO] [stdout] | [INFO] [stdout] 16 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 17 | pub fn delete_duplicates(head: Option>) -> Option> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `ListNode` is never constructed [INFO] [stdout] --> src/problems/no83_remove_duplicates_from_sorted_list.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 3 | pub struct ListNode { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/problems/no83_remove_duplicates_from_sorted_list.rs:10:8 [INFO] [stdout] | [INFO] [stdout] 8 | impl ListNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 9 | #[inline] [INFO] [stdout] 10 | fn new(val: i32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no83_remove_duplicates_from_sorted_list.rs:15:12 [INFO] [stdout] | [INFO] [stdout] 15 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `delete_duplicates` is never used [INFO] [stdout] --> src/problems/no83_remove_duplicates_from_sorted_list.rs:17:12 [INFO] [stdout] | [INFO] [stdout] 16 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 17 | pub fn delete_duplicates(head: Option>) -> Option> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no84_largest_rectangle_in_histogram.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `largest_rectangle_area` is never used [INFO] [stdout] --> src/problems/no84_largest_rectangle_in_histogram.rs:4:12 [INFO] [stdout] | [INFO] [stdout] 2 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 3 | //ref. https://leetcode.com/problems/largest-rectangle-in-histogram/discuss/734976/Python-Rust-Stack-Solution [INFO] [stdout] 4 | pub fn largest_rectangle_area(mut heights: Vec) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no85_maximal_rectangle.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated functions `maximal_rectangle` and `maxInHistogram` are never used [INFO] [stdout] --> src/problems/no85_maximal_rectangle.rs:4:12 [INFO] [stdout] | [INFO] [stdout] 2 | impl Solution { [INFO] [stdout] | ------------- associated functions in this implementation [INFO] [stdout] 3 | // ref. https://leetcode.com/problems/maximal-rectangle/discuss/736725/Python-Rust-Stack-Solution [INFO] [stdout] 4 | pub fn maximal_rectangle(matrix: Vec>) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 26 | pub fn maxInHistogram(hist: &Vec) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no86_partition_list.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `ListNode` is never constructed [INFO] [stdout] --> src/problems/no86_partition_list.rs:4:12 [INFO] [stdout] | [INFO] [stdout] 4 | pub struct ListNode { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/problems/no86_partition_list.rs:11:8 [INFO] [stdout] | [INFO] [stdout] 9 | impl ListNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 10 | #[inline] [INFO] [stdout] 11 | fn new(val: i32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `partition` is never used [INFO] [stdout] --> src/problems/no86_partition_list.rs:17:12 [INFO] [stdout] | [INFO] [stdout] 16 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 17 | pub fn partition(head: Option>, x: i32) -> Option> { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no87_scramble_string.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated functions `greedy_split`, `discussion_dp`, and `is_scramble` are never used [INFO] [stdout] --> src/problems/no87_scramble_string.rs:3:8 [INFO] [stdout] | [INFO] [stdout] 2 | impl Solution { [INFO] [stdout] | ------------- associated functions in this implementation [INFO] [stdout] 3 | fn greedy_split(s1: Vec, target: String, counter: i32) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 41 | fn discussion_dp(s1: String, s2: String) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 95 | pub fn is_scramble(s1: String, s2: String) -> bool { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no88_merge_sorted_array.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `merge` is never used [INFO] [stdout] --> src/problems/no88_merge_sorted_array.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 2 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 3 | pub fn merge(nums1: &mut Vec, m: i32, nums2: &mut Vec, n: i32) { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no89_gray_code.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated functions `discussion_bitwise`, `discussion_recursive`, and `gray_code` are never used [INFO] [stdout] --> src/problems/no89_gray_code.rs:3:8 [INFO] [stdout] | [INFO] [stdout] 2 | impl Solution { [INFO] [stdout] | ------------- associated functions in this implementation [INFO] [stdout] 3 | fn discussion_bitwise(n: i32) -> Vec { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 12 | fn discussion_recursive(n: i32) -> Vec { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 39 | pub fn gray_code(n: i32) -> Vec { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no90_subsets_ii.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 3 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated functions `recuse` and `subsets_with_dup` are never used [INFO] [stdout] --> src/problems/no90_subsets_ii.rs:5:8 [INFO] [stdout] | [INFO] [stdout] 4 | impl Solution { [INFO] [stdout] | ------------- associated functions in this implementation [INFO] [stdout] 5 | fn recuse(res: &mut Vec>, current: &mut Vec, map: &[(i32, i32)]) { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 22 | pub fn subsets_with_dup(nums: Vec) -> Vec> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no91_decode_ways.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `num_decodings` is never used [INFO] [stdout] --> src/problems/no91_decode_ways.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 2 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 3 | pub fn num_decodings(s: String) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no92_reverse_linked_list_ii.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `ListNode` is never constructed [INFO] [stdout] --> src/problems/no92_reverse_linked_list_ii.rs:4:12 [INFO] [stdout] | [INFO] [stdout] 4 | pub struct ListNode { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/problems/no92_reverse_linked_list_ii.rs:11:8 [INFO] [stdout] | [INFO] [stdout] 9 | impl ListNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 10 | #[inline] [INFO] [stdout] 11 | fn new(val: i32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `reverse_between` is never used [INFO] [stdout] --> src/problems/no92_reverse_linked_list_ii.rs:17:12 [INFO] [stdout] | [INFO] [stdout] 16 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 17 | pub fn reverse_between( [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no93_restore_ip_addresses.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `restore_ip_addresses` is never used [INFO] [stdout] --> src/problems/no93_restore_ip_addresses.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 2 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 3 | pub fn restore_ip_addresses(s: String) -> Vec { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no94_binary_tree_inorder_traversal.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `TreeNode` is never constructed [INFO] [stdout] --> src/problems/no94_binary_tree_inorder_traversal.rs:6:12 [INFO] [stdout] | [INFO] [stdout] 6 | pub struct TreeNode { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/problems/no94_binary_tree_inorder_traversal.rs:14:12 [INFO] [stdout] | [INFO] [stdout] 12 | impl TreeNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 13 | #[inline] [INFO] [stdout] 14 | pub fn new(val: i32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `inorder_traversal` is never used [INFO] [stdout] --> src/problems/no94_binary_tree_inorder_traversal.rs:23:12 [INFO] [stdout] | [INFO] [stdout] 22 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 23 | pub fn inorder_traversal(root: Option>>) -> Vec { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no95_unique_binary_search_trees_ii.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 3 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `TreeNode` is never constructed [INFO] [stdout] --> src/problems/no95_unique_binary_search_trees_ii.rs:6:12 [INFO] [stdout] | [INFO] [stdout] 6 | pub struct TreeNode { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/problems/no95_unique_binary_search_trees_ii.rs:14:12 [INFO] [stdout] | [INFO] [stdout] 12 | impl TreeNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 13 | #[inline] [INFO] [stdout] 14 | pub fn new(val: i32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated functions `helper` and `generate_trees` are never used [INFO] [stdout] --> src/problems/no95_unique_binary_search_trees_ii.rs:26:8 [INFO] [stdout] | [INFO] [stdout] 23 | impl Solution { [INFO] [stdout] | ------------- associated functions in this implementation [INFO] [stdout] ... [INFO] [stdout] 26 | fn helper(l: i32, r: i32) -> Vec>>> { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 57 | pub fn generate_trees(n: i32) -> Vec>>> { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no96_unique_binary_search_trees.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `num_trees` is never used [INFO] [stdout] --> src/problems/no96_unique_binary_search_trees.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 2 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 3 | pub fn num_trees(n: i32) -> i32 { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no97_interleaving_string.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `is_interleave` is never used [INFO] [stdout] --> src/problems/no97_interleaving_string.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 2 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 3 | pub fn is_interleave(s1: String, s2: String, s3: String) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no98_validate_binary_search_tree.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 3 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `TreeNode` is never constructed [INFO] [stdout] --> src/problems/no98_validate_binary_search_tree.rs:6:12 [INFO] [stdout] | [INFO] [stdout] 6 | pub struct TreeNode { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/problems/no98_validate_binary_search_tree.rs:14:12 [INFO] [stdout] | [INFO] [stdout] 12 | impl TreeNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 13 | #[inline] [INFO] [stdout] 14 | pub fn new(val: i32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `is_valid_bst` is never used [INFO] [stdout] --> src/problems/no98_validate_binary_search_tree.rs:24:12 [INFO] [stdout] | [INFO] [stdout] 23 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 24 | pub fn is_valid_bst(root: Option>>) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no99_recover_binary_search_tree.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 3 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `TreeNode` is never constructed [INFO] [stdout] --> src/problems/no99_recover_binary_search_tree.rs:6:12 [INFO] [stdout] | [INFO] [stdout] 6 | pub struct TreeNode { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/problems/no99_recover_binary_search_tree.rs:14:12 [INFO] [stdout] | [INFO] [stdout] 12 | impl TreeNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 13 | #[inline] [INFO] [stdout] 14 | pub fn new(val: i32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `recover_tree` is never used [INFO] [stdout] --> src/problems/no99_recover_binary_search_tree.rs:24:12 [INFO] [stdout] | [INFO] [stdout] 23 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 24 | pub fn recover_tree(root: &mut Option>>) { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `ListNode` is never constructed [INFO] [stdout] --> src/problems/syntex_test.rs:2:8 [INFO] [stdout] | [INFO] [stdout] 2 | struct ListNode { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/problems/syntex_test.rs:8:12 [INFO] [stdout] | [INFO] [stdout] 7 | impl ListNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 8 | pub fn new(val: i32) -> Option> { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no144_binary_tree_preorder_traversal.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `TreeNode` is never constructed [INFO] [stdout] --> src/problems/no144_binary_tree_preorder_traversal.rs:6:12 [INFO] [stdout] | [INFO] [stdout] 6 | pub struct TreeNode { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/problems/no144_binary_tree_preorder_traversal.rs:14:12 [INFO] [stdout] | [INFO] [stdout] 12 | impl TreeNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 13 | #[inline] [INFO] [stdout] 14 | pub fn new(val: i32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `preorder_traversal` is never used [INFO] [stdout] --> src/problems/no144_binary_tree_preorder_traversal.rs:23:12 [INFO] [stdout] | [INFO] [stdout] 22 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 23 | pub fn preorder_traversal(root: Option>>) -> Vec { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no145_binary_tree_postorder_traversal.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `TreeNode` is never constructed [INFO] [stdout] --> src/problems/no145_binary_tree_postorder_traversal.rs:6:12 [INFO] [stdout] | [INFO] [stdout] 6 | pub struct TreeNode { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/problems/no145_binary_tree_postorder_traversal.rs:14:12 [INFO] [stdout] | [INFO] [stdout] 12 | impl TreeNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 13 | #[inline] [INFO] [stdout] 14 | pub fn new(val: i32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `postorder_traversal` is never used [INFO] [stdout] --> src/problems/no145_binary_tree_postorder_traversal.rs:23:12 [INFO] [stdout] | [INFO] [stdout] 22 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 23 | pub fn postorder_traversal(root: Option>>) -> Vec { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/problems/no100_same_tree.rs:51:9 [INFO] [stdout] | [INFO] [stdout] 51 | return true; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 51 - return true; [INFO] [stdout] 51 + true [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/problems/no101_symmetric_tree.rs:42:21 [INFO] [stdout] | [INFO] [stdout] 42 | return false; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 42 - return false; [INFO] [stdout] 42 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/problems/no101_symmetric_tree.rs:45:17 [INFO] [stdout] | [INFO] [stdout] 45 | return false; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 45 - return false; [INFO] [stdout] 45 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/problems/no102_binary_tree_level_order_traversal.rs:47:16 [INFO] [stdout] | [INFO] [stdout] 47 | if next_layer.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!next_layer.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/problems/no102_binary_tree_level_order_traversal.rs:50:16 [INFO] [stdout] | [INFO] [stdout] 50 | if curr_layer.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!curr_layer.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: length comparison to zero [INFO] [stdout] --> src/problems/no103_binary_tree_zigzag_level_order_traversal.rs:61:16 [INFO] [stdout] | [INFO] [stdout] 61 | if next_layer.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!next_layer.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: length comparison to zero [INFO] [stdout] --> src/problems/no103_binary_tree_zigzag_level_order_traversal.rs:64:16 [INFO] [stdout] | [INFO] [stdout] 64 | if curr_layer.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!curr_layer.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: manual implementation of `Option::map` [INFO] [stdout] --> src/problems/no105_construct_binary_tree_from_preorder_and_inorder_traversal.rs:27:13 [INFO] [stdout] | [INFO] [stdout] 27 | / if let Some(pivot) = inorder.iter().position(|&v| v == preorder[0]) { [INFO] [stdout] 28 | | Some(Rc::new(RefCell::new(TreeNode { [INFO] [stdout] 29 | | val: preorder[0], [INFO] [stdout] 30 | | left: builder(&preorder[1..(1 + pivot)], &inorder[..pivot]), [INFO] [stdout] ... | [INFO] [stdout] 34 | | None [INFO] [stdout] 35 | | } [INFO] [stdout] | |_____________^ [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] help: try [INFO] [stdout] | [INFO] [stdout] 27 ~ inorder.iter().position(|&v| v == preorder[0]).map(|pivot| Rc::new(RefCell::new(TreeNode { [INFO] [stdout] 28 + val: preorder[0], [INFO] [stdout] 29 + left: builder(&preorder[1..(1 + pivot)], &inorder[..pivot]), [INFO] [stdout] 30 + right: builder(&preorder[(1 + pivot)..], &inorder[(pivot + 1)..]), [INFO] [stdout] 31 + }))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/problems/no106_construct_binary_tree_from_inorder_and_postorder_traversal.rs:25:13 [INFO] [stdout] | [INFO] [stdout] 25 | / if let Some(pivot) = inorder [INFO] [stdout] 26 | | .iter() [INFO] [stdout] 27 | | .position(|v| v == postorder.iter().last().unwrap()) [INFO] [stdout] ... | [INFO] [stdout] 38 | | None [INFO] [stdout] 39 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 25 ~ inorder [INFO] [stdout] 26 + .iter() [INFO] [stdout] 27 + .position(|v| v == postorder.iter().last().unwrap()).map(|pivot| Rc::new(RefCell::new(TreeNode { [INFO] [stdout] 28 + val: inorder[pivot], [INFO] [stdout] 29 + left: builder(&inorder[..pivot], &postorder[..pivot]), [INFO] [stdout] 30 + right: builder( [INFO] [stdout] 31 + &inorder[pivot + 1..], [INFO] [stdout] 32 + &postorder[pivot..postorder.len() - 1], [INFO] [stdout] 33 + ), [INFO] [stdout] 34 + }))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `tree` after checking its variant with `is_none` [INFO] [stdout] --> src/problems/no110_balanced_binary_tree.rs:29:38 [INFO] [stdout] | [INFO] [stdout] 26 | if tree.is_none() { [INFO] [stdout] | ----------------- help: try: `if let Some() = &tree` [INFO] [stdout] ... [INFO] [stdout] 29 | let left = max_depth(tree.as_ref().unwrap().borrow().left.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `tree` after checking its variant with `is_none` [INFO] [stdout] --> src/problems/no110_balanced_binary_tree.rs:30:39 [INFO] [stdout] | [INFO] [stdout] 26 | if tree.is_none() { [INFO] [stdout] | ----------------- help: try: `if let Some() = &tree` [INFO] [stdout] ... [INFO] [stdout] 30 | let right = max_depth(tree.as_ref().unwrap().borrow().right.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `tree` after checking its variant with `is_none` [INFO] [stdout] --> src/problems/no111_minimum_depth_of_binary_tree.rs:31:21 [INFO] [stdout] | [INFO] [stdout] 26 | if tree.is_none() { [INFO] [stdout] | ----------------- help: try: `if let Some() = &tree` [INFO] [stdout] ... [INFO] [stdout] 31 | tree.as_ref().unwrap().borrow().left.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `tree` after checking its variant with `is_none` [INFO] [stdout] --> src/problems/no111_minimum_depth_of_binary_tree.rs:37:21 [INFO] [stdout] | [INFO] [stdout] 26 | if tree.is_none() { [INFO] [stdout] | ----------------- help: try: `if let Some() = &tree` [INFO] [stdout] ... [INFO] [stdout] 37 | tree.as_ref().unwrap().borrow().right.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `root` after checking its variant with `is_some` [INFO] [stdout] --> src/problems/no113_path_sum_ii.rs:67:27 [INFO] [stdout] | [INFO] [stdout] 65 | if root.is_some() { [INFO] [stdout] | ----------------- help: try: `if let Some() = &root` [INFO] [stdout] 66 | let mut path = Vec::new(); [INFO] [stdout] 67 | let mut sum = root.as_ref().unwrap().borrow().val; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `root` after checking its variant with `is_some` [INFO] [stdout] --> src/problems/no113_path_sum_ii.rs:68:23 [INFO] [stdout] | [INFO] [stdout] 65 | if root.is_some() { [INFO] [stdout] | ----------------- help: try: `if let Some() = &root` [INFO] [stdout] ... [INFO] [stdout] 68 | path.push(root.as_ref().unwrap().borrow().val); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/problems/no113_path_sum_ii.rs:36:23 [INFO] [stdout] | [INFO] [stdout] 36 | val = (&leaf).borrow().val; [INFO] [stdout] | ^^^^^^^ help: change this to: `leaf` [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 borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/problems/no113_path_sum_ii.rs:48:23 [INFO] [stdout] | [INFO] [stdout] 48 | val = (&leaf).borrow().val; [INFO] [stdout] | ^^^^^^^ help: change this to: `leaf` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `s` [INFO] [stdout] --> src/problems/no115_distinct_subsequence.rs:41:18 [INFO] [stdout] | [INFO] [stdout] 41 | for i in 0..slen { [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] 41 - for i in 0..slen { [INFO] [stdout] 41 + for in s.iter().take(slen) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `print!()` with a format string that ends in a single newline [INFO] [stdout] --> src/problems/no115_distinct_subsequence.rs:44:9 [INFO] [stdout] | [INFO] [stdout] 44 | print!("\n"); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_with_newline [INFO] [stdout] = note: `#[warn(clippy::print_with_newline)]` on by default [INFO] [stdout] help: use `println!` instead [INFO] [stdout] | [INFO] [stdout] 44 - print!("\n"); [INFO] [stdout] 44 + println!(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/problems/no119_pascals_truangle_ii.rs:7:17 [INFO] [stdout] | [INFO] [stdout] 7 | res[j] = res[j] + res[j-1]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `res[j] += res[j-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] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/problems/no125_valid_palindrome.rs:17:9 [INFO] [stdout] | [INFO] [stdout] 17 | return true; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 17 - return true; [INFO] [stdout] 17 + true [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/problems/no126_word_ladder_ii.rs:3:54 [INFO] [stdout] | [INFO] [stdout] 3 | pub fn find_valid_index(target: &str, word_list: &Vec) -> 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] 3 - pub fn find_valid_index(target: &str, word_list: &Vec) -> Vec { [INFO] [stdout] 3 + pub fn find_valid_index(target: &str, word_list: &[String]) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/problems/no126_word_ladder_ii.rs:40:27 [INFO] [stdout] | [INFO] [stdout] 40 | while !is_find && indexes.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!indexes.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: manual saturating arithmetic [INFO] [stdout] --> src/problems/no126_word_ladder_ii.rs:118:20 [INFO] [stdout] | [INFO] [stdout] 118 | if (d1.checked_add(d2).unwrap_or(usize::MAX) )!=min_step { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `saturating_add`: `d1.saturating_add(d2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_saturating_arithmetic [INFO] [stdout] = note: `#[warn(clippy::manual_saturating_arithmetic)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/problems/no126_word_ladder_ii.rs:153:25 [INFO] [stdout] | [INFO] [stdout] 153 | pub fn new(members: &Vec) -> Self { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 153 ~ pub fn new(members: &[String]) -> Self { [INFO] [stdout] 154 | Self { [INFO] [stdout] 155 ~ index_list: members.to_owned(), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/problems/no127_word_ladder.rs:3:54 [INFO] [stdout] | [INFO] [stdout] 3 | pub fn find_valid_index(target: &str, word_list: &Vec) -> Vec { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 3 - pub fn find_valid_index(target: &str, word_list: &Vec) -> Vec { [INFO] [stdout] 3 + pub fn find_valid_index(target: &str, word_list: &[String]) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/problems/no127_word_ladder.rs:40:27 [INFO] [stdout] | [INFO] [stdout] 40 | while !is_find && indexes.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!indexes.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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/problems/no127_word_ladder.rs:89:25 [INFO] [stdout] | [INFO] [stdout] 89 | pub fn new(members: &Vec) -> Self { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 89 ~ pub fn new(members: &[String]) -> Self { [INFO] [stdout] 90 | Self { [INFO] [stdout] 91 ~ index_list: members.to_owned(), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/problems/no130_surrounded_regions.rs:30:17 [INFO] [stdout] | [INFO] [stdout] 30 | dfs(&board, &mut mask, row, 0); [INFO] [stdout] | ^^^^^^ help: change this to: `board` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/problems/no130_surrounded_regions.rs:31:17 [INFO] [stdout] | [INFO] [stdout] 31 | dfs(&board, &mut mask, row, ncol-1); [INFO] [stdout] | ^^^^^^ help: change this to: `board` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/problems/no130_surrounded_regions.rs:35:17 [INFO] [stdout] | [INFO] [stdout] 35 | dfs(&board, &mut mask, 0, col); [INFO] [stdout] | ^^^^^^ help: change this to: `board` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/problems/no130_surrounded_regions.rs:36:17 [INFO] [stdout] | [INFO] [stdout] 36 | dfs(&board, &mut mask, nrow-1, col); [INFO] [stdout] | ^^^^^^ help: change this to: `board` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::str::Chars<'_>` [INFO] [stdout] --> src/problems/no131_palindrome_partitioning.rs:6:17 [INFO] [stdout] | [INFO] [stdout] 6 | let s = s.chars().into_iter().collect::>(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `s.chars()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/problems/no131_palindrome_partitioning.rs:32:26 [INFO] [stdout] | [INFO] [stdout] 32 | buf.push(s[index..idx].iter().map(|&c| c).collect::()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `s[index..idx].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: useless conversion to the same type: `std::str::Chars<'_>` [INFO] [stdout] --> src/problems/no132_palindrome_partitioning_ii.rs:8:17 [INFO] [stdout] | [INFO] [stdout] 8 | let s = s.chars().into_iter().collect::>(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `s.chars()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/problems/no139_word_break.rs:17:33 [INFO] [stdout] | [INFO] [stdout] 17 | dp[i-len] = true && dp[i]; [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `dp[i]` [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: equality checks against false can be replaced by a negation [INFO] [stdout] --> src/problems/no139_word_break.rs:12:16 [INFO] [stdout] | [INFO] [stdout] 12 | if dp[i]==false {continue;} [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `!dp[i]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_comparison)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/problems/no140_word_break_ii.rs:5:16 [INFO] [stdout] | [INFO] [stdout] 5 | if s.len()==0 { [INFO] [stdout] | ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `s.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: length comparison to zero [INFO] [stdout] --> src/problems/no143_reorder_list.rs:38:15 [INFO] [stdout] | [INFO] [stdout] 38 | while buf.len()>0 { [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!buf.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: length comparison to zero [INFO] [stdout] --> src/problems/no143_reorder_list.rs:41:20 [INFO] [stdout] | [INFO] [stdout] 41 | if buf.len()>0 { [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!buf.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: called `unwrap` on `self.head` after checking its variant with `is_none` [INFO] [stdout] --> src/problems/no146_lru_cache.rs:39:18 [INFO] [stdout] | [INFO] [stdout] 36 | if self.head.is_none() { [INFO] [stdout] | ---------------------- help: try: `if let Some() = &self.head` [INFO] [stdout] ... [INFO] [stdout] 39 | Some(self.head.as_ref().unwrap().clone()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `self.tail` after checking its variant with `is_none` [INFO] [stdout] --> src/problems/no146_lru_cache.rs:47:18 [INFO] [stdout] | [INFO] [stdout] 44 | if self.tail.is_none() { [INFO] [stdout] | ---------------------- help: try: `if let Some() = &self.tail` [INFO] [stdout] ... [INFO] [stdout] 47 | Some(self.tail.as_ref().unwrap().clone()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `head` after checking its variant with `is_some` [INFO] [stdout] --> src/problems/no146_lru_cache.rs:74:13 [INFO] [stdout] | [INFO] [stdout] 73 | if head.is_some() { [INFO] [stdout] | ----------------- help: try: `if let Some() = &head` [INFO] [stdout] 74 | head.as_ref().unwrap().borrow_mut().prev = Some(node.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `tail` after checking its variant with `is_some` [INFO] [stdout] --> src/problems/no146_lru_cache.rs:86:13 [INFO] [stdout] | [INFO] [stdout] 85 | if tail.is_some() { [INFO] [stdout] | ----------------- help: try: `if let Some() = &tail` [INFO] [stdout] 86 | tail.as_ref().unwrap().borrow_mut().next = Some(node.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `k` is used to index `points` [INFO] [stdout] --> src/problems/no149_max_points_on_a_line.rs:16:26 [INFO] [stdout] | [INFO] [stdout] 16 | for k in 0..len { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 16 - for k in 0..len { [INFO] [stdout] 16 + for (k, ) in points.iter().enumerate().take(len) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/problems/no164_maximum_gap.rs:19:9 [INFO] [stdout] | [INFO] [stdout] 19 | while let Some(cur) = tree_iter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for cur in tree_iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] = note: `#[warn(clippy::while_let_on_iterator)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this call to `from_str_radix` can be replaced with a call to `str::parse` [INFO] [stdout] --> src/problems/no165_compare_version_numbers.rs:41:30 [INFO] [stdout] | [INFO] [stdout] 41 | let v1 = i32::from_str_radix(v1, 10).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `v1.parse::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_str_radix_10 [INFO] [stdout] = note: `#[warn(clippy::from_str_radix_10)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this call to `from_str_radix` can be replaced with a call to `str::parse` [INFO] [stdout] --> src/problems/no165_compare_version_numbers.rs:42:30 [INFO] [stdout] | [INFO] [stdout] 42 | let v2 = i32::from_str_radix(v2, 10).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `v2.parse::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_str_radix_10 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this call to `from_str_radix` can be replaced with a call to `str::parse` [INFO] [stdout] --> src/problems/no165_compare_version_numbers.rs:47:24 [INFO] [stdout] | [INFO] [stdout] 47 | if i32::from_str_radix(v1, 10).unwrap()==0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `v1.parse::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_str_radix_10 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this call to `from_str_radix` can be replaced with a call to `str::parse` [INFO] [stdout] --> src/problems/no165_compare_version_numbers.rs:54:24 [INFO] [stdout] | [INFO] [stdout] 54 | if i32::from_str_radix(v2, 10).unwrap()==0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `v2.parse::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_str_radix_10 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/problems/no48_rotate_image.rs:4:27 [INFO] [stdout] | [INFO] [stdout] 4 | pub fn rotate(matrix: &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] help: change this to [INFO] [stdout] | [INFO] [stdout] 4 - pub fn rotate(matrix: &mut Vec>) { [INFO] [stdout] 4 + pub fn rotate(matrix: &mut [Vec]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: iterating on a map's values [INFO] [stdout] --> src/problems/no49_group_anagrams.rs:17:9 [INFO] [stdout] | [INFO] [stdout] 17 | / map.into_iter() [INFO] [stdout] 18 | | .map(|(_, value)| value) [INFO] [stdout] | |____________________________________^ help: try: `map.into_values()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map [INFO] [stdout] = note: `#[warn(clippy::iter_kv_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting float literal to `f64` is unnecessary [INFO] [stdout] --> src/problems/no50_pow_xn.rs:28:16 [INFO] [stdout] | [INFO] [stdout] 28 | (res * (1e5) as f64).round() * (1e-5) as f64 [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `1e5_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 float literal to `f64` is unnecessary [INFO] [stdout] --> src/problems/no50_pow_xn.rs:28:40 [INFO] [stdout] | [INFO] [stdout] 28 | (res * (1e5) as f64).round() * (1e-5) as f64 [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `1e-5_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: unneeded `()` [INFO] [stdout] --> src/problems/no51_n_queens.rs:105:20 [INFO] [stdout] | [INFO] [stdout] 105 | return (); [INFO] [stdout] | ^^ help: remove the `()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stdout] = note: `#[warn(clippy::unused_unit)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `()` [INFO] [stdout] --> src/problems/no52_n_queens_ii.rs:95:20 [INFO] [stdout] | [INFO] [stdout] 95 | return (); [INFO] [stdout] | ^^ help: remove the `()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `nums` [INFO] [stdout] --> src/problems/no53_maximun_subarray.rs:7:18 [INFO] [stdout] | [INFO] [stdout] 7 | for i in 1..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] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 7 - for i in 1..nums.len() { [INFO] [stdout] 7 + for in nums.iter().skip(1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/problems/no55_jump_game.rs:16:9 [INFO] [stdout] | [INFO] [stdout] 16 | return true; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 16 - return true; [INFO] [stdout] 16 + true [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `res` [INFO] [stdout] --> src/problems/no59_spiral_matrix_ii.rs:13:22 [INFO] [stdout] | [INFO] [stdout] 13 | for i in l..=r { [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] 13 - for i in l..=r { [INFO] [stdout] 13 + for in res.iter_mut().take(r + 1).skip(l) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `res` [INFO] [stdout] --> src/problems/no59_spiral_matrix_ii.rs:19:22 [INFO] [stdout] | [INFO] [stdout] 19 | for i in t..=b { [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] 19 - for i in t..=b { [INFO] [stdout] 19 + for in res.iter_mut().take(b + 1).skip(t) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/problems/no62_unique_paths.rs:25:9 [INFO] [stdout] | [INFO] [stdout] 25 | return paths[m - 1][n - 1] as i32; [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] 25 - return paths[m - 1][n - 1] as i32; [INFO] [stdout] 25 + paths[m - 1][n - 1] as i32 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `paths` [INFO] [stdout] --> src/problems/no62_unique_paths.rs:13:18 [INFO] [stdout] | [INFO] [stdout] 13 | for i in 0..m { [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] 13 - for i in 0..m { [INFO] [stdout] 13 + for in paths.iter_mut().take(m) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `paths` [INFO] [stdout] --> src/problems/no62_unique_paths.rs:16:18 [INFO] [stdout] | [INFO] [stdout] 16 | for i in 0..n { [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] 16 - for i in 0..n { [INFO] [stdout] 16 + for in paths.iter_mut().take(n) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/problems/no65_valid_number.rs:12:21 [INFO] [stdout] | [INFO] [stdout] 12 | / if !exp_tag { [INFO] [stdout] 13 | | exp_tag = true; [INFO] [stdout] 14 | | true [INFO] [stdout] 15 | | } else { [INFO] [stdout] 16 | | false [INFO] [stdout] 17 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 11 ~ 'e' | 'E' [INFO] [stdout] 12 ~ if !exp_tag => { [INFO] [stdout] 13 | exp_tag = true; [INFO] [stdout] 14 | true [INFO] [stdout] 15 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/problems/no65_valid_number.rs:34:21 [INFO] [stdout] | [INFO] [stdout] 34 | / if i == 0 { [INFO] [stdout] 35 | | true [INFO] [stdout] 36 | | } else { [INFO] [stdout] 37 | | false [INFO] [stdout] 38 | | } [INFO] [stdout] | |_____________________^ help: you can reduce it to: `i == 0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [INFO] [stdout] = note: `#[warn(clippy::needless_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/problems/no67_add_binary.rs:38:13 [INFO] [stdout] | [INFO] [stdout] 38 | tmp.push_str("1") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `tmp.push('1')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] = note: `#[warn(clippy::single_char_add_str)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is used to index `words` [INFO] [stdout] --> src/problems/no68_text_justification.rs:24:22 [INFO] [stdout] | [INFO] [stdout] 24 | for j in sp + 1..i { [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 and enumerate() [INFO] [stdout] | [INFO] [stdout] 24 - for j in sp + 1..i { [INFO] [stdout] 24 + for (j, ) in words.iter().enumerate().take(i).skip(sp + 1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice` [INFO] [stdout] --> src/problems/no68_text_justification.rs:71:30 [INFO] [stdout] | [INFO] [stdout] 71 | for s in words[sp..].into_iter() { [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] = note: `#[warn(clippy::into_iter_on_ref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/problems/no68_text_justification.rs:72:16 [INFO] [stdout] | [INFO] [stdout] 72 | if tmp_str.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!tmp_str.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `dp` [INFO] [stdout] --> src/problems/no72_edit_distance.rs:16:18 [INFO] [stdout] | [INFO] [stdout] 16 | for i in 1..=n2 { [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 and enumerate() [INFO] [stdout] | [INFO] [stdout] 16 - for i in 1..=n2 { [INFO] [stdout] 16 + for (i, ) in dp.iter_mut().enumerate().take(n2 + 1).skip(1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `dp` [INFO] [stdout] --> src/problems/no72_edit_distance.rs:21:18 [INFO] [stdout] | [INFO] [stdout] 21 | for i in 1..=n1 { [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 and enumerate() [INFO] [stdout] | [INFO] [stdout] 21 - for i in 1..=n1 { [INFO] [stdout] 21 + for (i, ) in dp.iter_mut().enumerate().take(n1 + 1).skip(1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/problems/no72_edit_distance.rs:29:32 [INFO] [stdout] | [INFO] [stdout] 29 | dp[i][j] = 0 + dp[i - 1][j - 1]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider reducing it to: `dp[i - 1][j - 1]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] = note: `#[warn(clippy::identity_op)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/problems/no73_set_matrix_zeros.rs:3:31 [INFO] [stdout] | [INFO] [stdout] 3 | pub fn set_zeroes(matrix: &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] help: change this to [INFO] [stdout] | [INFO] [stdout] 3 - pub fn set_zeroes(matrix: &mut Vec>) { [INFO] [stdout] 3 + pub fn set_zeroes(matrix: &mut [Vec]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/problems/no75_sort_colors.rs:5:30 [INFO] [stdout] | [INFO] [stdout] 5 | pub fn sort_colors(nums: &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] help: change this to [INFO] [stdout] | [INFO] [stdout] 5 - pub fn sort_colors(nums: &mut Vec) { [INFO] [stdout] 5 + pub fn sort_colors(nums: &mut [i32]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::ops::RangeInclusive` [INFO] [stdout] --> src/problems/no77_combine.rs:17:23 [INFO] [stdout] | [INFO] [stdout] 17 | let mut tmp = (1..=k).into_iter().collect::>(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `(1..=k)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/problems/no78_subsets.rs:3:48 [INFO] [stdout] | [INFO] [stdout] 3 | fn append(result: &mut Vec>, buf: &Vec, nums: &[i32]) { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 3 ~ fn append(result: &mut Vec>, buf: &[i32], nums: &[i32]) { [INFO] [stdout] 4 ~ result.push(buf.to_owned()); [INFO] [stdout] 5 | for (i, &e) in nums.iter().enumerate() { [INFO] [stdout] 6 ~ let mut buf = buf.to_owned(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/problems/no79_word_search.rs:5:12 [INFO] [stdout] | [INFO] [stdout] 5 | if word.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `word.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/problems/no79_word_search.rs:44:17 [INFO] [stdout] | [INFO] [stdout] 44 | / if board[i][j] as u8 == word[0] { [INFO] [stdout] 45 | | if Solution::next(&mut board, &word[1..], i, j) { [INFO] [stdout] 46 | | return true; [INFO] [stdout] 47 | | }; [INFO] [stdout] 48 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 44 ~ if board[i][j] as u8 == word[0] [INFO] [stdout] 45 ~ && Solution::next(&mut board, &word[1..], i, j) { [INFO] [stdout] 46 | return true; [INFO] [stdout] 47 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/problems/no80_remove_duplicates_from_sorted_array_ii.rs:56:36 [INFO] [stdout] | [INFO] [stdout] 56 | pub fn remove_duplicates(nums: &mut Vec) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 56 - pub fn remove_duplicates(nums: &mut Vec) -> i32 { [INFO] [stdout] 56 + pub fn remove_duplicates(nums: &mut [i32]) -> i32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/problems/no84_largest_rectangle_in_histogram.rs:20:9 [INFO] [stdout] | [INFO] [stdout] 20 | return res; [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] 20 - return res; [INFO] [stdout] 20 + res [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/problems/no84_largest_rectangle_in_histogram.rs:11:19 [INFO] [stdout] | [INFO] [stdout] 11 | while stack.len() > 0 && heights[*stack.iter().last().unwrap()] > *h { [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/problems/no85_maximal_rectangle.rs:23:9 [INFO] [stdout] | [INFO] [stdout] 23 | return res; [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] 23 - return res; [INFO] [stdout] 23 + res [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/problems/no85_maximal_rectangle.rs:5:12 [INFO] [stdout] | [INFO] [stdout] 5 | if matrix.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] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/problems/no85_maximal_rectangle.rs:39:9 [INFO] [stdout] | [INFO] [stdout] 39 | return res; [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] 39 - return res; [INFO] [stdout] 39 + res [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/problems/no85_maximal_rectangle.rs:26:33 [INFO] [stdout] | [INFO] [stdout] 26 | pub fn maxInHistogram(hist: &Vec) -> i32 { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 26 - pub fn maxInHistogram(hist: &Vec) -> i32 { [INFO] [stdout] 26 + pub fn maxInHistogram(hist: &[i32]) -> i32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/problems/no85_maximal_rectangle.rs:31:19 [INFO] [stdout] | [INFO] [stdout] 31 | while stack.len() > 0 && hist[*stack.iter().last().unwrap()] > *val { [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: this pattern creates a reference to a reference [INFO] [stdout] --> src/problems/no86_partition_list.rs:21:24 [INFO] [stdout] | [INFO] [stdout] 21 | while let Some(ref node) = head { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 21 - while let Some(ref node) = head { [INFO] [stdout] 21 + while let Some(node) = head { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is used to index `s1` [INFO] [stdout] --> src/problems/no87_scramble_string.rs:19:26 [INFO] [stdout] | [INFO] [stdout] 19 | for j in 0..s1.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 and enumerate() [INFO] [stdout] | [INFO] [stdout] 19 - for j in 0..s1.len() { [INFO] [stdout] 19 + for (j, ) in s1.iter().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: parameter is only used in recursion [INFO] [stdout] --> src/problems/no87_scramble_string.rs:3:54 [INFO] [stdout] | [INFO] [stdout] 3 | fn greedy_split(s1: Vec, target: String, counter: i32) -> bool { [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_counter` [INFO] [stdout] | [INFO] [stdout] note: parameter used here [INFO] [stdout] --> src/problems/no87_scramble_string.rs:31:71 [INFO] [stdout] | [INFO] [stdout] 31 | if Self::greedy_split(next_stack, target.to_string(), counter + 1) [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] 32 | || Self::greedy_split(next_stack_swap, target.to_string(), counter + 1) [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#only_used_in_recursion [INFO] [stdout] = note: `#[warn(clippy::only_used_in_recursion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/problems/no88_merge_sorted_array.rs:3:25 [INFO] [stdout] | [INFO] [stdout] 3 | pub fn merge(nums1: &mut Vec, m: i32, nums2: &mut Vec, n: i32) { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 3 - pub fn merge(nums1: &mut Vec, m: i32, nums2: &mut Vec, n: i32) { [INFO] [stdout] 3 + pub fn merge(nums1: &mut [i32], m: i32, nums2: &mut Vec, n: i32) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/problems/no88_merge_sorted_array.rs:3:55 [INFO] [stdout] | [INFO] [stdout] 3 | pub fn merge(nums1: &mut Vec, m: i32, nums2: &mut Vec, n: i32) { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 3 - pub fn merge(nums1: &mut Vec, m: i32, nums2: &mut Vec, n: i32) { [INFO] [stdout] 3 + pub fn merge(nums1: &mut Vec, m: i32, nums2: &mut [i32], n: i32) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/problems/no90_subsets_ii.rs:6:12 [INFO] [stdout] | [INFO] [stdout] 6 | if map.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `map.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: useless conversion to the same type: `std::collections::hash_map::Keys<'_, i32, i32>` [INFO] [stdout] --> src/problems/no90_subsets_ii.rs:26:19 [INFO] [stdout] | [INFO] [stdout] 26 | let map = map [INFO] [stdout] | ___________________^ [INFO] [stdout] 27 | | .keys() [INFO] [stdout] 28 | | .into_iter() [INFO] [stdout] | |________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 26 ~ let map = map [INFO] [stdout] 27 + .keys() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/problems/no91_decode_ways.rs:4:21 [INFO] [stdout] | [INFO] [stdout] 4 | fn check(s: &Vec, idx: usize) -> bool { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 4 - fn check(s: &Vec, idx: usize) -> bool { [INFO] [stdout] 4 + fn check(s: &[char], idx: usize) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/problems/no91_decode_ways.rs:8:24 [INFO] [stdout] | [INFO] [stdout] 8 | '2' => match s[idx] { [INFO] [stdout] | ________________________^ [INFO] [stdout] 9 | | '0' | '1' | '2' | '3' | '4' | '5' | '6' => true, [INFO] [stdout] 10 | | _ => false, [INFO] [stdout] 11 | | }, [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] = note: `#[warn(clippy::match_like_matches_macro)]` on by default [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 8 - '2' => match s[idx] { [INFO] [stdout] 9 - '0' | '1' | '2' | '3' | '4' | '5' | '6' => true, [INFO] [stdout] 10 - _ => false, [INFO] [stdout] 11 - }, [INFO] [stdout] 8 + '2' => matches!(s[idx], '0' | '1' | '2' | '3' | '4' | '5' | '6'), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::str::Chars<'_>` [INFO] [stdout] --> src/problems/no91_decode_ways.rs:17:17 [INFO] [stdout] | [INFO] [stdout] 17 | let s = s.chars().into_iter().collect::>(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `s.chars()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `null_value` [INFO] [stdout] --> src/lib/treenode.rs:22:39 [INFO] [stdout] | [INFO] [stdout] 22 | pub fn layer_gen(array: Vec, null_value: i32) -> Option>> { [INFO] [stdout] | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_null_value` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/problems/no93_restore_ip_addresses.rs:28:32 [INFO] [stdout] | [INFO] [stdout] 28 | } else if s[spliter[i] + 1] == 53 { [INFO] [stdout] | ________________________________^ [INFO] [stdout] 29 | | if s[spliter[i] + 2] > 53 { [INFO] [stdout] 30 | | return None; [INFO] [stdout] 31 | | } [INFO] [stdout] 32 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 28 ~ } else if s[spliter[i] + 1] == 53 [INFO] [stdout] 29 ~ && s[spliter[i] + 2] > 53 { [INFO] [stdout] 30 | return None; [INFO] [stdout] 31 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `l_trees` [INFO] [stdout] --> src/problems/no95_unique_binary_search_trees_ii.rs:43:22 [INFO] [stdout] | [INFO] [stdout] 43 | for i in 0..l_trees.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] 43 - for i in 0..l_trees.len() { [INFO] [stdout] 43 + for in &l_trees { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is only used to index `r_trees` [INFO] [stdout] --> src/problems/no95_unique_binary_search_trees_ii.rs:44:26 [INFO] [stdout] | [INFO] [stdout] 44 | for j in 0..r_trees.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] 44 - for j in 0..r_trees.len() { [INFO] [stdout] 44 + for in &r_trees { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this looks like you are swapping `x.val` and `y.val` manually [INFO] [stdout] --> src/problems/no99_recover_binary_search_tree.rs:89:9 [INFO] [stdout] | [INFO] [stdout] 89 | / let tmp = x.val; [INFO] [stdout] 90 | | x.val = y.val; [INFO] [stdout] 91 | | y.val = tmp; [INFO] [stdout] | |____________________^ help: try: `std::mem::swap(&mut x.val, &mut y.val);` [INFO] [stdout] | [INFO] [stdout] = note: or maybe you should use `std::mem::replace`? [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/problems/no99_recover_binary_search_tree.rs:50:36 [INFO] [stdout] | [INFO] [stdout] 50 | Some(Rc::clone(&leaf)) [INFO] [stdout] | ^^^^^ help: change this to: `leaf` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/problems/no99_recover_binary_search_tree.rs:77:36 [INFO] [stdout] | [INFO] [stdout] 77 | Some(Rc::clone(&leaf)) [INFO] [stdout] | ^^^^^ help: change this to: `leaf` [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: method `maxInHistogram` should have a snake case name [INFO] [stdout] --> src/problems/no85_maximal_rectangle.rs:26:12 [INFO] [stdout] | [INFO] [stdout] 26 | pub fn maxInHistogram(hist: &Vec) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: convert the identifier to snake case: `max_in_histogram` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(non_snake_case)]` (part of `#[warn(nonstandard_style)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `val` is never read [INFO] [stdout] --> src/problems/no113_path_sum_ii.rs:33:27 [INFO] [stdout] | [INFO] [stdout] 33 | let mut val = 0; [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] = note: `#[warn(unused_assignments)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `output` [INFO] [stdout] --> src/problems/no114_flatten_binary_tree_to_linked_list.rs:60:13 [INFO] [stdout] | [INFO] [stdout] 60 | let output = Solution::flatten(&mut inputs); [INFO] [stdout] | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_output` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `output` [INFO] [stdout] --> src/problems/no114_flatten_binary_tree_to_linked_list.rs:67:13 [INFO] [stdout] | [INFO] [stdout] 67 | let output = Solution::flatten(&mut inputs); [INFO] [stdout] | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_output` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `output` [INFO] [stdout] --> src/problems/no114_flatten_binary_tree_to_linked_list.rs:74:13 [INFO] [stdout] | [INFO] [stdout] 74 | let output = Solution::flatten(&mut inputs); [INFO] [stdout] | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_output` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/problems/no115_distinct_subsequence.rs:19:13 [INFO] [stdout] | [INFO] [stdout] 19 | let mut repeat_times = 0; [INFO] [stdout] | ----^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `repeat_times` [INFO] [stdout] --> src/problems/no115_distinct_subsequence.rs:19:13 [INFO] [stdout] | [INFO] [stdout] 19 | let mut repeat_times = 0; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_repeat_times` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `output` [INFO] [stdout] --> src/problems/no116_populating_next_right_pointers_in_each_node.rs:58:13 [INFO] [stdout] | [INFO] [stdout] 58 | let output = Solution::connect(&mut inputs); [INFO] [stdout] | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_output` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `output` [INFO] [stdout] --> src/problems/no117_populating_next_right_pointers_in_each_node_ii.rs:58:13 [INFO] [stdout] | [INFO] [stdout] 58 | let output = Solution::connect(&mut inputs); [INFO] [stdout] | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_output` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/problems/no118_pascals_triangle.rs:14:25 [INFO] [stdout] | [INFO] [stdout] 14 | let mut prev_vec = res.last().unwrap(); [INFO] [stdout] | ----^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `i` [INFO] [stdout] --> src/problems/no118_pascals_triangle.rs:12:21 [INFO] [stdout] | [INFO] [stdout] 12 | for i in 2..num_rows { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_i` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `ret` [INFO] [stdout] --> src/problems/no146_lru_cache.rs:210:13 [INFO] [stdout] | [INFO] [stdout] 210 | let ret = obj.get(1); [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_ret` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `ret` [INFO] [stdout] --> src/problems/no146_lru_cache.rs:223:13 [INFO] [stdout] | [INFO] [stdout] 223 | let ret = obj.get(2); [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_ret` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `ret` [INFO] [stdout] --> src/problems/no146_lru_cache.rs:225:13 [INFO] [stdout] | [INFO] [stdout] 225 | let ret = obj.get(2); [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_ret` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `ret` [INFO] [stdout] --> src/problems/no146_lru_cache.rs:259:13 [INFO] [stdout] | [INFO] [stdout] 259 | let ret = obj.get(6); [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_ret` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `ret` [INFO] [stdout] --> src/problems/no146_lru_cache.rs:260:13 [INFO] [stdout] | [INFO] [stdout] 260 | let ret = obj.get(8); [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_ret` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `ret` [INFO] [stdout] --> src/problems/no146_lru_cache.rs:262:13 [INFO] [stdout] | [INFO] [stdout] 262 | let ret = obj.get(2); [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_ret` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/problems/no148_sort_list.rs:20:14 [INFO] [stdout] | [INFO] [stdout] 20 | fn merge(mut left: Option>, mut right: Option>) -> Option> { [INFO] [stdout] | ----^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/problems/no148_sort_list.rs:20:47 [INFO] [stdout] | [INFO] [stdout] 20 | fn merge(mut left: Option>, mut right: Option>) -> Option> { [INFO] [stdout] | ----^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: irrefutable `while let` pattern [INFO] [stdout] --> src/problems/no165_compare_version_numbers.rs:38:15 [INFO] [stdout] | [INFO] [stdout] 38 | while let (v1, v2) = (v1_iter.next(), v2_iter.next()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: this pattern will always match, so the loop will never exit [INFO] [stdout] = help: consider instead using a `loop { ... }` with a `let` inside it [INFO] [stdout] = note: `#[warn(irrefutable_let_patterns)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unreachable pattern [INFO] [stdout] --> src/problems/no67_add_binary.rs:19:21 [INFO] [stdout] | [INFO] [stdout] 18 | val => val - 48, [INFO] [stdout] | --- matches any value [INFO] [stdout] 19 | _ => 0, [INFO] [stdout] | ^ no value can reach this [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unreachable_patterns)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unreachable pattern [INFO] [stdout] --> src/problems/no67_add_binary.rs:27:21 [INFO] [stdout] | [INFO] [stdout] 26 | val => val - 48, [INFO] [stdout] | --- matches any value [INFO] [stdout] 27 | _ => 0, [INFO] [stdout] | ^ no value can reach this [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/problems/no67_add_binary.rs:8:13 [INFO] [stdout] | [INFO] [stdout] 8 | let mut a = a.as_bytes(); [INFO] [stdout] | ----^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/problems/no67_add_binary.rs:9:13 [INFO] [stdout] | [INFO] [stdout] 9 | let mut b = b.as_bytes(); [INFO] [stdout] | ----^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `space` is never read [INFO] [stdout] --> src/problems/no68_text_justification.rs:18:29 [INFO] [stdout] | [INFO] [stdout] 18 | let mut space = "".to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `output` [INFO] [stdout] --> src/problems/no73_set_matrix_zeros.rs:47:13 [INFO] [stdout] | [INFO] [stdout] 47 | let output = Solution::set_zeroes(&mut inputs); [INFO] [stdout] | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_output` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `output` [INFO] [stdout] --> src/problems/no73_set_matrix_zeros.rs:55:13 [INFO] [stdout] | [INFO] [stdout] 55 | let output = Solution::set_zeroes(&mut inputs); [INFO] [stdout] | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_output` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/problems/no74_search_matrix.rs:5:13 [INFO] [stdout] | [INFO] [stdout] 5 | let mut ncol = matrix[0].len(); [INFO] [stdout] | ----^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `right` [INFO] [stdout] --> src/problems/no75_sort_colors.rs:46:17 [INFO] [stdout] | [INFO] [stdout] 46 | let right = right + 1; [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_right` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `output` [INFO] [stdout] --> src/problems/no75_sort_colors.rs:68:13 [INFO] [stdout] | [INFO] [stdout] 68 | let output = Solution::sort_colors(&mut inputs); [INFO] [stdout] | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_output` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/problems/no77_combine.rs:19:13 [INFO] [stdout] | [INFO] [stdout] 19 | let mut count = 0; [INFO] [stdout] | ----^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `count` [INFO] [stdout] --> src/problems/no77_combine.rs:19:13 [INFO] [stdout] | [INFO] [stdout] 19 | let mut count = 0; [INFO] [stdout] | ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_count` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `i` [INFO] [stdout] --> src/problems/no90_subsets_ii.rs:17:13 [INFO] [stdout] | [INFO] [stdout] 17 | for i in 0..map[0].1 { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_i` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `output` [INFO] [stdout] --> src/problems/no99_recover_binary_search_tree.rs:134:13 [INFO] [stdout] | [INFO] [stdout] 134 | let output = Solution::recover_tree(&mut inputs); [INFO] [stdout] | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_output` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `output` [INFO] [stdout] --> src/problems/no99_recover_binary_search_tree.rs:166:13 [INFO] [stdout] | [INFO] [stdout] 166 | let output = Solution::recover_tree(&mut inputs); [INFO] [stdout] | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_output` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait `Generator` is never used [INFO] [stdout] --> src/lib/treenode.rs:58:11 [INFO] [stdout] | [INFO] [stdout] 58 | pub trait Generator { [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] --> src/problems/no100_same_tree.rs:14:12 [INFO] [stdout] | [INFO] [stdout] 12 | impl TreeNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 13 | #[inline] [INFO] [stdout] 14 | pub fn new(val: i32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/problems/no101_symmetric_tree.rs:14:12 [INFO] [stdout] | [INFO] [stdout] 12 | impl TreeNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 13 | #[inline] [INFO] [stdout] 14 | pub fn new(val: i32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/problems/no102_binary_tree_level_order_traversal.rs:14:12 [INFO] [stdout] | [INFO] [stdout] 12 | impl TreeNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 13 | #[inline] [INFO] [stdout] 14 | pub fn new(val: i32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/problems/no103_binary_tree_zigzag_level_order_traversal.rs:14:12 [INFO] [stdout] | [INFO] [stdout] 12 | impl TreeNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 13 | #[inline] [INFO] [stdout] 14 | pub fn new(val: i32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/problems/no104_maximum_depth_of_binary_tree.rs:14:12 [INFO] [stdout] | [INFO] [stdout] 12 | impl TreeNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 13 | #[inline] [INFO] [stdout] 14 | pub fn new(val: i32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/problems/no105_construct_binary_tree_from_preorder_and_inorder_traversal.rs:12:12 [INFO] [stdout] | [INFO] [stdout] 10 | impl TreeNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 11 | #[inline] [INFO] [stdout] 12 | pub fn new(val: i32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/problems/no106_construct_binary_tree_from_inorder_and_postorder_traversal.rs:14:12 [INFO] [stdout] | [INFO] [stdout] 12 | impl TreeNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 13 | #[inline] [INFO] [stdout] 14 | pub fn new(val: i32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no109_convert_sorted_list_to_binary_search_tree.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 3 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `ListNode` is never constructed [INFO] [stdout] --> src/problems/no109_convert_sorted_list_to_binary_search_tree.rs:6:12 [INFO] [stdout] | [INFO] [stdout] 6 | pub struct ListNode { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/problems/no109_convert_sorted_list_to_binary_search_tree.rs:13:8 [INFO] [stdout] | [INFO] [stdout] 11 | impl ListNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 12 | #[inline] [INFO] [stdout] 13 | fn new(val: i32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `TreeNode` is never constructed [INFO] [stdout] --> src/problems/no109_convert_sorted_list_to_binary_search_tree.rs:19:12 [INFO] [stdout] | [INFO] [stdout] 19 | pub struct TreeNode { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/problems/no109_convert_sorted_list_to_binary_search_tree.rs:27:12 [INFO] [stdout] | [INFO] [stdout] 25 | impl TreeNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 26 | #[inline] [INFO] [stdout] 27 | pub fn new(val: i32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `sorted_list_to_bst` is never used [INFO] [stdout] --> src/problems/no109_convert_sorted_list_to_binary_search_tree.rs:37:12 [INFO] [stdout] | [INFO] [stdout] 36 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 37 | pub fn sorted_list_to_bst(head: Option>) -> Option>> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `add_front`, `add_back`, and `move_tail` are never used [INFO] [stdout] --> src/problems/no146_lru_cache.rs:51:12 [INFO] [stdout] | [INFO] [stdout] 30 | impl DoubleListNode { [INFO] [stdout] | ------------------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 51 | pub fn add_front(&mut self, key: i32, value: i32) { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 61 | pub fn add_back(&mut self, key: i32, value: i32) { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 129 | pub fn move_tail(&mut self, target: Rc>) { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no155_min_stack.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/problems/no61_rotate_list.rs:12:8 [INFO] [stdout] | [INFO] [stdout] 10 | impl ListNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 11 | #[inline] [INFO] [stdout] 12 | fn new(val: i32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/problems/no71_simplify_path.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `simplify_path` is never used [INFO] [stdout] --> src/problems/no71_simplify_path.rs:4:12 [INFO] [stdout] | [INFO] [stdout] 3 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 4 | pub fn simplify_path(path: String) -> String { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/problems/no83_remove_duplicates_from_sorted_list.rs:10:8 [INFO] [stdout] | [INFO] [stdout] 8 | impl ListNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 9 | #[inline] [INFO] [stdout] 10 | fn new(val: i32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `greedy_split` is never used [INFO] [stdout] --> src/problems/no87_scramble_string.rs:3:8 [INFO] [stdout] | [INFO] [stdout] 2 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 3 | fn greedy_split(s1: Vec, target: String, counter: i32) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `discussion_bitwise` is never used [INFO] [stdout] --> src/problems/no89_gray_code.rs:3:8 [INFO] [stdout] | [INFO] [stdout] 2 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 3 | fn discussion_bitwise(n: i32) -> Vec { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/problems/no94_binary_tree_inorder_traversal.rs:14:12 [INFO] [stdout] | [INFO] [stdout] 12 | impl TreeNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 13 | #[inline] [INFO] [stdout] 14 | pub fn new(val: i32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/problems/no98_validate_binary_search_tree.rs:14:12 [INFO] [stdout] | [INFO] [stdout] 12 | impl TreeNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 13 | #[inline] [INFO] [stdout] 14 | pub fn new(val: i32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/problems/no99_recover_binary_search_tree.rs:14:12 [INFO] [stdout] | [INFO] [stdout] 12 | impl TreeNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 13 | #[inline] [INFO] [stdout] 14 | pub fn new(val: i32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `val` is never read [INFO] [stdout] --> src/problems/syntex_test.rs:3:5 [INFO] [stdout] | [INFO] [stdout] 2 | struct ListNode { [INFO] [stdout] | -------- field in this struct [INFO] [stdout] 3 | val: i32, [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = note: `ListNode` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/problems/syntex_test.rs:8:12 [INFO] [stdout] | [INFO] [stdout] 7 | impl ListNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 8 | pub fn new(val: i32) -> Option> { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/problems/no144_binary_tree_preorder_traversal.rs:14:12 [INFO] [stdout] | [INFO] [stdout] 12 | impl TreeNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 13 | #[inline] [INFO] [stdout] 14 | pub fn new(val: i32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/problems/no145_binary_tree_postorder_traversal.rs:14:12 [INFO] [stdout] | [INFO] [stdout] 12 | impl TreeNode { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 13 | #[inline] [INFO] [stdout] 14 | pub fn new(val: i32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/problems/no100_same_tree.rs:51:9 [INFO] [stdout] | [INFO] [stdout] 51 | return true; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 51 - return true; [INFO] [stdout] 51 + true [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/problems/no101_symmetric_tree.rs:42:21 [INFO] [stdout] | [INFO] [stdout] 42 | return false; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 42 - return false; [INFO] [stdout] 42 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/problems/no101_symmetric_tree.rs:45:17 [INFO] [stdout] | [INFO] [stdout] 45 | return false; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 45 - return false; [INFO] [stdout] 45 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/problems/no102_binary_tree_level_order_traversal.rs:47:16 [INFO] [stdout] | [INFO] [stdout] 47 | if next_layer.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!next_layer.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/problems/no102_binary_tree_level_order_traversal.rs:50:16 [INFO] [stdout] | [INFO] [stdout] 50 | if curr_layer.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!curr_layer.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: length comparison to zero [INFO] [stdout] --> src/problems/no103_binary_tree_zigzag_level_order_traversal.rs:61:16 [INFO] [stdout] | [INFO] [stdout] 61 | if next_layer.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!next_layer.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: length comparison to zero [INFO] [stdout] --> src/problems/no103_binary_tree_zigzag_level_order_traversal.rs:64:16 [INFO] [stdout] | [INFO] [stdout] 64 | if curr_layer.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!curr_layer.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: manual implementation of `Option::map` [INFO] [stdout] --> src/problems/no105_construct_binary_tree_from_preorder_and_inorder_traversal.rs:27:13 [INFO] [stdout] | [INFO] [stdout] 27 | / if let Some(pivot) = inorder.iter().position(|&v| v == preorder[0]) { [INFO] [stdout] 28 | | Some(Rc::new(RefCell::new(TreeNode { [INFO] [stdout] 29 | | val: preorder[0], [INFO] [stdout] 30 | | left: builder(&preorder[1..(1 + pivot)], &inorder[..pivot]), [INFO] [stdout] ... | [INFO] [stdout] 34 | | None [INFO] [stdout] 35 | | } [INFO] [stdout] | |_____________^ [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] help: try [INFO] [stdout] | [INFO] [stdout] 27 ~ inorder.iter().position(|&v| v == preorder[0]).map(|pivot| Rc::new(RefCell::new(TreeNode { [INFO] [stdout] 28 + val: preorder[0], [INFO] [stdout] 29 + left: builder(&preorder[1..(1 + pivot)], &inorder[..pivot]), [INFO] [stdout] 30 + right: builder(&preorder[(1 + pivot)..], &inorder[(pivot + 1)..]), [INFO] [stdout] 31 + }))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/problems/no106_construct_binary_tree_from_inorder_and_postorder_traversal.rs:25:13 [INFO] [stdout] | [INFO] [stdout] 25 | / if let Some(pivot) = inorder [INFO] [stdout] 26 | | .iter() [INFO] [stdout] 27 | | .position(|v| v == postorder.iter().last().unwrap()) [INFO] [stdout] ... | [INFO] [stdout] 38 | | None [INFO] [stdout] 39 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 25 ~ inorder [INFO] [stdout] 26 + .iter() [INFO] [stdout] 27 + .position(|v| v == postorder.iter().last().unwrap()).map(|pivot| Rc::new(RefCell::new(TreeNode { [INFO] [stdout] 28 + val: inorder[pivot], [INFO] [stdout] 29 + left: builder(&inorder[..pivot], &postorder[..pivot]), [INFO] [stdout] 30 + right: builder( [INFO] [stdout] 31 + &inorder[pivot + 1..], [INFO] [stdout] 32 + &postorder[pivot..postorder.len() - 1], [INFO] [stdout] 33 + ), [INFO] [stdout] 34 + }))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: items after a test module [INFO] [stdout] --> src/problems/no107_binary_tree_level_order_traversal_ii.rs:56:1 [INFO] [stdout] | [INFO] [stdout] 56 | mod test { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 68 | impl TreeNode { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#items_after_test_module [INFO] [stdout] = note: `#[warn(clippy::items_after_test_module)]` on by default [INFO] [stdout] = help: move the items to before the test module was defined [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: items after a test module [INFO] [stdout] --> src/problems/no108_convert_sorted_array_to_binary_search.rs:43:1 [INFO] [stdout] | [INFO] [stdout] 43 | mod test { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 54 | use std::collections::VecDeque; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] 55 | impl TreeNode { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#items_after_test_module [INFO] [stdout] = help: move the items to before the test module was defined [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: items after a test module [INFO] [stdout] --> src/problems/no110_balanced_binary_tree.rs:42:1 [INFO] [stdout] | [INFO] [stdout] 42 | mod test { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 69 | use std::collections::VecDeque; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] 70 | impl TreeNode { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#items_after_test_module [INFO] [stdout] = help: move the items to before the test module was defined [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `tree` after checking its variant with `is_none` [INFO] [stdout] --> src/problems/no110_balanced_binary_tree.rs:29:38 [INFO] [stdout] | [INFO] [stdout] 26 | if tree.is_none() { [INFO] [stdout] | ----------------- help: try: `if let Some() = &tree` [INFO] [stdout] ... [INFO] [stdout] 29 | let left = max_depth(tree.as_ref().unwrap().borrow().left.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `tree` after checking its variant with `is_none` [INFO] [stdout] --> src/problems/no110_balanced_binary_tree.rs:30:39 [INFO] [stdout] | [INFO] [stdout] 26 | if tree.is_none() { [INFO] [stdout] | ----------------- help: try: `if let Some() = &tree` [INFO] [stdout] ... [INFO] [stdout] 30 | let right = max_depth(tree.as_ref().unwrap().borrow().right.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: items after a test module [INFO] [stdout] --> src/problems/no111_minimum_depth_of_binary_tree.rs:58:1 [INFO] [stdout] | [INFO] [stdout] 58 | mod test { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 83 | use std::collections::VecDeque; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] 84 | impl TreeNode { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#items_after_test_module [INFO] [stdout] = help: move the items to before the test module was defined [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `tree` after checking its variant with `is_none` [INFO] [stdout] --> src/problems/no111_minimum_depth_of_binary_tree.rs:31:21 [INFO] [stdout] | [INFO] [stdout] 26 | if tree.is_none() { [INFO] [stdout] | ----------------- help: try: `if let Some() = &tree` [INFO] [stdout] ... [INFO] [stdout] 31 | tree.as_ref().unwrap().borrow().left.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `tree` after checking its variant with `is_none` [INFO] [stdout] --> src/problems/no111_minimum_depth_of_binary_tree.rs:37:21 [INFO] [stdout] | [INFO] [stdout] 26 | if tree.is_none() { [INFO] [stdout] | ----------------- help: try: `if let Some() = &tree` [INFO] [stdout] ... [INFO] [stdout] 37 | tree.as_ref().unwrap().borrow().right.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: items after a test module [INFO] [stdout] --> src/problems/no112_path_sum.rs:45:1 [INFO] [stdout] | [INFO] [stdout] 45 | mod test { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 83 | use std::collections::VecDeque; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] 84 | impl TreeNode { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#items_after_test_module [INFO] [stdout] = help: move the items to before the test module was defined [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: items after a test module [INFO] [stdout] --> src/problems/no113_path_sum_ii.rs:76:1 [INFO] [stdout] | [INFO] [stdout] 76 | mod test { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 90 | use std::collections::VecDeque; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] 91 | impl TreeNode { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#items_after_test_module [INFO] [stdout] = help: move the items to before the test module was defined [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `root` after checking its variant with `is_some` [INFO] [stdout] --> src/problems/no113_path_sum_ii.rs:67:27 [INFO] [stdout] | [INFO] [stdout] 65 | if root.is_some() { [INFO] [stdout] | ----------------- help: try: `if let Some() = &root` [INFO] [stdout] 66 | let mut path = Vec::new(); [INFO] [stdout] 67 | let mut sum = root.as_ref().unwrap().borrow().val; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `root` after checking its variant with `is_some` [INFO] [stdout] --> src/problems/no113_path_sum_ii.rs:68:23 [INFO] [stdout] | [INFO] [stdout] 65 | if root.is_some() { [INFO] [stdout] | ----------------- help: try: `if let Some() = &root` [INFO] [stdout] ... [INFO] [stdout] 68 | path.push(root.as_ref().unwrap().borrow().val); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/problems/no113_path_sum_ii.rs:36:23 [INFO] [stdout] | [INFO] [stdout] 36 | val = (&leaf).borrow().val; [INFO] [stdout] | ^^^^^^^ help: change this to: `leaf` [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 borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/problems/no113_path_sum_ii.rs:48:23 [INFO] [stdout] | [INFO] [stdout] 48 | val = (&leaf).borrow().val; [INFO] [stdout] | ^^^^^^^ help: change this to: `leaf` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: items after a test module [INFO] [stdout] --> src/problems/no114_flatten_binary_tree_to_linked_list.rs:54:1 [INFO] [stdout] | [INFO] [stdout] 54 | mod test { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 79 | use std::collections::VecDeque; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] 80 | impl TreeNode { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#items_after_test_module [INFO] [stdout] = help: move the items to before the test module was defined [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/problems/no114_flatten_binary_tree_to_linked_list.rs:60:9 [INFO] [stdout] | [INFO] [stdout] 60 | let output = Solution::flatten(&mut inputs); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] = note: `#[warn(clippy::let_unit_value)]` on by default [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 60 - let output = Solution::flatten(&mut inputs); [INFO] [stdout] 60 + Solution::flatten(&mut inputs); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/problems/no114_flatten_binary_tree_to_linked_list.rs:67:9 [INFO] [stdout] | [INFO] [stdout] 67 | let output = Solution::flatten(&mut inputs); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 67 - let output = Solution::flatten(&mut inputs); [INFO] [stdout] 67 + Solution::flatten(&mut inputs); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/problems/no114_flatten_binary_tree_to_linked_list.rs:74:9 [INFO] [stdout] | [INFO] [stdout] 74 | let output = Solution::flatten(&mut inputs); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 74 - let output = Solution::flatten(&mut inputs); [INFO] [stdout] 74 + Solution::flatten(&mut inputs); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `s` [INFO] [stdout] --> src/problems/no115_distinct_subsequence.rs:41:18 [INFO] [stdout] | [INFO] [stdout] 41 | for i in 0..slen { [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] 41 - for i in 0..slen { [INFO] [stdout] 41 + for in s.iter().take(slen) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `print!()` with a format string that ends in a single newline [INFO] [stdout] --> src/problems/no115_distinct_subsequence.rs:44:9 [INFO] [stdout] | [INFO] [stdout] 44 | print!("\n"); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_with_newline [INFO] [stdout] = note: `#[warn(clippy::print_with_newline)]` on by default [INFO] [stdout] help: use `println!` instead [INFO] [stdout] | [INFO] [stdout] 44 - print!("\n"); [INFO] [stdout] 44 + println!(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: items after a test module [INFO] [stdout] --> src/problems/no116_populating_next_right_pointers_in_each_node.rs:52:1 [INFO] [stdout] | [INFO] [stdout] 52 | mod test { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 63 | impl TreeNode { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#items_after_test_module [INFO] [stdout] = help: move the items to before the test module was defined [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/problems/no116_populating_next_right_pointers_in_each_node.rs:58:9 [INFO] [stdout] | [INFO] [stdout] 58 | let output = Solution::connect(&mut inputs); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 58 - let output = Solution::connect(&mut inputs); [INFO] [stdout] 58 + Solution::connect(&mut inputs); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: items after a test module [INFO] [stdout] --> src/problems/no117_populating_next_right_pointers_in_each_node_ii.rs:52:1 [INFO] [stdout] | [INFO] [stdout] 52 | mod test { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 63 | impl TreeNode { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#items_after_test_module [INFO] [stdout] = help: move the items to before the test module was defined [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/problems/no117_populating_next_right_pointers_in_each_node_ii.rs:58:9 [INFO] [stdout] | [INFO] [stdout] 58 | let output = Solution::connect(&mut inputs); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 58 - let output = Solution::connect(&mut inputs); [INFO] [stdout] 58 + Solution::connect(&mut inputs); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/problems/no119_pascals_truangle_ii.rs:7:17 [INFO] [stdout] | [INFO] [stdout] 7 | res[j] = res[j] + res[j-1]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `res[j] += res[j-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] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: items after a test module [INFO] [stdout] --> src/problems/no124_binary_tree_maximum_path_sum.rs:60:1 [INFO] [stdout] | [INFO] [stdout] 60 | mod test { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 98 | use std::collections::VecDeque; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] 99 | impl TreeNode { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#items_after_test_module [INFO] [stdout] = help: move the items to before the test module was defined [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/problems/no125_valid_palindrome.rs:17:9 [INFO] [stdout] | [INFO] [stdout] 17 | return true; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 17 - return true; [INFO] [stdout] 17 + true [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/problems/no126_word_ladder_ii.rs:3:54 [INFO] [stdout] | [INFO] [stdout] 3 | pub fn find_valid_index(target: &str, word_list: &Vec) -> 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] 3 - pub fn find_valid_index(target: &str, word_list: &Vec) -> Vec { [INFO] [stdout] 3 + pub fn find_valid_index(target: &str, word_list: &[String]) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/problems/no126_word_ladder_ii.rs:40:27 [INFO] [stdout] | [INFO] [stdout] 40 | while !is_find && indexes.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!indexes.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: manual saturating arithmetic [INFO] [stdout] --> src/problems/no126_word_ladder_ii.rs:118:20 [INFO] [stdout] | [INFO] [stdout] 118 | if (d1.checked_add(d2).unwrap_or(usize::MAX) )!=min_step { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `saturating_add`: `d1.saturating_add(d2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_saturating_arithmetic [INFO] [stdout] = note: `#[warn(clippy::manual_saturating_arithmetic)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/problems/no126_word_ladder_ii.rs:153:25 [INFO] [stdout] | [INFO] [stdout] 153 | pub fn new(members: &Vec) -> Self { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 153 ~ pub fn new(members: &[String]) -> Self { [INFO] [stdout] 154 | Self { [INFO] [stdout] 155 ~ index_list: members.to_owned(), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/problems/no127_word_ladder.rs:3:54 [INFO] [stdout] | [INFO] [stdout] 3 | pub fn find_valid_index(target: &str, word_list: &Vec) -> Vec { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 3 - pub fn find_valid_index(target: &str, word_list: &Vec) -> Vec { [INFO] [stdout] 3 + pub fn find_valid_index(target: &str, word_list: &[String]) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/problems/no127_word_ladder.rs:40:27 [INFO] [stdout] | [INFO] [stdout] 40 | while !is_find && indexes.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!indexes.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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/problems/no127_word_ladder.rs:89:25 [INFO] [stdout] | [INFO] [stdout] 89 | pub fn new(members: &Vec) -> Self { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 89 ~ pub fn new(members: &[String]) -> Self { [INFO] [stdout] 90 | Self { [INFO] [stdout] 91 ~ index_list: members.to_owned(), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: items after a test module [INFO] [stdout] --> src/problems/no129_sum_root_to_leaf_numbers.rs:57:1 [INFO] [stdout] | [INFO] [stdout] 57 | mod test { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 76 | use std::collections::VecDeque; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] 77 | impl TreeNode { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#items_after_test_module [INFO] [stdout] = help: move the items to before the test module was defined [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/problems/no130_surrounded_regions.rs:30:17 [INFO] [stdout] | [INFO] [stdout] 30 | dfs(&board, &mut mask, row, 0); [INFO] [stdout] | ^^^^^^ help: change this to: `board` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/problems/no130_surrounded_regions.rs:31:17 [INFO] [stdout] | [INFO] [stdout] 31 | dfs(&board, &mut mask, row, ncol-1); [INFO] [stdout] | ^^^^^^ help: change this to: `board` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/problems/no130_surrounded_regions.rs:35:17 [INFO] [stdout] | [INFO] [stdout] 35 | dfs(&board, &mut mask, 0, col); [INFO] [stdout] | ^^^^^^ help: change this to: `board` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/problems/no130_surrounded_regions.rs:36:17 [INFO] [stdout] | [INFO] [stdout] 36 | dfs(&board, &mut mask, nrow-1, col); [INFO] [stdout] | ^^^^^^ help: change this to: `board` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::str::Chars<'_>` [INFO] [stdout] --> src/problems/no131_palindrome_partitioning.rs:6:17 [INFO] [stdout] | [INFO] [stdout] 6 | let s = s.chars().into_iter().collect::>(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `s.chars()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/problems/no131_palindrome_partitioning.rs:32:26 [INFO] [stdout] | [INFO] [stdout] 32 | buf.push(s[index..idx].iter().map(|&c| c).collect::()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `s[index..idx].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: useless conversion to the same type: `std::str::Chars<'_>` [INFO] [stdout] --> src/problems/no132_palindrome_partitioning_ii.rs:8:17 [INFO] [stdout] | [INFO] [stdout] 8 | let s = s.chars().into_iter().collect::>(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `s.chars()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/problems/no139_word_break.rs:17:33 [INFO] [stdout] | [INFO] [stdout] 17 | dp[i-len] = true && dp[i]; [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `dp[i]` [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: equality checks against false can be replaced by a negation [INFO] [stdout] --> src/problems/no139_word_break.rs:12:16 [INFO] [stdout] | [INFO] [stdout] 12 | if dp[i]==false {continue;} [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `!dp[i]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_comparison)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/problems/no140_word_break_ii.rs:5:16 [INFO] [stdout] | [INFO] [stdout] 5 | if s.len()==0 { [INFO] [stdout] | ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `s.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: items after a test module [INFO] [stdout] --> src/problems/no143_reorder_list.rs:56:1 [INFO] [stdout] | [INFO] [stdout] 56 | mod test { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 75 | impl ListNode { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#items_after_test_module [INFO] [stdout] = help: move the items to before the test module was defined [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/problems/no143_reorder_list.rs:38:15 [INFO] [stdout] | [INFO] [stdout] 38 | while buf.len()>0 { [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!buf.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: length comparison to zero [INFO] [stdout] --> src/problems/no143_reorder_list.rs:41:20 [INFO] [stdout] | [INFO] [stdout] 41 | if buf.len()>0 { [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!buf.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: called `unwrap` on `self.head` after checking its variant with `is_none` [INFO] [stdout] --> src/problems/no146_lru_cache.rs:39:18 [INFO] [stdout] | [INFO] [stdout] 36 | if self.head.is_none() { [INFO] [stdout] | ---------------------- help: try: `if let Some() = &self.head` [INFO] [stdout] ... [INFO] [stdout] 39 | Some(self.head.as_ref().unwrap().clone()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `self.tail` after checking its variant with `is_none` [INFO] [stdout] --> src/problems/no146_lru_cache.rs:47:18 [INFO] [stdout] | [INFO] [stdout] 44 | if self.tail.is_none() { [INFO] [stdout] | ---------------------- help: try: `if let Some() = &self.tail` [INFO] [stdout] ... [INFO] [stdout] 47 | Some(self.tail.as_ref().unwrap().clone()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `head` after checking its variant with `is_some` [INFO] [stdout] --> src/problems/no146_lru_cache.rs:74:13 [INFO] [stdout] | [INFO] [stdout] 73 | if head.is_some() { [INFO] [stdout] | ----------------- help: try: `if let Some() = &head` [INFO] [stdout] 74 | head.as_ref().unwrap().borrow_mut().prev = Some(node.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `tail` after checking its variant with `is_some` [INFO] [stdout] --> src/problems/no146_lru_cache.rs:86:13 [INFO] [stdout] | [INFO] [stdout] 85 | if tail.is_some() { [INFO] [stdout] | ----------------- help: try: `if let Some() = &tail` [INFO] [stdout] 86 | tail.as_ref().unwrap().borrow_mut().next = Some(node.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: items after a test module [INFO] [stdout] --> src/problems/no147_insertion_sort_list.rs:36:1 [INFO] [stdout] | [INFO] [stdout] 36 | mod test { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 47 | impl ListNode { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#items_after_test_module [INFO] [stdout] = help: move the items to before the test module was defined [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: items after a test module [INFO] [stdout] --> src/problems/no148_sort_list.rs:56:1 [INFO] [stdout] | [INFO] [stdout] 56 | mod test { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 67 | impl ListNode { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#items_after_test_module [INFO] [stdout] = help: move the items to before the test module was defined [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `k` is used to index `points` [INFO] [stdout] --> src/problems/no149_max_points_on_a_line.rs:16:26 [INFO] [stdout] | [INFO] [stdout] 16 | for k in 0..len { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 16 - for k in 0..len { [INFO] [stdout] 16 + for (k, ) in points.iter().enumerate().take(len) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/problems/no164_maximum_gap.rs:19:9 [INFO] [stdout] | [INFO] [stdout] 19 | while let Some(cur) = tree_iter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for cur in tree_iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] = note: `#[warn(clippy::while_let_on_iterator)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this call to `from_str_radix` can be replaced with a call to `str::parse` [INFO] [stdout] --> src/problems/no165_compare_version_numbers.rs:41:30 [INFO] [stdout] | [INFO] [stdout] 41 | let v1 = i32::from_str_radix(v1, 10).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `v1.parse::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_str_radix_10 [INFO] [stdout] = note: `#[warn(clippy::from_str_radix_10)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this call to `from_str_radix` can be replaced with a call to `str::parse` [INFO] [stdout] --> src/problems/no165_compare_version_numbers.rs:42:30 [INFO] [stdout] | [INFO] [stdout] 42 | let v2 = i32::from_str_radix(v2, 10).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `v2.parse::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_str_radix_10 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this call to `from_str_radix` can be replaced with a call to `str::parse` [INFO] [stdout] --> src/problems/no165_compare_version_numbers.rs:47:24 [INFO] [stdout] | [INFO] [stdout] 47 | if i32::from_str_radix(v1, 10).unwrap()==0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `v1.parse::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_str_radix_10 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this call to `from_str_radix` can be replaced with a call to `str::parse` [INFO] [stdout] --> src/problems/no165_compare_version_numbers.rs:54:24 [INFO] [stdout] | [INFO] [stdout] 54 | if i32::from_str_radix(v2, 10).unwrap()==0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `v2.parse::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_str_radix_10 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/problems/no48_rotate_image.rs:4:27 [INFO] [stdout] | [INFO] [stdout] 4 | pub fn rotate(matrix: &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] help: change this to [INFO] [stdout] | [INFO] [stdout] 4 - pub fn rotate(matrix: &mut Vec>) { [INFO] [stdout] 4 + pub fn rotate(matrix: &mut [Vec]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: iterating on a map's values [INFO] [stdout] --> src/problems/no49_group_anagrams.rs:17:9 [INFO] [stdout] | [INFO] [stdout] 17 | / map.into_iter() [INFO] [stdout] 18 | | .map(|(_, value)| value) [INFO] [stdout] | |____________________________________^ help: try: `map.into_values()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map [INFO] [stdout] = note: `#[warn(clippy::iter_kv_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting float literal to `f64` is unnecessary [INFO] [stdout] --> src/problems/no50_pow_xn.rs:28:16 [INFO] [stdout] | [INFO] [stdout] 28 | (res * (1e5) as f64).round() * (1e-5) as f64 [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `1e5_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 float literal to `f64` is unnecessary [INFO] [stdout] --> src/problems/no50_pow_xn.rs:28:40 [INFO] [stdout] | [INFO] [stdout] 28 | (res * (1e5) as f64).round() * (1e-5) as f64 [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `1e-5_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: unneeded `()` [INFO] [stdout] --> src/problems/no51_n_queens.rs:105:20 [INFO] [stdout] | [INFO] [stdout] 105 | return (); [INFO] [stdout] | ^^ help: remove the `()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stdout] = note: `#[warn(clippy::unused_unit)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `()` [INFO] [stdout] --> src/problems/no52_n_queens_ii.rs:95:20 [INFO] [stdout] | [INFO] [stdout] 95 | return (); [INFO] [stdout] | ^^ help: remove the `()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `nums` [INFO] [stdout] --> src/problems/no53_maximun_subarray.rs:7:18 [INFO] [stdout] | [INFO] [stdout] 7 | for i in 1..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] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 7 - for i in 1..nums.len() { [INFO] [stdout] 7 + for in nums.iter().skip(1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/problems/no55_jump_game.rs:16:9 [INFO] [stdout] | [INFO] [stdout] 16 | return true; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 16 - return true; [INFO] [stdout] 16 + true [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `res` [INFO] [stdout] --> src/problems/no59_spiral_matrix_ii.rs:13:22 [INFO] [stdout] | [INFO] [stdout] 13 | for i in l..=r { [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] 13 - for i in l..=r { [INFO] [stdout] 13 + for in res.iter_mut().take(r + 1).skip(l) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `res` [INFO] [stdout] --> src/problems/no59_spiral_matrix_ii.rs:19:22 [INFO] [stdout] | [INFO] [stdout] 19 | for i in t..=b { [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] 19 - for i in t..=b { [INFO] [stdout] 19 + for in res.iter_mut().take(b + 1).skip(t) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/problems/no62_unique_paths.rs:25:9 [INFO] [stdout] | [INFO] [stdout] 25 | return paths[m - 1][n - 1] as i32; [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] 25 - return paths[m - 1][n - 1] as i32; [INFO] [stdout] 25 + paths[m - 1][n - 1] as i32 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `paths` [INFO] [stdout] --> src/problems/no62_unique_paths.rs:13:18 [INFO] [stdout] | [INFO] [stdout] 13 | for i in 0..m { [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] 13 - for i in 0..m { [INFO] [stdout] 13 + for in paths.iter_mut().take(m) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `paths` [INFO] [stdout] --> src/problems/no62_unique_paths.rs:16:18 [INFO] [stdout] | [INFO] [stdout] 16 | for i in 0..n { [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] 16 - for i in 0..n { [INFO] [stdout] 16 + for in paths.iter_mut().take(n) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/problems/no65_valid_number.rs:12:21 [INFO] [stdout] | [INFO] [stdout] 12 | / if !exp_tag { [INFO] [stdout] 13 | | exp_tag = true; [INFO] [stdout] 14 | | true [INFO] [stdout] 15 | | } else { [INFO] [stdout] 16 | | false [INFO] [stdout] 17 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 11 ~ 'e' | 'E' [INFO] [stdout] 12 ~ if !exp_tag => { [INFO] [stdout] 13 | exp_tag = true; [INFO] [stdout] 14 | true [INFO] [stdout] 15 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/problems/no65_valid_number.rs:34:21 [INFO] [stdout] | [INFO] [stdout] 34 | / if i == 0 { [INFO] [stdout] 35 | | true [INFO] [stdout] 36 | | } else { [INFO] [stdout] 37 | | false [INFO] [stdout] 38 | | } [INFO] [stdout] | |_____________________^ help: you can reduce it to: `i == 0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [INFO] [stdout] = note: `#[warn(clippy::needless_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/problems/no67_add_binary.rs:38:13 [INFO] [stdout] | [INFO] [stdout] 38 | tmp.push_str("1") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `tmp.push('1')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] = note: `#[warn(clippy::single_char_add_str)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is used to index `words` [INFO] [stdout] --> src/problems/no68_text_justification.rs:24:22 [INFO] [stdout] | [INFO] [stdout] 24 | for j in sp + 1..i { [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 and enumerate() [INFO] [stdout] | [INFO] [stdout] 24 - for j in sp + 1..i { [INFO] [stdout] 24 + for (j, ) in words.iter().enumerate().take(i).skip(sp + 1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice` [INFO] [stdout] --> src/problems/no68_text_justification.rs:71:30 [INFO] [stdout] | [INFO] [stdout] 71 | for s in words[sp..].into_iter() { [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] = note: `#[warn(clippy::into_iter_on_ref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/problems/no68_text_justification.rs:72:16 [INFO] [stdout] | [INFO] [stdout] 72 | if tmp_str.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!tmp_str.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `dp` [INFO] [stdout] --> src/problems/no72_edit_distance.rs:16:18 [INFO] [stdout] | [INFO] [stdout] 16 | for i in 1..=n2 { [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 and enumerate() [INFO] [stdout] | [INFO] [stdout] 16 - for i in 1..=n2 { [INFO] [stdout] 16 + for (i, ) in dp.iter_mut().enumerate().take(n2 + 1).skip(1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `dp` [INFO] [stdout] --> src/problems/no72_edit_distance.rs:21:18 [INFO] [stdout] | [INFO] [stdout] 21 | for i in 1..=n1 { [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 and enumerate() [INFO] [stdout] | [INFO] [stdout] 21 - for i in 1..=n1 { [INFO] [stdout] 21 + for (i, ) in dp.iter_mut().enumerate().take(n1 + 1).skip(1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/problems/no72_edit_distance.rs:29:32 [INFO] [stdout] | [INFO] [stdout] 29 | dp[i][j] = 0 + dp[i - 1][j - 1]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider reducing it to: `dp[i - 1][j - 1]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] = note: `#[warn(clippy::identity_op)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/problems/no73_set_matrix_zeros.rs:3:31 [INFO] [stdout] | [INFO] [stdout] 3 | pub fn set_zeroes(matrix: &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] help: change this to [INFO] [stdout] | [INFO] [stdout] 3 - pub fn set_zeroes(matrix: &mut Vec>) { [INFO] [stdout] 3 + pub fn set_zeroes(matrix: &mut [Vec]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/problems/no73_set_matrix_zeros.rs:47:9 [INFO] [stdout] | [INFO] [stdout] 47 | let output = Solution::set_zeroes(&mut inputs); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 47 - let output = Solution::set_zeroes(&mut inputs); [INFO] [stdout] 47 + Solution::set_zeroes(&mut inputs); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/problems/no73_set_matrix_zeros.rs:55:9 [INFO] [stdout] | [INFO] [stdout] 55 | let output = Solution::set_zeroes(&mut inputs); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 55 - let output = Solution::set_zeroes(&mut inputs); [INFO] [stdout] 55 + Solution::set_zeroes(&mut inputs); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/problems/no75_sort_colors.rs:5:30 [INFO] [stdout] | [INFO] [stdout] 5 | pub fn sort_colors(nums: &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] help: change this to [INFO] [stdout] | [INFO] [stdout] 5 - pub fn sort_colors(nums: &mut Vec) { [INFO] [stdout] 5 + pub fn sort_colors(nums: &mut [i32]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/problems/no75_sort_colors.rs:68:9 [INFO] [stdout] | [INFO] [stdout] 68 | let output = Solution::sort_colors(&mut inputs); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 68 - let output = Solution::sort_colors(&mut inputs); [INFO] [stdout] 68 + Solution::sort_colors(&mut inputs); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::ops::RangeInclusive` [INFO] [stdout] --> src/problems/no77_combine.rs:17:23 [INFO] [stdout] | [INFO] [stdout] 17 | let mut tmp = (1..=k).into_iter().collect::>(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `(1..=k)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/problems/no78_subsets.rs:3:48 [INFO] [stdout] | [INFO] [stdout] 3 | fn append(result: &mut Vec>, buf: &Vec, nums: &[i32]) { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 3 ~ fn append(result: &mut Vec>, buf: &[i32], nums: &[i32]) { [INFO] [stdout] 4 ~ result.push(buf.to_owned()); [INFO] [stdout] 5 | for (i, &e) in nums.iter().enumerate() { [INFO] [stdout] 6 ~ let mut buf = buf.to_owned(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/problems/no79_word_search.rs:5:12 [INFO] [stdout] | [INFO] [stdout] 5 | if word.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `word.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/problems/no79_word_search.rs:44:17 [INFO] [stdout] | [INFO] [stdout] 44 | / if board[i][j] as u8 == word[0] { [INFO] [stdout] 45 | | if Solution::next(&mut board, &word[1..], i, j) { [INFO] [stdout] 46 | | return true; [INFO] [stdout] 47 | | }; [INFO] [stdout] 48 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 44 ~ if board[i][j] as u8 == word[0] [INFO] [stdout] 45 ~ && Solution::next(&mut board, &word[1..], i, j) { [INFO] [stdout] 46 | return true; [INFO] [stdout] 47 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/problems/no80_remove_duplicates_from_sorted_array_ii.rs:56:36 [INFO] [stdout] | [INFO] [stdout] 56 | pub fn remove_duplicates(nums: &mut Vec) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 56 - pub fn remove_duplicates(nums: &mut Vec) -> i32 { [INFO] [stdout] 56 + pub fn remove_duplicates(nums: &mut [i32]) -> i32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/problems/no84_largest_rectangle_in_histogram.rs:20:9 [INFO] [stdout] | [INFO] [stdout] 20 | return res; [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] 20 - return res; [INFO] [stdout] 20 + res [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/problems/no84_largest_rectangle_in_histogram.rs:11:19 [INFO] [stdout] | [INFO] [stdout] 11 | while stack.len() > 0 && heights[*stack.iter().last().unwrap()] > *h { [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/problems/no85_maximal_rectangle.rs:23:9 [INFO] [stdout] | [INFO] [stdout] 23 | return res; [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] 23 - return res; [INFO] [stdout] 23 + res [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/problems/no85_maximal_rectangle.rs:5:12 [INFO] [stdout] | [INFO] [stdout] 5 | if matrix.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] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/problems/no85_maximal_rectangle.rs:39:9 [INFO] [stdout] | [INFO] [stdout] 39 | return res; [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] 39 - return res; [INFO] [stdout] 39 + res [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/problems/no85_maximal_rectangle.rs:26:33 [INFO] [stdout] | [INFO] [stdout] 26 | pub fn maxInHistogram(hist: &Vec) -> i32 { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 26 - pub fn maxInHistogram(hist: &Vec) -> i32 { [INFO] [stdout] 26 + pub fn maxInHistogram(hist: &[i32]) -> i32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/problems/no85_maximal_rectangle.rs:31:19 [INFO] [stdout] | [INFO] [stdout] 31 | while stack.len() > 0 && hist[*stack.iter().last().unwrap()] > *val { [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: this pattern creates a reference to a reference [INFO] [stdout] --> src/problems/no86_partition_list.rs:21:24 [INFO] [stdout] | [INFO] [stdout] 21 | while let Some(ref node) = head { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 21 - while let Some(ref node) = head { [INFO] [stdout] 21 + while let Some(node) = head { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is used to index `s1` [INFO] [stdout] --> src/problems/no87_scramble_string.rs:19:26 [INFO] [stdout] | [INFO] [stdout] 19 | for j in 0..s1.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 and enumerate() [INFO] [stdout] | [INFO] [stdout] 19 - for j in 0..s1.len() { [INFO] [stdout] 19 + for (j, ) in s1.iter().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: parameter is only used in recursion [INFO] [stdout] --> src/problems/no87_scramble_string.rs:3:54 [INFO] [stdout] | [INFO] [stdout] 3 | fn greedy_split(s1: Vec, target: String, counter: i32) -> bool { [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_counter` [INFO] [stdout] | [INFO] [stdout] note: parameter used here [INFO] [stdout] --> src/problems/no87_scramble_string.rs:31:71 [INFO] [stdout] | [INFO] [stdout] 31 | if Self::greedy_split(next_stack, target.to_string(), counter + 1) [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] 32 | || Self::greedy_split(next_stack_swap, target.to_string(), counter + 1) [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#only_used_in_recursion [INFO] [stdout] = note: `#[warn(clippy::only_used_in_recursion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/problems/no88_merge_sorted_array.rs:3:25 [INFO] [stdout] | [INFO] [stdout] 3 | pub fn merge(nums1: &mut Vec, m: i32, nums2: &mut Vec, n: i32) { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 3 - pub fn merge(nums1: &mut Vec, m: i32, nums2: &mut Vec, n: i32) { [INFO] [stdout] 3 + pub fn merge(nums1: &mut [i32], m: i32, nums2: &mut Vec, n: i32) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/problems/no88_merge_sorted_array.rs:3:55 [INFO] [stdout] | [INFO] [stdout] 3 | pub fn merge(nums1: &mut Vec, m: i32, nums2: &mut Vec, n: i32) { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 3 - pub fn merge(nums1: &mut Vec, m: i32, nums2: &mut Vec, n: i32) { [INFO] [stdout] 3 + pub fn merge(nums1: &mut Vec, m: i32, nums2: &mut [i32], n: i32) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/problems/no90_subsets_ii.rs:6:12 [INFO] [stdout] | [INFO] [stdout] 6 | if map.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `map.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: useless conversion to the same type: `std::collections::hash_map::Keys<'_, i32, i32>` [INFO] [stdout] --> src/problems/no90_subsets_ii.rs:26:19 [INFO] [stdout] | [INFO] [stdout] 26 | let map = map [INFO] [stdout] | ___________________^ [INFO] [stdout] 27 | | .keys() [INFO] [stdout] 28 | | .into_iter() [INFO] [stdout] | |________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 26 ~ let map = map [INFO] [stdout] 27 + .keys() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/problems/no91_decode_ways.rs:4:21 [INFO] [stdout] | [INFO] [stdout] 4 | fn check(s: &Vec, idx: usize) -> bool { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 4 - fn check(s: &Vec, idx: usize) -> bool { [INFO] [stdout] 4 + fn check(s: &[char], idx: usize) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/problems/no91_decode_ways.rs:8:24 [INFO] [stdout] | [INFO] [stdout] 8 | '2' => match s[idx] { [INFO] [stdout] | ________________________^ [INFO] [stdout] 9 | | '0' | '1' | '2' | '3' | '4' | '5' | '6' => true, [INFO] [stdout] 10 | | _ => false, [INFO] [stdout] 11 | | }, [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] = note: `#[warn(clippy::match_like_matches_macro)]` on by default [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 8 - '2' => match s[idx] { [INFO] [stdout] 9 - '0' | '1' | '2' | '3' | '4' | '5' | '6' => true, [INFO] [stdout] 10 - _ => false, [INFO] [stdout] 11 - }, [INFO] [stdout] 8 + '2' => matches!(s[idx], '0' | '1' | '2' | '3' | '4' | '5' | '6'), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::str::Chars<'_>` [INFO] [stdout] --> src/problems/no91_decode_ways.rs:17:17 [INFO] [stdout] | [INFO] [stdout] 17 | let s = s.chars().into_iter().collect::>(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `s.chars()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/problems/no93_restore_ip_addresses.rs:28:32 [INFO] [stdout] | [INFO] [stdout] 28 | } else if s[spliter[i] + 1] == 53 { [INFO] [stdout] | ________________________________^ [INFO] [stdout] 29 | | if s[spliter[i] + 2] > 53 { [INFO] [stdout] 30 | | return None; [INFO] [stdout] 31 | | } [INFO] [stdout] 32 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 28 ~ } else if s[spliter[i] + 1] == 53 [INFO] [stdout] 29 ~ && s[spliter[i] + 2] > 53 { [INFO] [stdout] 30 | return None; [INFO] [stdout] 31 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `l_trees` [INFO] [stdout] --> src/problems/no95_unique_binary_search_trees_ii.rs:43:22 [INFO] [stdout] | [INFO] [stdout] 43 | for i in 0..l_trees.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] 43 - for i in 0..l_trees.len() { [INFO] [stdout] 43 + for in &l_trees { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is only used to index `r_trees` [INFO] [stdout] --> src/problems/no95_unique_binary_search_trees_ii.rs:44:26 [INFO] [stdout] | [INFO] [stdout] 44 | for j in 0..r_trees.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] 44 - for j in 0..r_trees.len() { [INFO] [stdout] 44 + for in &r_trees { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this looks like you are swapping `x.val` and `y.val` manually [INFO] [stdout] --> src/problems/no99_recover_binary_search_tree.rs:89:9 [INFO] [stdout] | [INFO] [stdout] 89 | / let tmp = x.val; [INFO] [stdout] 90 | | x.val = y.val; [INFO] [stdout] 91 | | y.val = tmp; [INFO] [stdout] | |____________________^ help: try: `std::mem::swap(&mut x.val, &mut y.val);` [INFO] [stdout] | [INFO] [stdout] = note: or maybe you should use `std::mem::replace`? [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/problems/no99_recover_binary_search_tree.rs:50:36 [INFO] [stdout] | [INFO] [stdout] 50 | Some(Rc::clone(&leaf)) [INFO] [stdout] | ^^^^^ help: change this to: `leaf` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/problems/no99_recover_binary_search_tree.rs:77:36 [INFO] [stdout] | [INFO] [stdout] 77 | Some(Rc::clone(&leaf)) [INFO] [stdout] | ^^^^^ help: change this to: `leaf` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/problems/no99_recover_binary_search_tree.rs:134:9 [INFO] [stdout] | [INFO] [stdout] 134 | let output = Solution::recover_tree(&mut inputs); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 134 - let output = Solution::recover_tree(&mut inputs); [INFO] [stdout] 134 + Solution::recover_tree(&mut inputs); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/problems/no99_recover_binary_search_tree.rs:166:9 [INFO] [stdout] | [INFO] [stdout] 166 | let output = Solution::recover_tree(&mut inputs); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 166 - let output = Solution::recover_tree(&mut inputs); [INFO] [stdout] 166 + Solution::recover_tree(&mut inputs); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/problems/syntex_test.rs:34:24 [INFO] [stdout] | [INFO] [stdout] 34 | println!("{}", 5 % 7); [INFO] [stdout] | ^^^^^ help: consider reducing it to: `5` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `maxInHistogram` should have a snake case name [INFO] [stdout] --> src/problems/no85_maximal_rectangle.rs:26:12 [INFO] [stdout] | [INFO] [stdout] 26 | pub fn maxInHistogram(hist: &Vec) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: convert the identifier to snake case: `max_in_histogram` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(non_snake_case)]` (part of `#[warn(nonstandard_style)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 2.26s [INFO] running `Command { std: "docker" "inspect" "1dc56851d715b256c679f1035c9844129e0031419809a6126b3dbc9d24e4f7a2", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "1dc56851d715b256c679f1035c9844129e0031419809a6126b3dbc9d24e4f7a2", kill_on_drop: false }` [INFO] [stdout] 1dc56851d715b256c679f1035c9844129e0031419809a6126b3dbc9d24e4f7a2