[INFO] cloning repository https://github.com/jiangbo212/leetcode-rust [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/jiangbo212/leetcode-rust" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fjiangbo212%2Fleetcode-rust", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fjiangbo212%2Fleetcode-rust'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] ae785400433c3065887a3df90d8cb255926ba685 [INFO] linting jiangbo212/leetcode-rust against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fjiangbo212%2Fleetcode-rust" "/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/jiangbo212/leetcode-rust [INFO] finished tweaking git repo https://github.com/jiangbo212/leetcode-rust [INFO] tweaked toml for git repo https://github.com/jiangbo212/leetcode-rust written to /workspace/builds/worker-2-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/jiangbo212/leetcode-rust on toolchain nightly [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] crate git repo https://github.com/jiangbo212/leetcode-rust 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] f363cf235f6b3166e0fe2321269dc52c8dba608bd68052a166d75f6be73c9296 [INFO] running `Command { std: "docker" "start" "-a" "f363cf235f6b3166e0fe2321269dc52c8dba608bd68052a166d75f6be73c9296", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "f363cf235f6b3166e0fe2321269dc52c8dba608bd68052a166d75f6be73c9296", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "f363cf235f6b3166e0fe2321269dc52c8dba608bd68052a166d75f6be73c9296", kill_on_drop: false }` [INFO] [stdout] f363cf235f6b3166e0fe2321269dc52c8dba608bd68052a166d75f6be73c9296 [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] 81644076a8fa757ab117c12d8b55954b8b0e003214e552df098dfaedebf1d7e8 [INFO] running `Command { std: "docker" "start" "-a" "81644076a8fa757ab117c12d8b55954b8b0e003214e552df098dfaedebf1d7e8", kill_on_drop: false }` [INFO] [stderr] Checking leetcode-rust v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: struct `Solution` is never constructed [INFO] [stdout] --> src/solution.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | pub struct Solution; [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 `merge` is never used [INFO] [stdout] --> src/array/array_merge.rs:5:12 [INFO] [stdout] | [INFO] [stdout] 4 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 5 | pub fn merge(nums1: &mut Vec, m: i32, nums2: &mut Vec, n: i32) { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `remove_elements` is never used [INFO] [stdout] --> src/array/array_remove_elements.rs:4:12 [INFO] [stdout] | [INFO] [stdout] 3 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 4 | pub fn remove_elements(nums: &mut Vec, val: i32) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `remove_duplicates` is never used [INFO] [stdout] --> src/array/array_remove_duplicates.rs:4:12 [INFO] [stdout] | [INFO] [stdout] 3 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 4 | pub fn remove_duplicates(nums: &mut Vec) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `majority_element` is never used [INFO] [stdout] --> src/array/array_majority_element.rs:8:12 [INFO] [stdout] | [INFO] [stdout] 3 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] ... [INFO] [stdout] 8 | pub fn majority_element(nums: Vec) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `max_profit` is never used [INFO] [stdout] --> src/array/array_max_profit.rs:5:12 [INFO] [stdout] | [INFO] [stdout] 3 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 4 | // 取每个最低点之后的最高差值,如果大于之前最低点的最高差值则变更最高差值,否则最高差值还是上次的 [INFO] [stdout] 5 | pub fn max_profit(prices: Vec) -> i32 { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `length_of_last_word` is never used [INFO] [stdout] --> src/array/array_length_or_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: associated function `roman_to_int` is never used [INFO] [stdout] --> src/array/array_roman_to_int.rs:4:12 [INFO] [stdout] | [INFO] [stdout] 3 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 4 | pub fn roman_to_int(s:String) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `longest_common_prefix` is never used [INFO] [stdout] --> src/array/array_longest_common_prefix.rs:4:12 [INFO] [stdout] | [INFO] [stdout] 3 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 4 | pub fn longest_common_prefix(strs: Vec) -> String { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `str_str` is never used [INFO] [stdout] --> src/array/array_str_str.rs:4:12 [INFO] [stdout] | [INFO] [stdout] 3 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 4 | pub fn str_str(haystack: String, needle: String) -> i32 { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `remove_duplicates2` is never used [INFO] [stdout] --> src/array/array_remove_duplicates2.rs:4:12 [INFO] [stdout] | [INFO] [stdout] 3 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 4 | pub fn remove_duplicates2(nums: &mut Vec) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `rotate` is never used [INFO] [stdout] --> src/array/array_rotate.rs:4:12 [INFO] [stdout] | [INFO] [stdout] 3 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] 4 | pub fn rotate(nums: &mut Vec, k:i32) { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `max_profit2` is never used [INFO] [stdout] --> src/array/array_max_profit2.rs:8:12 [INFO] [stdout] | [INFO] [stdout] 3 | impl Solution { [INFO] [stdout] | ------------- associated function in this implementation [INFO] [stdout] ... [INFO] [stdout] 8 | pub fn max_profit2(prices: Vec) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `can_jump` is never used [INFO] [stdout] --> src/array/array_can_jump.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: it looks like you're manually copying between slices [INFO] [stdout] --> src/array/array_merge.rs:14:13 [INFO] [stdout] | [INFO] [stdout] 14 | / for i in 0..n as usize { [INFO] [stdout] 15 | | nums1[i] = nums2[i] [INFO] [stdout] 16 | | } [INFO] [stdout] | |_____________^ help: try replacing the loop by: `nums1[..(n as usize)].copy_from_slice(&nums2[..(n as usize)]);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_memcpy [INFO] [stdout] = note: `#[warn(clippy::manual_memcpy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/array/array_merge.rs:35:21 [INFO] [stdout] | [INFO] [stdout] 35 | nums2_index = nums2_index + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `nums2_index += 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: manual implementation of an assign operation [INFO] [stdout] --> src/array/array_merge.rs:47:21 [INFO] [stdout] | [INFO] [stdout] 47 | nums2_index = nums2_index + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `nums2_index += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `nums1` [INFO] [stdout] --> src/array/array_merge.rs:54:22 [INFO] [stdout] | [INFO] [stdout] 54 | for i in (nums1_index+1)..m as usize { [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] 54 - for i in (nums1_index+1)..m as usize { [INFO] [stdout] 54 + for in nums1.iter().take(m as usize).skip((nums1_index+1)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `nums2` [INFO] [stdout] --> src/array/array_merge.rs:62:22 [INFO] [stdout] | [INFO] [stdout] 62 | for i in nums2_index..n as usize { [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] 62 - for i in nums2_index..n as usize { [INFO] [stdout] 62 + for in nums2.iter().take(n as usize).skip(nums2_index) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: it looks like you're manually copying between slices [INFO] [stdout] --> src/array/array_merge.rs:69:9 [INFO] [stdout] | [INFO] [stdout] 69 | / for i in 0..(m+n) as usize { [INFO] [stdout] 70 | | nums1[i] = temp_vec[i] [INFO] [stdout] 71 | | } [INFO] [stdout] | |_________^ help: try replacing the loop by: `nums1[..((m+n) as usize)].copy_from_slice(&temp_vec[..((m+n) as usize)]);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_memcpy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/array/array_remove_elements.rs:18:17 [INFO] [stdout] | [INFO] [stdout] 18 | del_element_num = del_element_num + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `del_element_num += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/array/array_remove_duplicates.rs:19:17 [INFO] [stdout] | [INFO] [stdout] 19 | del_element_num = del_element_num + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `del_element_num += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/array/array_majority_element.rs:14:17 [INFO] [stdout] | [INFO] [stdout] 14 | count = count + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace it with: `count += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/array/array_majority_element.rs:19:17 [INFO] [stdout] | [INFO] [stdout] 19 | count = count + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace it with: `count += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/array/array_majority_element.rs:21:17 [INFO] [stdout] | [INFO] [stdout] 21 | count = count -1 ; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace it with: `count -= 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against true are unnecessary [INFO] [stdout] --> src/array/array_length_or_last_word.rs:12:20 [INFO] [stdout] | [INFO] [stdout] 12 | if space_mark == true { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `space_mark` [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: manual implementation of an assign operation [INFO] [stdout] --> src/array/array_length_or_last_word.rs:16:17 [INFO] [stdout] | [INFO] [stdout] 16 | length_of_last_world = length_of_last_world + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `length_of_last_world += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/array/array_roman_to_int.rs:27:25 [INFO] [stdout] | [INFO] [stdout] 27 | output_int = output_int + (roman_int[index] - roman_int[subtract_mark_index]) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `output_int += (roman_int[index] - roman_int[subtract_mark_index])` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/array/array_roman_to_int.rs:32:29 [INFO] [stdout] | [INFO] [stdout] 32 | ... output_int = output_int + roman_int[subtract_mark_index]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `output_int += roman_int[subtract_mark_index]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/array/array_roman_to_int.rs:40:29 [INFO] [stdout] | [INFO] [stdout] 40 | ... output_int = output_int + roman_int[index]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `output_int += roman_int[index]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/array/array_roman_to_int.rs:51:13 [INFO] [stdout] | [INFO] [stdout] 51 | output_int = output_int + roman_int[subtract_mark_index]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `output_int += roman_int[subtract_mark_index]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/array/array_longest_common_prefix.rs:12:20 [INFO] [stdout] | [INFO] [stdout] 12 | return format!("{}", strs[0]); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `strs[0].to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `str_index` is used to index `strs` [INFO] [stdout] --> src/array/array_longest_common_prefix.rs:16:30 [INFO] [stdout] | [INFO] [stdout] 16 | for str_index in 0..length { [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 str_index in 0..length { [INFO] [stdout] 16 + for (str_index, ) in strs.iter().enumerate().take(length) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> src/array/array_longest_common_prefix.rs:25:20 [INFO] [stdout] | [INFO] [stdout] 25 | if compare_char == None || str_index ==0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `compare_char.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] = note: `#[warn(clippy::partialeq_to_none)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/array/array_longest_common_prefix.rs:33:29 [INFO] [stdout] | [INFO] [stdout] 33 | ... char_index = char_index + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `char_index += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `needle_index` is used to index `needle_chars` [INFO] [stdout] --> src/array/array_str_str.rs:14:33 [INFO] [stdout] | [INFO] [stdout] 14 | for needle_index in 0.. needle_length { [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] 14 - for needle_index in 0.. needle_length { [INFO] [stdout] 14 + for (needle_index, ) in needle_chars.iter().enumerate().take(needle_length) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> src/array/array_remove_duplicates2.rs:15:16 [INFO] [stdout] | [INFO] [stdout] 15 | if previous_value == None { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `previous_value.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/array/array_remove_duplicates2.rs:17:17 [INFO] [stdout] | [INFO] [stdout] 17 | duplicates_num = duplicates_num + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `duplicates_num += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/array/array_remove_duplicates2.rs:22:25 [INFO] [stdout] | [INFO] [stdout] 22 | duplicates_num = duplicates_num + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `duplicates_num += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/array/array_remove_duplicates2.rs:27:25 [INFO] [stdout] | [INFO] [stdout] 27 | del_num = del_num + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `del_num += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `index` is used to index `new_nums` [INFO] [stdout] --> src/array/array_rotate.rs:17:26 [INFO] [stdout] | [INFO] [stdout] 17 | for index in 0..num_length { [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] 17 - for index in 0..num_length { [INFO] [stdout] 17 + for (index, ) in new_nums.iter_mut().enumerate().take(num_length) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: it looks like you're manually copying between slices [INFO] [stdout] --> src/array/array_rotate.rs:25:13 [INFO] [stdout] | [INFO] [stdout] 25 | / for index in 0..num_length { [INFO] [stdout] 26 | | nums[index] = new_nums[index]; [INFO] [stdout] 27 | | } [INFO] [stdout] | |_____________^ help: try replacing the loop by: `nums[..num_length].copy_from_slice(&new_nums[..num_length]);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_memcpy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/array/array_max_profit2.rs:16:17 [INFO] [stdout] | [INFO] [stdout] 16 | profit = profit + (prices[next_index] - prices[index]); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `profit += (prices[next_index] - prices[index])` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/array/array_max_profit2.rs:18:13 [INFO] [stdout] | [INFO] [stdout] 18 | index = index + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace it with: `index += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/array/array_can_jump.rs:40:16 [INFO] [stdout] | [INFO] [stdout] 40 | if !jump_result.is_none() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `jump_result.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `jump_result` after checking its variant with `is_none` [INFO] [stdout] --> src/array/array_can_jump.rs:41:24 [INFO] [stdout] | [INFO] [stdout] 40 | if !jump_result.is_none() { [INFO] [stdout] | --------------------- the check is happening here [INFO] [stdout] 41 | return jump_result.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [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: unneeded `return` statement [INFO] [stdout] --> src/array/array_can_jump.rs:45:9 [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] = note: `#[warn(clippy::needless_return)]` on by default [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: equality checks against true are unnecessary [INFO] [stdout] --> src/array/array_can_jump.rs:29:20 [INFO] [stdout] | [INFO] [stdout] 29 | if jump_result.unwrap_or(false) == true { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `jump_result.unwrap_or(false)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/array/array_roman_to_int.rs:7:26 [INFO] [stdout] | [INFO] [stdout] 7 | let roman_char = vec!['I', 'V', 'X', 'L', 'C','D', 'M']; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `['I', 'V', 'X', 'L', 'C','D', 'M']` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/array/array_roman_to_int.rs:8:25 [INFO] [stdout] | [INFO] [stdout] 8 | let roman_int = vec![1, 5, 10, 50, 100, 500, 1000]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[1, 5, 10, 50, 100, 500, 1000]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: it looks like you're manually copying between slices [INFO] [stdout] --> src/array/array_merge.rs:14:13 [INFO] [stdout] | [INFO] [stdout] 14 | / for i in 0..n as usize { [INFO] [stdout] 15 | | nums1[i] = nums2[i] [INFO] [stdout] 16 | | } [INFO] [stdout] | |_____________^ help: try replacing the loop by: `nums1[..(n as usize)].copy_from_slice(&nums2[..(n as usize)]);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_memcpy [INFO] [stdout] = note: `#[warn(clippy::manual_memcpy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/array/array_merge.rs:35:21 [INFO] [stdout] | [INFO] [stdout] 35 | nums2_index = nums2_index + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `nums2_index += 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: manual implementation of an assign operation [INFO] [stdout] --> src/array/array_merge.rs:47:21 [INFO] [stdout] | [INFO] [stdout] 47 | nums2_index = nums2_index + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `nums2_index += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `nums1` [INFO] [stdout] --> src/array/array_merge.rs:54:22 [INFO] [stdout] | [INFO] [stdout] 54 | for i in (nums1_index+1)..m as usize { [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] 54 - for i in (nums1_index+1)..m as usize { [INFO] [stdout] 54 + for in nums1.iter().take(m as usize).skip((nums1_index+1)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `nums2` [INFO] [stdout] --> src/array/array_merge.rs:62:22 [INFO] [stdout] | [INFO] [stdout] 62 | for i in nums2_index..n as usize { [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] 62 - for i in nums2_index..n as usize { [INFO] [stdout] 62 + for in nums2.iter().take(n as usize).skip(nums2_index) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: it looks like you're manually copying between slices [INFO] [stdout] --> src/array/array_merge.rs:69:9 [INFO] [stdout] | [INFO] [stdout] 69 | / for i in 0..(m+n) as usize { [INFO] [stdout] 70 | | nums1[i] = temp_vec[i] [INFO] [stdout] 71 | | } [INFO] [stdout] | |_________^ help: try replacing the loop by: `nums1[..((m+n) as usize)].copy_from_slice(&temp_vec[..((m+n) as usize)]);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_memcpy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/array/array_remove_elements.rs:18:17 [INFO] [stdout] | [INFO] [stdout] 18 | del_element_num = del_element_num + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `del_element_num += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/array/array_remove_duplicates.rs:19:17 [INFO] [stdout] | [INFO] [stdout] 19 | del_element_num = del_element_num + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `del_element_num += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/array/array_majority_element.rs:14:17 [INFO] [stdout] | [INFO] [stdout] 14 | count = count + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace it with: `count += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/array/array_majority_element.rs:19:17 [INFO] [stdout] | [INFO] [stdout] 19 | count = count + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace it with: `count += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/array/array_majority_element.rs:21:17 [INFO] [stdout] | [INFO] [stdout] 21 | count = count -1 ; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace it with: `count -= 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against true are unnecessary [INFO] [stdout] --> src/array/array_length_or_last_word.rs:12:20 [INFO] [stdout] | [INFO] [stdout] 12 | if space_mark == true { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `space_mark` [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: manual implementation of an assign operation [INFO] [stdout] --> src/array/array_length_or_last_word.rs:16:17 [INFO] [stdout] | [INFO] [stdout] 16 | length_of_last_world = length_of_last_world + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `length_of_last_world += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/array/array_roman_to_int.rs:27:25 [INFO] [stdout] | [INFO] [stdout] 27 | output_int = output_int + (roman_int[index] - roman_int[subtract_mark_index]) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `output_int += (roman_int[index] - roman_int[subtract_mark_index])` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/array/array_roman_to_int.rs:32:29 [INFO] [stdout] | [INFO] [stdout] 32 | ... output_int = output_int + roman_int[subtract_mark_index]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `output_int += roman_int[subtract_mark_index]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/array/array_roman_to_int.rs:40:29 [INFO] [stdout] | [INFO] [stdout] 40 | ... output_int = output_int + roman_int[index]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `output_int += roman_int[index]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/array/array_roman_to_int.rs:51:13 [INFO] [stdout] | [INFO] [stdout] 51 | output_int = output_int + roman_int[subtract_mark_index]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `output_int += roman_int[subtract_mark_index]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/array/array_roman_to_int.rs:71:48 [INFO] [stdout] | [INFO] [stdout] 71 | let value = Solution::roman_to_int(format!("{}", s)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `s.to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/array/array_longest_common_prefix.rs:12:20 [INFO] [stdout] | [INFO] [stdout] 12 | return format!("{}", strs[0]); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `strs[0].to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `str_index` is used to index `strs` [INFO] [stdout] --> src/array/array_longest_common_prefix.rs:16:30 [INFO] [stdout] | [INFO] [stdout] 16 | for str_index in 0..length { [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 str_index in 0..length { [INFO] [stdout] 16 + for (str_index, ) in strs.iter().enumerate().take(length) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> src/array/array_longest_common_prefix.rs:25:20 [INFO] [stdout] | [INFO] [stdout] 25 | if compare_char == None || str_index ==0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `compare_char.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] = note: `#[warn(clippy::partialeq_to_none)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/array/array_longest_common_prefix.rs:33:29 [INFO] [stdout] | [INFO] [stdout] 33 | ... char_index = char_index + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `char_index += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `needle_index` is used to index `needle_chars` [INFO] [stdout] --> src/array/array_str_str.rs:14:33 [INFO] [stdout] | [INFO] [stdout] 14 | for needle_index in 0.. needle_length { [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] 14 - for needle_index in 0.. needle_length { [INFO] [stdout] 14 + for (needle_index, ) in needle_chars.iter().enumerate().take(needle_length) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> src/array/array_remove_duplicates2.rs:15:16 [INFO] [stdout] | [INFO] [stdout] 15 | if previous_value == None { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `previous_value.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/array/array_remove_duplicates2.rs:17:17 [INFO] [stdout] | [INFO] [stdout] 17 | duplicates_num = duplicates_num + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `duplicates_num += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/array/array_remove_duplicates2.rs:22:25 [INFO] [stdout] | [INFO] [stdout] 22 | duplicates_num = duplicates_num + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `duplicates_num += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/array/array_remove_duplicates2.rs:27:25 [INFO] [stdout] | [INFO] [stdout] 27 | del_num = del_num + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `del_num += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `index` is used to index `new_nums` [INFO] [stdout] --> src/array/array_rotate.rs:17:26 [INFO] [stdout] | [INFO] [stdout] 17 | for index in 0..num_length { [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] 17 - for index in 0..num_length { [INFO] [stdout] 17 + for (index, ) in new_nums.iter_mut().enumerate().take(num_length) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: it looks like you're manually copying between slices [INFO] [stdout] --> src/array/array_rotate.rs:25:13 [INFO] [stdout] | [INFO] [stdout] 25 | / for index in 0..num_length { [INFO] [stdout] 26 | | nums[index] = new_nums[index]; [INFO] [stdout] 27 | | } [INFO] [stdout] | |_____________^ help: try replacing the loop by: `nums[..num_length].copy_from_slice(&new_nums[..num_length]);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_memcpy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/array/array_max_profit2.rs:16:17 [INFO] [stdout] | [INFO] [stdout] 16 | profit = profit + (prices[next_index] - prices[index]); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `profit += (prices[next_index] - prices[index])` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/array/array_max_profit2.rs:18:13 [INFO] [stdout] | [INFO] [stdout] 18 | index = index + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace it with: `index += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/array/array_can_jump.rs:40:16 [INFO] [stdout] | [INFO] [stdout] 40 | if !jump_result.is_none() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `jump_result.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `jump_result` after checking its variant with `is_none` [INFO] [stdout] --> src/array/array_can_jump.rs:41:24 [INFO] [stdout] | [INFO] [stdout] 40 | if !jump_result.is_none() { [INFO] [stdout] | --------------------- the check is happening here [INFO] [stdout] 41 | return jump_result.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [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: unneeded `return` statement [INFO] [stdout] --> src/array/array_can_jump.rs:45:9 [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] = note: `#[warn(clippy::needless_return)]` on by default [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: equality checks against true are unnecessary [INFO] [stdout] --> src/array/array_can_jump.rs:29:20 [INFO] [stdout] | [INFO] [stdout] 29 | if jump_result.unwrap_or(false) == true { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `jump_result.unwrap_or(false)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/array/array_can_jump.rs:56:9 [INFO] [stdout] | [INFO] [stdout] 56 | assert_eq!(Solution::can_jump(nums), true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_assert_comparison)]` on by default [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 56 - assert_eq!(Solution::can_jump(nums), true); [INFO] [stdout] 56 + assert!(Solution::can_jump(nums)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/array/array_can_jump.rs:59:9 [INFO] [stdout] | [INFO] [stdout] 59 | assert_eq!(Solution::can_jump(nums), false); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 59 - assert_eq!(Solution::can_jump(nums), false); [INFO] [stdout] 59 + assert!(!Solution::can_jump(nums)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/array/array_can_jump.rs:62:9 [INFO] [stdout] | [INFO] [stdout] 62 | assert_eq!(Solution::can_jump(nums), true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 62 - assert_eq!(Solution::can_jump(nums), true); [INFO] [stdout] 62 + assert!(Solution::can_jump(nums)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/array/array_can_jump.rs:65:9 [INFO] [stdout] | [INFO] [stdout] 65 | assert_eq!(Solution::can_jump(nums), true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 65 - assert_eq!(Solution::can_jump(nums), true); [INFO] [stdout] 65 + assert!(Solution::can_jump(nums)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/array/array_can_jump.rs:68:9 [INFO] [stdout] | [INFO] [stdout] 68 | assert_eq!(Solution::can_jump(nums), true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 68 - assert_eq!(Solution::can_jump(nums), true); [INFO] [stdout] 68 + assert!(Solution::can_jump(nums)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/array/array_roman_to_int.rs:7:26 [INFO] [stdout] | [INFO] [stdout] 7 | let roman_char = vec!['I', 'V', 'X', 'L', 'C','D', 'M']; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `['I', 'V', 'X', 'L', 'C','D', 'M']` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/array/array_roman_to_int.rs:8:25 [INFO] [stdout] | [INFO] [stdout] 8 | let roman_int = vec![1, 5, 10, 50, 100, 500, 1000]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[1, 5, 10, 50, 100, 500, 1000]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/array/array_roman_to_int.rs:67:27 [INFO] [stdout] | [INFO] [stdout] 67 | let source_strs = vec!["III", "IV", "IX", "LVIII", "MCMXCIV", "MDCCCLXXXIV", "CCCI"]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `["III", "IV", "IX", "LVIII", "MCMXCIV", "MDCCCLXXXIV", "CCCI"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/array/array_roman_to_int.rs:68:27 [INFO] [stdout] | [INFO] [stdout] 68 | let goal_values = vec![3, 4, 9, 58, 1994, 1884, 301]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[3, 4, 9, 58, 1994, 1884, 301]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 43.44s [INFO] running `Command { std: "docker" "inspect" "81644076a8fa757ab117c12d8b55954b8b0e003214e552df098dfaedebf1d7e8", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "81644076a8fa757ab117c12d8b55954b8b0e003214e552df098dfaedebf1d7e8", kill_on_drop: false }` [INFO] [stdout] 81644076a8fa757ab117c12d8b55954b8b0e003214e552df098dfaedebf1d7e8