[INFO] cloning repository https://github.com/Neptun404/rust-file-ls [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/Neptun404/rust-file-ls" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FNeptun404%2Frust-file-ls", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FNeptun404%2Frust-file-ls'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] c0231e65921a11d8d9b8456f7b36beb086004a5d [INFO] linting Neptun404/rust-file-ls against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FNeptun404%2Frust-file-ls" "/workspace/builds/worker-3-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-3-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/Neptun404/rust-file-ls [INFO] finished tweaking git repo https://github.com/Neptun404/rust-file-ls [INFO] tweaked toml for git repo https://github.com/Neptun404/rust-file-ls written to /workspace/builds/worker-3-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/Neptun404/rust-file-ls 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/Neptun404/rust-file-ls already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Blocking waiting for file lock on package cache [INFO] [stderr] Updating crates.io index [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded cli-table v0.5.0 [INFO] [stderr] Downloaded human_bytes v0.4.3 [INFO] [stderr] Downloaded filesize v0.2.0 [INFO] [stderr] Downloaded serde v1.0.224 [INFO] [stderr] Downloaded cli-table-derive v0.5.0 [INFO] [stderr] Downloaded indicatif v0.18.0 [INFO] [stderr] Downloaded colorful v0.3.2 [INFO] [stderr] Downloaded serde_derive v1.0.224 [INFO] [stderr] Downloaded serde_core v1.0.224 [INFO] [stderr] Downloaded console v0.16.1 [INFO] [stderr] Downloaded unit-prefix v0.5.1 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-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] 07cadc8ce7e0ead16164add3394c6483dac1fdf781eba99023a5f9db84d0fc5e [INFO] running `Command { std: "docker" "start" "-a" "07cadc8ce7e0ead16164add3394c6483dac1fdf781eba99023a5f9db84d0fc5e", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "07cadc8ce7e0ead16164add3394c6483dac1fdf781eba99023a5f9db84d0fc5e", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "07cadc8ce7e0ead16164add3394c6483dac1fdf781eba99023a5f9db84d0fc5e", kill_on_drop: false }` [INFO] [stdout] 07cadc8ce7e0ead16164add3394c6483dac1fdf781eba99023a5f9db84d0fc5e [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-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] 385e4163df066d955fef08dd34911f8594900d6434a1787976f36ce2783ef27d [INFO] running `Command { std: "docker" "start" "-a" "385e4163df066d955fef08dd34911f8594900d6434a1787976f36ce2783ef27d", kill_on_drop: false }` [INFO] [stderr] Compiling serde_core v1.0.224 [INFO] [stderr] Compiling serde v1.0.224 [INFO] [stderr] Compiling libc v0.2.175 [INFO] [stderr] Checking unicode-width v0.2.1 [INFO] [stderr] Compiling portable-atomic v1.11.1 [INFO] [stderr] Checking memchr v2.7.5 [INFO] [stderr] Checking unit-prefix v0.5.1 [INFO] [stderr] Checking colorful v0.3.2 [INFO] [stderr] Checking human_bytes v0.4.3 [INFO] [stderr] Checking filesize v0.2.0 [INFO] [stderr] Compiling quote v1.0.40 [INFO] [stderr] Compiling syn v2.0.106 [INFO] [stderr] Checking csv-core v0.1.12 [INFO] [stderr] Checking console v0.16.1 [INFO] [stderr] Checking indicatif v0.18.0 [INFO] [stderr] Compiling cli-table-derive v0.5.0 [INFO] [stderr] Checking csv v1.3.1 [INFO] [stderr] Checking cli-table v0.5.0 [INFO] [stderr] Checking nep-ls v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: this import is redundant [INFO] [stdout] --> src/main.rs:5:1 [INFO] [stdout] | [INFO] [stdout] 5 | use filesize; [INFO] [stdout] | ^^^^^^^^^^^^^ help: remove it entirely [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_component_path_imports [INFO] [stdout] = note: `#[warn(clippy::single_component_path_imports)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this import is redundant [INFO] [stdout] --> src/main.rs:14:1 [INFO] [stdout] | [INFO] [stdout] 14 | use walkdir; [INFO] [stdout] | ^^^^^^^^^^^^ help: remove it entirely [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_component_path_imports [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/main.rs:30:8 [INFO] [stdout] | [INFO] [stdout] 30 | if !directory_position.is_none() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `directory_position.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 `directory_position` after checking its variant with `is_none` [INFO] [stdout] --> src/main.rs:31:34 [INFO] [stdout] | [INFO] [stdout] 30 | if !directory_position.is_none() { [INFO] [stdout] | ---------------------------- the check is happening here [INFO] [stdout] 31 | let directory_position = directory_position.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `if let` or `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/main.rs:46:17 [INFO] [stdout] | [INFO] [stdout] 46 | / return vec![ [INFO] [stdout] 47 | | (index + 1).cell().justify(Justify::Center), [INFO] [stdout] 48 | | x1.file_name.clone().cell().justify(Justify::Left), [INFO] [stdout] 49 | | (if x1.file_extension.is_none() { [INFO] [stdout] ... | [INFO] [stdout] 64 | | .justify(Justify::Center), [INFO] [stdout] 65 | | ]; [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] 46 ~ vec![ [INFO] [stdout] 47 + (index + 1).cell().justify(Justify::Center), [INFO] [stdout] 48 + x1.file_name.clone().cell().justify(Justify::Left), [INFO] [stdout] 49 + (if x1.file_extension.is_none() { [INFO] [stdout] 50 + String::from("-") [INFO] [stdout] 51 + } else { [INFO] [stdout] 52 + x1.file_extension.clone().unwrap() [INFO] [stdout] 53 + }) [INFO] [stdout] 54 + .cell() [INFO] [stdout] 55 + .justify(Justify::Center), [INFO] [stdout] 56 + (if x1.file_is_directory { "Dir" } else { "File" }) [INFO] [stdout] 57 + .cell() [INFO] [stdout] 58 + .justify(Justify::Center), [INFO] [stdout] 59 + format_filesize(x1.file_size) [INFO] [stdout] 60 + .cell() [INFO] [stdout] 61 + .justify(Justify::Center), [INFO] [stdout] 62 + format_filesize(x1.file_disk_size) [INFO] [stdout] 63 + .cell() [INFO] [stdout] 64 + .justify(Justify::Center), [INFO] [stdout] 65 ~ ] [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/main.rs:99:8 [INFO] [stdout] | [INFO] [stdout] 99 | if !color.is_none() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try: `color.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `color` after checking its variant with `is_none` [INFO] [stdout] --> src/main.rs:100:44 [INFO] [stdout] | [INFO] [stdout] 99 | if !color.is_none() { [INFO] [stdout] | --------------- the check is happening here [INFO] [stdout] 100 | human_bytes(filesize as f64).color(color.unwrap()) [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `if let` or `match` [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 operation has no effect [INFO] [stdout] --> src/main.rs:88:32 [INFO] [stdout] | [INFO] [stdout] 88 | let upper_threshold: u64 = 1 * 1000 * 1000 * 1000; // 1 gigabytes [INFO] [stdout] | ^^^^^^^^ help: consider reducing it to: `1000` [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/main.rs:106:42 [INFO] [stdout] | [INFO] [stdout] 106 | fn sort_directory_by_extension(contents: &mut Vec) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 106 - fn sort_directory_by_extension(contents: &mut Vec) { [INFO] [stdout] 106 + fn sort_directory_by_extension(contents: &mut [FileInfo]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/main.rs:108:42 [INFO] [stdout] | [INFO] [stdout] 108 | if x.file_extension.is_none() && !x1.file_extension.is_none() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `x1.file_extension.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/main.rs:111:9 [INFO] [stdout] | [INFO] [stdout] 111 | return Ordering::Less; [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] 111 - return Ordering::Less; [INFO] [stdout] 111 + Ordering::Less [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/main.rs:117:5 [INFO] [stdout] | [INFO] [stdout] 117 | directories.sort_by(|x, x1| x.file_name.to_lowercase().cmp(&x1.file_name.to_lowercase())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] = note: `#[warn(clippy::unnecessary_sort_by)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 117 - directories.sort_by(|x, x1| x.file_name.to_lowercase().cmp(&x1.file_name.to_lowercase())); [INFO] [stdout] 117 + directories.sort_by_key(|x| x.file_name.to_lowercase()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `file_extension` after checking its variant with `is_none` [INFO] [stdout] --> src/main.rs:145:35 [INFO] [stdout] | [INFO] [stdout] 142 | file_extension: if file_extension.is_none() { [INFO] [stdout] | --------------------------- help: try: `if let Some() = file_extension` [INFO] [stdout] ... [INFO] [stdout] 145 | Some(String::from(file_extension.unwrap())) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::string::String` [INFO] [stdout] --> src/main.rs:145:22 [INFO] [stdout] | [INFO] [stdout] 145 | Some(String::from(file_extension.unwrap())) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `String::from()`: `file_extension.unwrap()` [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: this import is redundant [INFO] [stdout] --> src/main.rs:5:1 [INFO] [stdout] | [INFO] [stdout] 5 | use filesize; [INFO] [stdout] | ^^^^^^^^^^^^^ help: remove it entirely [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_component_path_imports [INFO] [stdout] = note: `#[warn(clippy::single_component_path_imports)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this import is redundant [INFO] [stdout] --> src/main.rs:14:1 [INFO] [stdout] | [INFO] [stdout] 14 | use walkdir; [INFO] [stdout] | ^^^^^^^^^^^^ help: remove it entirely [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_component_path_imports [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/main.rs:30:8 [INFO] [stdout] | [INFO] [stdout] 30 | if !directory_position.is_none() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `directory_position.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 `directory_position` after checking its variant with `is_none` [INFO] [stdout] --> src/main.rs:31:34 [INFO] [stdout] | [INFO] [stdout] 30 | if !directory_position.is_none() { [INFO] [stdout] | ---------------------------- the check is happening here [INFO] [stdout] 31 | let directory_position = directory_position.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `if let` or `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/main.rs:46:17 [INFO] [stdout] | [INFO] [stdout] 46 | / return vec![ [INFO] [stdout] 47 | | (index + 1).cell().justify(Justify::Center), [INFO] [stdout] 48 | | x1.file_name.clone().cell().justify(Justify::Left), [INFO] [stdout] 49 | | (if x1.file_extension.is_none() { [INFO] [stdout] ... | [INFO] [stdout] 64 | | .justify(Justify::Center), [INFO] [stdout] 65 | | ]; [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] 46 ~ vec![ [INFO] [stdout] 47 + (index + 1).cell().justify(Justify::Center), [INFO] [stdout] 48 + x1.file_name.clone().cell().justify(Justify::Left), [INFO] [stdout] 49 + (if x1.file_extension.is_none() { [INFO] [stdout] 50 + String::from("-") [INFO] [stdout] 51 + } else { [INFO] [stdout] 52 + x1.file_extension.clone().unwrap() [INFO] [stdout] 53 + }) [INFO] [stdout] 54 + .cell() [INFO] [stdout] 55 + .justify(Justify::Center), [INFO] [stdout] 56 + (if x1.file_is_directory { "Dir" } else { "File" }) [INFO] [stdout] 57 + .cell() [INFO] [stdout] 58 + .justify(Justify::Center), [INFO] [stdout] 59 + format_filesize(x1.file_size) [INFO] [stdout] 60 + .cell() [INFO] [stdout] 61 + .justify(Justify::Center), [INFO] [stdout] 62 + format_filesize(x1.file_disk_size) [INFO] [stdout] 63 + .cell() [INFO] [stdout] 64 + .justify(Justify::Center), [INFO] [stdout] 65 ~ ] [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/main.rs:99:8 [INFO] [stdout] | [INFO] [stdout] 99 | if !color.is_none() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try: `color.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `color` after checking its variant with `is_none` [INFO] [stdout] --> src/main.rs:100:44 [INFO] [stdout] | [INFO] [stdout] 99 | if !color.is_none() { [INFO] [stdout] | --------------- the check is happening here [INFO] [stdout] 100 | human_bytes(filesize as f64).color(color.unwrap()) [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `if let` or `match` [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 operation has no effect [INFO] [stdout] --> src/main.rs:88:32 [INFO] [stdout] | [INFO] [stdout] 88 | let upper_threshold: u64 = 1 * 1000 * 1000 * 1000; // 1 gigabytes [INFO] [stdout] | ^^^^^^^^ help: consider reducing it to: `1000` [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/main.rs:106:42 [INFO] [stdout] | [INFO] [stdout] 106 | fn sort_directory_by_extension(contents: &mut Vec) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 106 - fn sort_directory_by_extension(contents: &mut Vec) { [INFO] [stdout] 106 + fn sort_directory_by_extension(contents: &mut [FileInfo]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/main.rs:108:42 [INFO] [stdout] | [INFO] [stdout] 108 | if x.file_extension.is_none() && !x1.file_extension.is_none() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `x1.file_extension.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/main.rs:111:9 [INFO] [stdout] | [INFO] [stdout] 111 | return Ordering::Less; [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] 111 - return Ordering::Less; [INFO] [stdout] 111 + Ordering::Less [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/main.rs:117:5 [INFO] [stdout] | [INFO] [stdout] 117 | directories.sort_by(|x, x1| x.file_name.to_lowercase().cmp(&x1.file_name.to_lowercase())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] = note: `#[warn(clippy::unnecessary_sort_by)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 117 - directories.sort_by(|x, x1| x.file_name.to_lowercase().cmp(&x1.file_name.to_lowercase())); [INFO] [stdout] 117 + directories.sort_by_key(|x| x.file_name.to_lowercase()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `file_extension` after checking its variant with `is_none` [INFO] [stdout] --> src/main.rs:145:35 [INFO] [stdout] | [INFO] [stdout] 142 | file_extension: if file_extension.is_none() { [INFO] [stdout] | --------------------------- help: try: `if let Some() = file_extension` [INFO] [stdout] ... [INFO] [stdout] 145 | Some(String::from(file_extension.unwrap())) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::string::String` [INFO] [stdout] --> src/main.rs:145:22 [INFO] [stdout] | [INFO] [stdout] 145 | Some(String::from(file_extension.unwrap())) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `String::from()`: `file_extension.unwrap()` [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] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 7.22s [INFO] running `Command { std: "docker" "inspect" "385e4163df066d955fef08dd34911f8594900d6434a1787976f36ce2783ef27d", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "385e4163df066d955fef08dd34911f8594900d6434a1787976f36ce2783ef27d", kill_on_drop: false }` [INFO] [stdout] 385e4163df066d955fef08dd34911f8594900d6434a1787976f36ce2783ef27d