[INFO] cloning repository https://github.com/Ly-sec/swiftfetch [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/Ly-sec/swiftfetch" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FLy-sec%2Fswiftfetch", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FLy-sec%2Fswiftfetch'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 8efb87ac8d97cac9167db96f0d67172d9f3942ad [INFO] linting Ly-sec/swiftfetch against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FLy-sec%2Fswiftfetch" "/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/Ly-sec/swiftfetch [INFO] finished tweaking git repo https://github.com/Ly-sec/swiftfetch [INFO] tweaked toml for git repo https://github.com/Ly-sec/swiftfetch written to /workspace/builds/worker-2-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/Ly-sec/swiftfetch 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/Ly-sec/swiftfetch 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] Blocking waiting for file lock on package cache [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded serde v1.0.219 [INFO] [stderr] Downloaded num-traits v0.2.19 [INFO] [stderr] Downloaded autocfg v1.5.0 [INFO] [stderr] Downloaded either v1.15.0 [INFO] [stderr] Downloaded crossbeam-deque v0.8.6 [INFO] [stderr] Downloaded fdeflate v0.3.7 [INFO] [stderr] Downloaded png v0.17.16 [INFO] [stderr] Downloaded crossbeam-epoch v0.9.18 [INFO] [stderr] Downloaded crc32fast v1.5.0 [INFO] [stderr] Downloaded getrandom v0.2.16 [INFO] [stderr] Downloaded thiserror v1.0.69 [INFO] [stderr] Downloaded bytemuck v1.24.0 [INFO] [stderr] Downloaded redox_users v0.4.6 [INFO] [stderr] Downloaded thiserror-impl v1.0.69 [INFO] [stderr] Downloaded base64 v0.21.7 [INFO] [stderr] Downloaded libredox v0.1.3 [INFO] [stderr] Downloaded proc-macro2 v1.0.95 [INFO] [stderr] Downloaded quote v1.0.40 [INFO] [stderr] Downloaded simd-adler32 v0.3.7 [INFO] [stderr] Downloaded dirs-sys v0.3.7 [INFO] [stderr] Downloaded rayon v1.11.0 [INFO] [stderr] Downloaded shellexpand v2.1.2 [INFO] [stderr] Downloaded miniz_oxide v0.8.9 [INFO] [stderr] Downloaded indexmap v2.9.0 [INFO] [stderr] Downloaded serde_spanned v0.6.8 [INFO] [stderr] Downloaded unicode-ident v1.0.18 [INFO] [stderr] Downloaded syn v2.0.101 [INFO] [stderr] Downloaded toml_datetime v0.6.9 [INFO] [stderr] Downloaded unicode-width v0.1.14 [INFO] [stderr] Downloaded crossbeam-utils v0.8.21 [INFO] [stderr] Downloaded dirs v4.0.0 [INFO] [stderr] Downloaded equivalent v1.0.2 [INFO] [stderr] Downloaded serde_derive v1.0.219 [INFO] [stderr] Downloaded winnow v0.5.40 [INFO] [stderr] Downloaded toml_edit v0.19.15 [INFO] [stderr] Downloaded toml v0.7.8 [INFO] [stderr] Downloaded bitflags v1.3.2 [INFO] [stderr] Downloaded flate2 v1.1.5 [INFO] [stderr] Downloaded libc v0.2.172 [INFO] [stderr] Downloaded adler2 v2.0.1 [INFO] [stderr] Downloaded bitflags v2.9.0 [INFO] [stderr] Downloaded image v0.24.9 [INFO] [stderr] Downloaded rayon-core v1.13.0 [INFO] [stderr] Downloaded hashbrown v0.15.3 [INFO] [stderr] Downloaded jpeg-decoder v0.3.2 [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] 9fd9bd7fa1e67f420d55e850c559d8e05e8d355db507718e8ac4b2f7296c57c4 [INFO] running `Command { std: "docker" "start" "-a" "9fd9bd7fa1e67f420d55e850c559d8e05e8d355db507718e8ac4b2f7296c57c4", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "9fd9bd7fa1e67f420d55e850c559d8e05e8d355db507718e8ac4b2f7296c57c4", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "9fd9bd7fa1e67f420d55e850c559d8e05e8d355db507718e8ac4b2f7296c57c4", kill_on_drop: false }` [INFO] [stdout] 9fd9bd7fa1e67f420d55e850c559d8e05e8d355db507718e8ac4b2f7296c57c4 [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] 3fb72c56169114b0d0357a6c794228f75054b28763d53f3a9d1e0b24fa131b53 [INFO] running `Command { std: "docker" "start" "-a" "3fb72c56169114b0d0357a6c794228f75054b28763d53f3a9d1e0b24fa131b53", kill_on_drop: false }` [INFO] [stderr] Compiling proc-macro2 v1.0.95 [INFO] [stderr] Compiling unicode-ident v1.0.18 [INFO] [stderr] Compiling crossbeam-utils v0.8.21 [INFO] [stderr] Compiling serde v1.0.219 [INFO] [stderr] Compiling libc v0.2.172 [INFO] [stderr] Checking simd-adler32 v0.3.7 [INFO] [stderr] Compiling crc32fast v1.5.0 [INFO] [stderr] Checking cfg-if v1.0.0 [INFO] [stderr] Checking adler2 v2.0.1 [INFO] [stderr] Compiling autocfg v1.5.0 [INFO] [stderr] Checking equivalent v1.0.2 [INFO] [stderr] Checking hashbrown v0.15.3 [INFO] [stderr] Compiling rayon-core v1.13.0 [INFO] [stderr] Checking winnow v0.5.40 [INFO] [stderr] Checking bitflags v1.3.2 [INFO] [stderr] Checking either v1.15.0 [INFO] [stderr] Checking color_quant v1.1.0 [INFO] [stderr] Checking bytemuck v1.24.0 [INFO] [stderr] Checking jpeg-decoder v0.3.2 [INFO] [stderr] Checking byteorder v1.5.0 [INFO] [stderr] Compiling swiftfetch v0.1.3 (/opt/rustwide/workdir) [INFO] [stderr] Checking unicode-width v0.1.14 [INFO] [stderr] Checking base64 v0.21.7 [INFO] [stderr] Checking miniz_oxide v0.8.9 [INFO] [stdout] warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> build.rs:58:13 [INFO] [stdout] | [INFO] [stdout] 58 | / for entry in entries { [INFO] [stdout] 59 | | if let Ok(entry) = entry { [INFO] [stdout] 60 | | let path = entry.path(); [INFO] [stdout] 61 | | if path.is_file() && path.extension().map_or(false, |ext| ext == "txt") { [INFO] [stdout] ... | [INFO] [stdout] 96 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> build.rs:59:17 [INFO] [stdout] | [INFO] [stdout] 59 | / if let Ok(entry) = entry { [INFO] [stdout] 60 | | let path = entry.path(); [INFO] [stdout] 61 | | if path.is_file() && path.extension().map_or(false, |ext| ext == "txt") { [INFO] [stdout] 62 | | if let Some(file_name) = path.file_name() { [INFO] [stdout] ... | [INFO] [stdout] 95 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] = note: `#[warn(clippy::manual_flatten)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 58 ~ for entry in entries.flatten() { [INFO] [stdout] 59 + let path = entry.path(); [INFO] [stdout] 60 + if path.is_file() && path.extension().map_or(false, |ext| ext == "txt") { [INFO] [stdout] 61 + if let Some(file_name) = path.file_name() { [INFO] [stdout] 62 + let target_file = Path::new(target_dir).join(file_name); [INFO] [stdout] 63 + [INFO] [stdout] 64 + // Only copy if the file doesn't exist or is older than the source [INFO] [stdout] 65 + let should_copy = if target_file.exists() { [INFO] [stdout] 66 + if let (Ok(source_meta), Ok(target_meta)) = [INFO] [stdout] 67 + (fs::metadata(&path), fs::metadata(&target_file)) [INFO] [stdout] 68 + { [INFO] [stdout] 69 + if let (Ok(source_time), Ok(target_time)) = [INFO] [stdout] 70 + (source_meta.modified(), target_meta.modified()) [INFO] [stdout] 71 + { [INFO] [stdout] 72 + source_time > target_time [INFO] [stdout] 73 + } else { [INFO] [stdout] 74 + true // If we can't get timestamps, copy anyway [INFO] [stdout] 75 + } [INFO] [stdout] 76 + } else { [INFO] [stdout] 77 + true [INFO] [stdout] 78 + } [INFO] [stdout] 79 + } else { [INFO] [stdout] 80 + true [INFO] [stdout] 81 + }; [INFO] [stdout] 82 + [INFO] [stdout] 83 + if should_copy { [INFO] [stdout] 84 + match fs::copy(&path, &target_file) { [INFO] [stdout] 85 + Ok(_) => println!("Copied ASCII file: {:?}", file_name), [INFO] [stdout] 86 + Err(e) => eprintln!( [INFO] [stdout] 87 + "Failed to copy ASCII file {:?}: {}", [INFO] [stdout] 88 + file_name, e [INFO] [stdout] 89 + ), [INFO] [stdout] 90 + } [INFO] [stdout] 91 + } [INFO] [stdout] 92 + } [INFO] [stdout] 93 + } [INFO] [stdout] 94 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> build.rs:61:42 [INFO] [stdout] | [INFO] [stdout] 61 | if path.is_file() && path.extension().map_or(false, |ext| ext == "txt") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] = note: `#[warn(clippy::unnecessary_map_or)]` on by default [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 61 - if path.is_file() && path.extension().map_or(false, |ext| ext == "txt") { [INFO] [stdout] 61 + if path.is_file() && path.extension().is_some_and(|ext| ext == "txt") { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Checking fdeflate v0.3.7 [INFO] [stderr] Checking indexmap v2.9.0 [INFO] [stderr] Compiling num-traits v0.2.19 [INFO] [stderr] Checking flate2 v1.1.5 [INFO] [stderr] Compiling quote v1.0.40 [INFO] [stderr] Checking png v0.17.16 [INFO] [stderr] Checking dirs-sys v0.3.7 [INFO] [stderr] Compiling syn v2.0.101 [INFO] [stderr] Checking crossbeam-epoch v0.9.18 [INFO] [stderr] Checking dirs v4.0.0 [INFO] [stderr] Checking shellexpand v2.1.2 [INFO] [stderr] Checking crossbeam-deque v0.8.6 [INFO] [stderr] Checking image v0.24.9 [INFO] [stderr] Checking rayon v1.11.0 [INFO] [stderr] Compiling serde_derive v1.0.219 [INFO] [stderr] Checking toml_datetime v0.6.9 [INFO] [stderr] Checking serde_spanned v0.6.8 [INFO] [stderr] Checking toml_edit v0.19.15 [INFO] [stderr] Checking toml v0.7.8 [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/collectors/hardware.rs:12:24 [INFO] [stdout] | [INFO] [stdout] 12 | || rayon::join(|| collect_cpu_info(), || collect_gpu_info()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `collect_cpu_info` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/collectors/hardware.rs:12:47 [INFO] [stdout] | [INFO] [stdout] 12 | || rayon::join(|| collect_cpu_info(), || collect_gpu_info()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `collect_gpu_info` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/collectors/hardware.rs:13:24 [INFO] [stdout] | [INFO] [stdout] 13 | || rayon::join(|| collect_memory_info(), || collect_disk_info()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `collect_memory_info` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/collectors/hardware.rs:13:50 [INFO] [stdout] | [INFO] [stdout] 13 | || rayon::join(|| collect_memory_info(), || collect_disk_info()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `collect_disk_info` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/collectors/hardware.rs:12:24 [INFO] [stdout] | [INFO] [stdout] 12 | || rayon::join(|| collect_cpu_info(), || collect_gpu_info()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `collect_cpu_info` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/collectors/hardware.rs:12:47 [INFO] [stdout] | [INFO] [stdout] 12 | || rayon::join(|| collect_cpu_info(), || collect_gpu_info()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `collect_gpu_info` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/collectors/hardware.rs:13:24 [INFO] [stdout] | [INFO] [stdout] 13 | || rayon::join(|| collect_memory_info(), || collect_disk_info()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `collect_memory_info` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/collectors/hardware.rs:13:50 [INFO] [stdout] | [INFO] [stdout] 13 | || rayon::join(|| collect_memory_info(), || collect_disk_info()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `collect_disk_info` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> src/collectors/hardware.rs:200:9 [INFO] [stdout] | [INFO] [stdout] 200 | / for entry in entries { [INFO] [stdout] 201 | | if let Ok(entry) = entry { [INFO] [stdout] 202 | | let path = entry.path(); [INFO] [stdout] 203 | | if let Some(name) = path.file_name().and_then(|n| n.to_str()) { [INFO] [stdout] ... | [INFO] [stdout] 221 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/collectors/hardware.rs:201:13 [INFO] [stdout] | [INFO] [stdout] 201 | / if let Ok(entry) = entry { [INFO] [stdout] 202 | | let path = entry.path(); [INFO] [stdout] 203 | | if let Some(name) = path.file_name().and_then(|n| n.to_str()) { [INFO] [stdout] 204 | | if name.starts_with("card") && !name.contains("-") { [INFO] [stdout] ... | [INFO] [stdout] 220 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] = note: `#[warn(clippy::manual_flatten)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 200 ~ for entry in entries.flatten() { [INFO] [stdout] 201 + let path = entry.path(); [INFO] [stdout] 202 + if let Some(name) = path.file_name().and_then(|n| n.to_str()) { [INFO] [stdout] 203 + if name.starts_with("card") && !name.contains("-") { [INFO] [stdout] 204 + // Read device name directly from sysfs [INFO] [stdout] 205 + if let Ok(device_name) = fs::read_to_string(path.join("device/name")) { [INFO] [stdout] 206 + let name = device_name.trim(); [INFO] [stdout] 207 + if !name.is_empty() { [INFO] [stdout] 208 + // Determine if integrated or discrete [INFO] [stdout] 209 + let gpu_type = if is_integrated_gpu(&path) { [INFO] [stdout] 210 + " [Integrated]" [INFO] [stdout] 211 + } else { [INFO] [stdout] 212 + " [Discrete]" [INFO] [stdout] 213 + }; [INFO] [stdout] 214 + gpus.push(format!("{}{}", name, gpu_type)); [INFO] [stdout] 215 + } [INFO] [stdout] 216 + } [INFO] [stdout] 217 + } [INFO] [stdout] 218 + } [INFO] [stdout] 219 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> src/collectors/hardware.rs:200:9 [INFO] [stdout] | [INFO] [stdout] 200 | / for entry in entries { [INFO] [stdout] 201 | | if let Ok(entry) = entry { [INFO] [stdout] 202 | | let path = entry.path(); [INFO] [stdout] 203 | | if let Some(name) = path.file_name().and_then(|n| n.to_str()) { [INFO] [stdout] ... | [INFO] [stdout] 221 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/collectors/hardware.rs:201:13 [INFO] [stdout] | [INFO] [stdout] 201 | / if let Ok(entry) = entry { [INFO] [stdout] 202 | | let path = entry.path(); [INFO] [stdout] 203 | | if let Some(name) = path.file_name().and_then(|n| n.to_str()) { [INFO] [stdout] 204 | | if name.starts_with("card") && !name.contains("-") { [INFO] [stdout] ... | [INFO] [stdout] 220 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] = note: `#[warn(clippy::manual_flatten)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 200 ~ for entry in entries.flatten() { [INFO] [stdout] 201 + let path = entry.path(); [INFO] [stdout] 202 + if let Some(name) = path.file_name().and_then(|n| n.to_str()) { [INFO] [stdout] 203 + if name.starts_with("card") && !name.contains("-") { [INFO] [stdout] 204 + // Read device name directly from sysfs [INFO] [stdout] 205 + if let Ok(device_name) = fs::read_to_string(path.join("device/name")) { [INFO] [stdout] 206 + let name = device_name.trim(); [INFO] [stdout] 207 + if !name.is_empty() { [INFO] [stdout] 208 + // Determine if integrated or discrete [INFO] [stdout] 209 + let gpu_type = if is_integrated_gpu(&path) { [INFO] [stdout] 210 + " [Integrated]" [INFO] [stdout] 211 + } else { [INFO] [stdout] 212 + " [Discrete]" [INFO] [stdout] 213 + }; [INFO] [stdout] 214 + gpus.push(format!("{}{}", name, gpu_type)); [INFO] [stdout] 215 + } [INFO] [stdout] 216 + } [INFO] [stdout] 217 + } [INFO] [stdout] 218 + } [INFO] [stdout] 219 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/collectors/packages.rs:49:8 [INFO] [stdout] | [INFO] [stdout] 49 | if !fs::metadata(flatpak_dir).is_ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `fs::metadata(flatpak_dir).is_err()` [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: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> src/collectors/packages.rs:186:9 [INFO] [stdout] | [INFO] [stdout] 186 | / for entry in entries { [INFO] [stdout] 187 | | if let Ok(entry) = entry { [INFO] [stdout] 188 | | let path = entry.path(); [INFO] [stdout] 189 | | if path.is_dir() { [INFO] [stdout] ... | [INFO] [stdout] 195 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/collectors/packages.rs:187:13 [INFO] [stdout] | [INFO] [stdout] 187 | / if let Ok(entry) = entry { [INFO] [stdout] 188 | | let path = entry.path(); [INFO] [stdout] 189 | | if path.is_dir() { [INFO] [stdout] 190 | | if let Ok(sub_entries) = fs::read_dir(&path) { [INFO] [stdout] ... | [INFO] [stdout] 194 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 186 ~ for entry in entries.flatten() { [INFO] [stdout] 187 + let path = entry.path(); [INFO] [stdout] 188 + if path.is_dir() { [INFO] [stdout] 189 + if let Ok(sub_entries) = fs::read_dir(&path) { [INFO] [stdout] 190 + count += sub_entries.count(); [INFO] [stdout] 191 + } [INFO] [stdout] 192 + } [INFO] [stdout] 193 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/collectors/packages.rs:49:8 [INFO] [stdout] | [INFO] [stdout] 49 | if !fs::metadata(flatpak_dir).is_ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `fs::metadata(flatpak_dir).is_err()` [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: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> src/collectors/sensors.rs:11:9 [INFO] [stdout] | [INFO] [stdout] 11 | / for entry in entries { [INFO] [stdout] 12 | | if let Ok(entry) = entry { [INFO] [stdout] 13 | | let name = entry.file_name(); [INFO] [stdout] 14 | | let name_str = name.to_string_lossy(); [INFO] [stdout] ... | [INFO] [stdout] 43 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/collectors/sensors.rs:12:13 [INFO] [stdout] | [INFO] [stdout] 12 | / if let Ok(entry) = entry { [INFO] [stdout] 13 | | let name = entry.file_name(); [INFO] [stdout] 14 | | let name_str = name.to_string_lossy(); [INFO] [stdout] ... | [INFO] [stdout] 42 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 11 ~ for entry in entries.flatten() { [INFO] [stdout] 12 + let name = entry.file_name(); [INFO] [stdout] 13 + let name_str = name.to_string_lossy(); [INFO] [stdout] 14 + [INFO] [stdout] 15 + // Look for BAT* entries (typical battery naming) [INFO] [stdout] 16 + if name_str.starts_with("BAT") { [INFO] [stdout] 17 + let battery_path = entry.path(); [INFO] [stdout] 18 + [INFO] [stdout] 19 + // Read capacity percentage [INFO] [stdout] 20 + let capacity_path = battery_path.join("capacity"); [INFO] [stdout] 21 + let status_path = battery_path.join("status"); [INFO] [stdout] 22 + [INFO] [stdout] 23 + if let (Ok(capacity), Ok(status)) = ( [INFO] [stdout] 24 + fs::read_to_string(&capacity_path), [INFO] [stdout] 25 + fs::read_to_string(&status_path), [INFO] [stdout] 26 + ) { [INFO] [stdout] 27 + let capacity = capacity.trim(); [INFO] [stdout] 28 + let status = status.trim(); [INFO] [stdout] 29 + [INFO] [stdout] 30 + let status_icon = match status { [INFO] [stdout] 31 ~ "Charging" => "⚡", [INFO] [stdout] 32 ~ "Discharging" => "🔋", [INFO] [stdout] 33 ~ "Full" => "🔋", [INFO] [stdout] 34 ~ "Not charging" => "🔌", [INFO] [stdout] 35 ~ _ => "🔋", [INFO] [stdout] 36 + }; [INFO] [stdout] 37 + [INFO] [stdout] 38 + return Ok(format!("{}% {}", capacity, status_icon)); [INFO] [stdout] 39 + } [INFO] [stdout] 40 + } [INFO] [stdout] 41 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/collectors/system.rs:12:9 [INFO] [stdout] | [INFO] [stdout] 12 | || get_os_age(), [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `get_os_age` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/collectors/system.rs:11:24 [INFO] [stdout] | [INFO] [stdout] 11 | || rayon::join(|| read_os_name(), || read_kernel_version()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `read_os_name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/collectors/system.rs:11:43 [INFO] [stdout] | [INFO] [stdout] 11 | || rayon::join(|| read_os_name(), || read_kernel_version()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `read_kernel_version` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/collectors/system.rs:45:21 [INFO] [stdout] | [INFO] [stdout] 45 | || detect_init_system(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `detect_init_system` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/collectors/system.rs:51:21 [INFO] [stdout] | [INFO] [stdout] 51 | || crate::collectors::desktop::detect_wm_or_de(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `crate::collectors::desktop::detect_wm_or_de` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/collectors/system.rs:54:29 [INFO] [stdout] | [INFO] [stdout] 54 | ... || get_editor(), [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `get_editor` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/collectors/system.rs:55:44 [INFO] [stdout] | [INFO] [stdout] 55 | ... || rayon::join(|| get_shell(), || get_terminal()), [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace the closure with the function itself: `get_shell` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/collectors/system.rs:55:60 [INFO] [stdout] | [INFO] [stdout] 55 | ... || rayon::join(|| get_shell(), || get_terminal()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `get_terminal` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> src/collectors/packages.rs:186:9 [INFO] [stdout] | [INFO] [stdout] 186 | / for entry in entries { [INFO] [stdout] 187 | | if let Ok(entry) = entry { [INFO] [stdout] 188 | | let path = entry.path(); [INFO] [stdout] 189 | | if path.is_dir() { [INFO] [stdout] ... | [INFO] [stdout] 195 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/collectors/packages.rs:187:13 [INFO] [stdout] | [INFO] [stdout] 187 | / if let Ok(entry) = entry { [INFO] [stdout] 188 | | let path = entry.path(); [INFO] [stdout] 189 | | if path.is_dir() { [INFO] [stdout] 190 | | if let Ok(sub_entries) = fs::read_dir(&path) { [INFO] [stdout] ... | [INFO] [stdout] 194 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 186 ~ for entry in entries.flatten() { [INFO] [stdout] 187 + let path = entry.path(); [INFO] [stdout] 188 + if path.is_dir() { [INFO] [stdout] 189 + if let Ok(sub_entries) = fs::read_dir(&path) { [INFO] [stdout] 190 + count += sub_entries.count(); [INFO] [stdout] 191 + } [INFO] [stdout] 192 + } [INFO] [stdout] 193 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> src/collectors/sensors.rs:11:9 [INFO] [stdout] | [INFO] [stdout] 11 | / for entry in entries { [INFO] [stdout] 12 | | if let Ok(entry) = entry { [INFO] [stdout] 13 | | let name = entry.file_name(); [INFO] [stdout] 14 | | let name_str = name.to_string_lossy(); [INFO] [stdout] ... | [INFO] [stdout] 43 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/collectors/sensors.rs:12:13 [INFO] [stdout] | [INFO] [stdout] 12 | / if let Ok(entry) = entry { [INFO] [stdout] 13 | | let name = entry.file_name(); [INFO] [stdout] 14 | | let name_str = name.to_string_lossy(); [INFO] [stdout] ... | [INFO] [stdout] 42 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 11 ~ for entry in entries.flatten() { [INFO] [stdout] 12 + let name = entry.file_name(); [INFO] [stdout] 13 + let name_str = name.to_string_lossy(); [INFO] [stdout] 14 + [INFO] [stdout] 15 + // Look for BAT* entries (typical battery naming) [INFO] [stdout] 16 + if name_str.starts_with("BAT") { [INFO] [stdout] 17 + let battery_path = entry.path(); [INFO] [stdout] 18 + [INFO] [stdout] 19 + // Read capacity percentage [INFO] [stdout] 20 + let capacity_path = battery_path.join("capacity"); [INFO] [stdout] 21 + let status_path = battery_path.join("status"); [INFO] [stdout] 22 + [INFO] [stdout] 23 + if let (Ok(capacity), Ok(status)) = ( [INFO] [stdout] 24 + fs::read_to_string(&capacity_path), [INFO] [stdout] 25 + fs::read_to_string(&status_path), [INFO] [stdout] 26 + ) { [INFO] [stdout] 27 + let capacity = capacity.trim(); [INFO] [stdout] 28 + let status = status.trim(); [INFO] [stdout] 29 + [INFO] [stdout] 30 + let status_icon = match status { [INFO] [stdout] 31 ~ "Charging" => "⚡", [INFO] [stdout] 32 ~ "Discharging" => "🔋", [INFO] [stdout] 33 ~ "Full" => "🔋", [INFO] [stdout] 34 ~ "Not charging" => "🔌", [INFO] [stdout] 35 ~ _ => "🔋", [INFO] [stdout] 36 + }; [INFO] [stdout] 37 + [INFO] [stdout] 38 + return Ok(format!("{}% {}", capacity, status_icon)); [INFO] [stdout] 39 + } [INFO] [stdout] 40 + } [INFO] [stdout] 41 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/collectors/system.rs:12:9 [INFO] [stdout] | [INFO] [stdout] 12 | || get_os_age(), [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `get_os_age` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/collectors/system.rs:11:24 [INFO] [stdout] | [INFO] [stdout] 11 | || rayon::join(|| read_os_name(), || read_kernel_version()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `read_os_name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/collectors/system.rs:11:43 [INFO] [stdout] | [INFO] [stdout] 11 | || rayon::join(|| read_os_name(), || read_kernel_version()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `read_kernel_version` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/collectors/system.rs:45:21 [INFO] [stdout] | [INFO] [stdout] 45 | || detect_init_system(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `detect_init_system` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/collectors/system.rs:51:21 [INFO] [stdout] | [INFO] [stdout] 51 | || crate::collectors::desktop::detect_wm_or_de(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `crate::collectors::desktop::detect_wm_or_de` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/collectors/system.rs:54:29 [INFO] [stdout] | [INFO] [stdout] 54 | ... || get_editor(), [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `get_editor` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/collectors/system.rs:55:44 [INFO] [stdout] | [INFO] [stdout] 55 | ... || rayon::join(|| get_shell(), || get_terminal()), [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace the closure with the function itself: `get_shell` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/collectors/system.rs:55:60 [INFO] [stdout] | [INFO] [stdout] 55 | ... || rayon::join(|| get_shell(), || get_terminal()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `get_terminal` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/collectors/system.rs:295:5 [INFO] [stdout] | [INFO] [stdout] 295 | / std::env::var("SHELL") [INFO] [stdout] 296 | | .unwrap_or_else(|_| "Unknown".to_string()) [INFO] [stdout] 297 | | .split('/') [INFO] [stdout] 298 | | .last() [INFO] [stdout] | |_______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] = note: `#[warn(clippy::double_ended_iterator_last)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 298 - .last() [INFO] [stdout] 298 + .next_back() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> src/collectors/system.rs:351:9 [INFO] [stdout] | [INFO] [stdout] 351 | / for entry in entries { [INFO] [stdout] 352 | | if let Ok(entry) = entry { [INFO] [stdout] 353 | | let name = entry.file_name(); [INFO] [stdout] 354 | | let name_str = name.to_string_lossy(); [INFO] [stdout] ... | [INFO] [stdout] 383 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/collectors/system.rs:352:13 [INFO] [stdout] | [INFO] [stdout] 352 | / if let Ok(entry) = entry { [INFO] [stdout] 353 | | let name = entry.file_name(); [INFO] [stdout] 354 | | let name_str = name.to_string_lossy(); [INFO] [stdout] ... | [INFO] [stdout] 382 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 351 ~ for entry in entries.flatten() { [INFO] [stdout] 352 + let name = entry.file_name(); [INFO] [stdout] 353 + let name_str = name.to_string_lossy(); [INFO] [stdout] 354 + [INFO] [stdout] 355 + // Look for BAT* entries (typical battery naming) [INFO] [stdout] 356 + if name_str.starts_with("BAT") { [INFO] [stdout] 357 + let battery_path = entry.path(); [INFO] [stdout] 358 + [INFO] [stdout] 359 + // Read capacity percentage [INFO] [stdout] 360 + let capacity_path = battery_path.join("capacity"); [INFO] [stdout] 361 + let status_path = battery_path.join("status"); [INFO] [stdout] 362 + [INFO] [stdout] 363 + if let (Ok(capacity), Ok(status)) = ( [INFO] [stdout] 364 + fs::read_to_string(&capacity_path), [INFO] [stdout] 365 + fs::read_to_string(&status_path), [INFO] [stdout] 366 + ) { [INFO] [stdout] 367 + let capacity = capacity.trim(); [INFO] [stdout] 368 + let status = status.trim(); [INFO] [stdout] 369 + [INFO] [stdout] 370 + let status_icon = match status { [INFO] [stdout] 371 ~ "Charging" => "⚡", [INFO] [stdout] 372 ~ "Discharging" => "🔋", [INFO] [stdout] 373 ~ "Full" => "🔋", [INFO] [stdout] 374 ~ "Not charging" => "🔌", [INFO] [stdout] 375 ~ _ => "🔋", [INFO] [stdout] 376 + }; [INFO] [stdout] 377 + [INFO] [stdout] 378 + return Ok(format!("{}% {}", capacity, status_icon)); [INFO] [stdout] 379 + } [INFO] [stdout] 380 + } [INFO] [stdout] 381 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/collectors/system.rs:295:5 [INFO] [stdout] | [INFO] [stdout] 295 | / std::env::var("SHELL") [INFO] [stdout] 296 | | .unwrap_or_else(|_| "Unknown".to_string()) [INFO] [stdout] 297 | | .split('/') [INFO] [stdout] 298 | | .last() [INFO] [stdout] | |_______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] = note: `#[warn(clippy::double_ended_iterator_last)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 298 - .last() [INFO] [stdout] 298 + .next_back() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> src/collectors/system.rs:351:9 [INFO] [stdout] | [INFO] [stdout] 351 | / for entry in entries { [INFO] [stdout] 352 | | if let Ok(entry) = entry { [INFO] [stdout] 353 | | let name = entry.file_name(); [INFO] [stdout] 354 | | let name_str = name.to_string_lossy(); [INFO] [stdout] ... | [INFO] [stdout] 383 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/collectors/system.rs:352:13 [INFO] [stdout] | [INFO] [stdout] 352 | / if let Ok(entry) = entry { [INFO] [stdout] 353 | | let name = entry.file_name(); [INFO] [stdout] 354 | | let name_str = name.to_string_lossy(); [INFO] [stdout] ... | [INFO] [stdout] 382 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 351 ~ for entry in entries.flatten() { [INFO] [stdout] 352 + let name = entry.file_name(); [INFO] [stdout] 353 + let name_str = name.to_string_lossy(); [INFO] [stdout] 354 + [INFO] [stdout] 355 + // Look for BAT* entries (typical battery naming) [INFO] [stdout] 356 + if name_str.starts_with("BAT") { [INFO] [stdout] 357 + let battery_path = entry.path(); [INFO] [stdout] 358 + [INFO] [stdout] 359 + // Read capacity percentage [INFO] [stdout] 360 + let capacity_path = battery_path.join("capacity"); [INFO] [stdout] 361 + let status_path = battery_path.join("status"); [INFO] [stdout] 362 + [INFO] [stdout] 363 + if let (Ok(capacity), Ok(status)) = ( [INFO] [stdout] 364 + fs::read_to_string(&capacity_path), [INFO] [stdout] 365 + fs::read_to_string(&status_path), [INFO] [stdout] 366 + ) { [INFO] [stdout] 367 + let capacity = capacity.trim(); [INFO] [stdout] 368 + let status = status.trim(); [INFO] [stdout] 369 + [INFO] [stdout] 370 + let status_icon = match status { [INFO] [stdout] 371 ~ "Charging" => "⚡", [INFO] [stdout] 372 ~ "Discharging" => "🔋", [INFO] [stdout] 373 ~ "Full" => "🔋", [INFO] [stdout] 374 ~ "Not charging" => "🔌", [INFO] [stdout] 375 ~ _ => "🔋", [INFO] [stdout] 376 + }; [INFO] [stdout] 377 + [INFO] [stdout] 378 + return Ok(format!("{}% {}", capacity, status_icon)); [INFO] [stdout] 379 + } [INFO] [stdout] 380 + } [INFO] [stdout] 381 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `filter_map()` will run forever if the iterator repeatedly produces an `Err` [INFO] [stdout] --> src/display.rs:106:26 [INFO] [stdout] | [INFO] [stdout] 106 | .filter_map(Result::ok) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `map_while(Result::ok)` [INFO] [stdout] | [INFO] [stdout] note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error [INFO] [stdout] --> src/display.rs:104:28 [INFO] [stdout] | [INFO] [stdout] 104 | return io::BufReader::new(file) [INFO] [stdout] | ____________________________^ [INFO] [stdout] 105 | | .lines() [INFO] [stdout] | |________________________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lines_filter_map_ok [INFO] [stdout] = note: `#[warn(clippy::lines_filter_map_ok)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `filter_map()` will run forever if the iterator repeatedly produces an `Err` [INFO] [stdout] --> src/display.rs:106:26 [INFO] [stdout] | [INFO] [stdout] 106 | .filter_map(Result::ok) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `map_while(Result::ok)` [INFO] [stdout] | [INFO] [stdout] note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error [INFO] [stdout] --> src/display.rs:104:28 [INFO] [stdout] | [INFO] [stdout] 104 | return io::BufReader::new(file) [INFO] [stdout] | ____________________________^ [INFO] [stdout] 105 | | .lines() [INFO] [stdout] | |________________________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lines_filter_map_ok [INFO] [stdout] = note: `#[warn(clippy::lines_filter_map_ok)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `ascii_lines` [INFO] [stdout] --> src/display.rs:341:14 [INFO] [stdout] | [INFO] [stdout] 341 | for i in rendered_items.len()..ascii_lines.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 341 - for i in rendered_items.len()..ascii_lines.len() { [INFO] [stdout] 341 + for in ascii_lines.iter().skip(rendered_items.len()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `system_data [INFO] [stdout] .all_gpus.get(0)` [INFO] [stdout] --> src/display.rs:363:23 [INFO] [stdout] | [INFO] [stdout] 363 | "gpu1" => system_data [INFO] [stdout] | _______________________^ [INFO] [stdout] 364 | | .all_gpus [INFO] [stdout] 365 | | .get(0) [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 363 ~ "gpu1" => system_data [INFO] [stdout] 364 + .all_gpus.first() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/display.rs:478:5 [INFO] [stdout] | [INFO] [stdout] 478 | / pub fn render_image( [INFO] [stdout] 479 | | path: &str, [INFO] [stdout] 480 | | target_width: Option, [INFO] [stdout] 481 | | target_height: Option, [INFO] [stdout] ... | [INFO] [stdout] 486 | | output: &mut String, [INFO] [stdout] 487 | | ) -> Result { [INFO] [stdout] | |_________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] = note: `#[warn(clippy::too_many_arguments)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/lib.rs:22:17 [INFO] [stdout] | [INFO] [stdout] 22 | || collectors::system::collect_os_info(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `collectors::system::collect_os_info` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/lib.rs:23:17 [INFO] [stdout] | [INFO] [stdout] 23 | || collectors::hardware::collect_hardware_info(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `collectors::hardware::collect_hardware_info` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/lib.rs:28:17 [INFO] [stdout] | [INFO] [stdout] 28 | || collectors::packages::collect_package_info(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `collectors::packages::collect_package_info` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/lib.rs:31:25 [INFO] [stdout] | [INFO] [stdout] 31 | || collectors::system::collect_system_status(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `collectors::system::collect_system_status` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/lib.rs:32:25 [INFO] [stdout] | [INFO] [stdout] 32 | || collectors::system::collect_user_info(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `collectors::system::collect_user_info` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `ascii_lines` [INFO] [stdout] --> src/display.rs:341:14 [INFO] [stdout] | [INFO] [stdout] 341 | for i in rendered_items.len()..ascii_lines.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 341 - for i in rendered_items.len()..ascii_lines.len() { [INFO] [stdout] 341 + for in ascii_lines.iter().skip(rendered_items.len()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `system_data [INFO] [stdout] .all_gpus.get(0)` [INFO] [stdout] --> src/display.rs:363:23 [INFO] [stdout] | [INFO] [stdout] 363 | "gpu1" => system_data [INFO] [stdout] | _______________________^ [INFO] [stdout] 364 | | .all_gpus [INFO] [stdout] 365 | | .get(0) [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 363 ~ "gpu1" => system_data [INFO] [stdout] 364 + .all_gpus.first() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/display.rs:478:5 [INFO] [stdout] | [INFO] [stdout] 478 | / pub fn render_image( [INFO] [stdout] 479 | | path: &str, [INFO] [stdout] 480 | | target_width: Option, [INFO] [stdout] 481 | | target_height: Option, [INFO] [stdout] ... | [INFO] [stdout] 486 | | output: &mut String, [INFO] [stdout] 487 | | ) -> Result { [INFO] [stdout] | |_________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] = note: `#[warn(clippy::too_many_arguments)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/lib.rs:22:17 [INFO] [stdout] | [INFO] [stdout] 22 | || collectors::system::collect_os_info(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `collectors::system::collect_os_info` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/lib.rs:23:17 [INFO] [stdout] | [INFO] [stdout] 23 | || collectors::hardware::collect_hardware_info(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `collectors::hardware::collect_hardware_info` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/lib.rs:28:17 [INFO] [stdout] | [INFO] [stdout] 28 | || collectors::packages::collect_package_info(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `collectors::packages::collect_package_info` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/lib.rs:31:25 [INFO] [stdout] | [INFO] [stdout] 31 | || collectors::system::collect_system_status(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `collectors::system::collect_system_status` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/lib.rs:32:25 [INFO] [stdout] | [INFO] [stdout] 32 | || collectors::system::collect_user_info(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `collectors::system::collect_user_info` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this import is redundant [INFO] [stdout] --> src/display.rs:3:1 [INFO] [stdout] | [INFO] [stdout] 3 | use shellexpand; [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/display.rs:3:1 [INFO] [stdout] | [INFO] [stdout] 3 | use shellexpand; [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: redundant closure [INFO] [stdout] --> src/collectors/hardware.rs:12:24 [INFO] [stdout] | [INFO] [stdout] 12 | || rayon::join(|| collect_cpu_info(), || collect_gpu_info()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `collect_cpu_info` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/collectors/hardware.rs:12:47 [INFO] [stdout] | [INFO] [stdout] 12 | || rayon::join(|| collect_cpu_info(), || collect_gpu_info()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `collect_gpu_info` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/collectors/hardware.rs:13:24 [INFO] [stdout] | [INFO] [stdout] 13 | || rayon::join(|| collect_memory_info(), || collect_disk_info()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `collect_memory_info` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/collectors/hardware.rs:13:50 [INFO] [stdout] | [INFO] [stdout] 13 | || rayon::join(|| collect_memory_info(), || collect_disk_info()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `collect_disk_info` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> src/collectors/hardware.rs:200:9 [INFO] [stdout] | [INFO] [stdout] 200 | / for entry in entries { [INFO] [stdout] 201 | | if let Ok(entry) = entry { [INFO] [stdout] 202 | | let path = entry.path(); [INFO] [stdout] 203 | | if let Some(name) = path.file_name().and_then(|n| n.to_str()) { [INFO] [stdout] ... | [INFO] [stdout] 221 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/collectors/hardware.rs:201:13 [INFO] [stdout] | [INFO] [stdout] 201 | / if let Ok(entry) = entry { [INFO] [stdout] 202 | | let path = entry.path(); [INFO] [stdout] 203 | | if let Some(name) = path.file_name().and_then(|n| n.to_str()) { [INFO] [stdout] 204 | | if name.starts_with("card") && !name.contains("-") { [INFO] [stdout] ... | [INFO] [stdout] 220 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] = note: `#[warn(clippy::manual_flatten)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 200 ~ for entry in entries.flatten() { [INFO] [stdout] 201 + let path = entry.path(); [INFO] [stdout] 202 + if let Some(name) = path.file_name().and_then(|n| n.to_str()) { [INFO] [stdout] 203 + if name.starts_with("card") && !name.contains("-") { [INFO] [stdout] 204 + // Read device name directly from sysfs [INFO] [stdout] 205 + if let Ok(device_name) = fs::read_to_string(path.join("device/name")) { [INFO] [stdout] 206 + let name = device_name.trim(); [INFO] [stdout] 207 + if !name.is_empty() { [INFO] [stdout] 208 + // Determine if integrated or discrete [INFO] [stdout] 209 + let gpu_type = if is_integrated_gpu(&path) { [INFO] [stdout] 210 + " [Integrated]" [INFO] [stdout] 211 + } else { [INFO] [stdout] 212 + " [Discrete]" [INFO] [stdout] 213 + }; [INFO] [stdout] 214 + gpus.push(format!("{}{}", name, gpu_type)); [INFO] [stdout] 215 + } [INFO] [stdout] 216 + } [INFO] [stdout] 217 + } [INFO] [stdout] 218 + } [INFO] [stdout] 219 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/collectors/hardware.rs:12:24 [INFO] [stdout] | [INFO] [stdout] 12 | || rayon::join(|| collect_cpu_info(), || collect_gpu_info()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `collect_cpu_info` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/collectors/hardware.rs:12:47 [INFO] [stdout] | [INFO] [stdout] 12 | || rayon::join(|| collect_cpu_info(), || collect_gpu_info()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `collect_gpu_info` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/collectors/hardware.rs:13:24 [INFO] [stdout] | [INFO] [stdout] 13 | || rayon::join(|| collect_memory_info(), || collect_disk_info()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `collect_memory_info` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/collectors/hardware.rs:13:50 [INFO] [stdout] | [INFO] [stdout] 13 | || rayon::join(|| collect_memory_info(), || collect_disk_info()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `collect_disk_info` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/collectors/packages.rs:49:8 [INFO] [stdout] | [INFO] [stdout] 49 | if !fs::metadata(flatpak_dir).is_ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `fs::metadata(flatpak_dir).is_err()` [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: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> src/collectors/packages.rs:186:9 [INFO] [stdout] | [INFO] [stdout] 186 | / for entry in entries { [INFO] [stdout] 187 | | if let Ok(entry) = entry { [INFO] [stdout] 188 | | let path = entry.path(); [INFO] [stdout] 189 | | if path.is_dir() { [INFO] [stdout] ... | [INFO] [stdout] 195 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/collectors/packages.rs:187:13 [INFO] [stdout] | [INFO] [stdout] 187 | / if let Ok(entry) = entry { [INFO] [stdout] 188 | | let path = entry.path(); [INFO] [stdout] 189 | | if path.is_dir() { [INFO] [stdout] 190 | | if let Ok(sub_entries) = fs::read_dir(&path) { [INFO] [stdout] ... | [INFO] [stdout] 194 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 186 ~ for entry in entries.flatten() { [INFO] [stdout] 187 + let path = entry.path(); [INFO] [stdout] 188 + if path.is_dir() { [INFO] [stdout] 189 + if let Ok(sub_entries) = fs::read_dir(&path) { [INFO] [stdout] 190 + count += sub_entries.count(); [INFO] [stdout] 191 + } [INFO] [stdout] 192 + } [INFO] [stdout] 193 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> src/collectors/hardware.rs:200:9 [INFO] [stdout] | [INFO] [stdout] 200 | / for entry in entries { [INFO] [stdout] 201 | | if let Ok(entry) = entry { [INFO] [stdout] 202 | | let path = entry.path(); [INFO] [stdout] 203 | | if let Some(name) = path.file_name().and_then(|n| n.to_str()) { [INFO] [stdout] ... | [INFO] [stdout] 221 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/collectors/hardware.rs:201:13 [INFO] [stdout] | [INFO] [stdout] 201 | / if let Ok(entry) = entry { [INFO] [stdout] 202 | | let path = entry.path(); [INFO] [stdout] 203 | | if let Some(name) = path.file_name().and_then(|n| n.to_str()) { [INFO] [stdout] 204 | | if name.starts_with("card") && !name.contains("-") { [INFO] [stdout] ... | [INFO] [stdout] 220 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] = note: `#[warn(clippy::manual_flatten)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 200 ~ for entry in entries.flatten() { [INFO] [stdout] 201 + let path = entry.path(); [INFO] [stdout] 202 + if let Some(name) = path.file_name().and_then(|n| n.to_str()) { [INFO] [stdout] 203 + if name.starts_with("card") && !name.contains("-") { [INFO] [stdout] 204 + // Read device name directly from sysfs [INFO] [stdout] 205 + if let Ok(device_name) = fs::read_to_string(path.join("device/name")) { [INFO] [stdout] 206 + let name = device_name.trim(); [INFO] [stdout] 207 + if !name.is_empty() { [INFO] [stdout] 208 + // Determine if integrated or discrete [INFO] [stdout] 209 + let gpu_type = if is_integrated_gpu(&path) { [INFO] [stdout] 210 + " [Integrated]" [INFO] [stdout] 211 + } else { [INFO] [stdout] 212 + " [Discrete]" [INFO] [stdout] 213 + }; [INFO] [stdout] 214 + gpus.push(format!("{}{}", name, gpu_type)); [INFO] [stdout] 215 + } [INFO] [stdout] 216 + } [INFO] [stdout] 217 + } [INFO] [stdout] 218 + } [INFO] [stdout] 219 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> src/collectors/sensors.rs:11:9 [INFO] [stdout] | [INFO] [stdout] 11 | / for entry in entries { [INFO] [stdout] 12 | | if let Ok(entry) = entry { [INFO] [stdout] 13 | | let name = entry.file_name(); [INFO] [stdout] 14 | | let name_str = name.to_string_lossy(); [INFO] [stdout] ... | [INFO] [stdout] 43 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/collectors/sensors.rs:12:13 [INFO] [stdout] | [INFO] [stdout] 12 | / if let Ok(entry) = entry { [INFO] [stdout] 13 | | let name = entry.file_name(); [INFO] [stdout] 14 | | let name_str = name.to_string_lossy(); [INFO] [stdout] ... | [INFO] [stdout] 42 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 11 ~ for entry in entries.flatten() { [INFO] [stdout] 12 + let name = entry.file_name(); [INFO] [stdout] 13 + let name_str = name.to_string_lossy(); [INFO] [stdout] 14 + [INFO] [stdout] 15 + // Look for BAT* entries (typical battery naming) [INFO] [stdout] 16 + if name_str.starts_with("BAT") { [INFO] [stdout] 17 + let battery_path = entry.path(); [INFO] [stdout] 18 + [INFO] [stdout] 19 + // Read capacity percentage [INFO] [stdout] 20 + let capacity_path = battery_path.join("capacity"); [INFO] [stdout] 21 + let status_path = battery_path.join("status"); [INFO] [stdout] 22 + [INFO] [stdout] 23 + if let (Ok(capacity), Ok(status)) = ( [INFO] [stdout] 24 + fs::read_to_string(&capacity_path), [INFO] [stdout] 25 + fs::read_to_string(&status_path), [INFO] [stdout] 26 + ) { [INFO] [stdout] 27 + let capacity = capacity.trim(); [INFO] [stdout] 28 + let status = status.trim(); [INFO] [stdout] 29 + [INFO] [stdout] 30 + let status_icon = match status { [INFO] [stdout] 31 ~ "Charging" => "⚡", [INFO] [stdout] 32 ~ "Discharging" => "🔋", [INFO] [stdout] 33 ~ "Full" => "🔋", [INFO] [stdout] 34 ~ "Not charging" => "🔌", [INFO] [stdout] 35 ~ _ => "🔋", [INFO] [stdout] 36 + }; [INFO] [stdout] 37 + [INFO] [stdout] 38 + return Ok(format!("{}% {}", capacity, status_icon)); [INFO] [stdout] 39 + } [INFO] [stdout] 40 + } [INFO] [stdout] 41 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/collectors/system.rs:12:9 [INFO] [stdout] | [INFO] [stdout] 12 | || get_os_age(), [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `get_os_age` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/collectors/system.rs:11:24 [INFO] [stdout] | [INFO] [stdout] 11 | || rayon::join(|| read_os_name(), || read_kernel_version()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `read_os_name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/collectors/system.rs:11:43 [INFO] [stdout] | [INFO] [stdout] 11 | || rayon::join(|| read_os_name(), || read_kernel_version()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `read_kernel_version` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/collectors/system.rs:45:21 [INFO] [stdout] | [INFO] [stdout] 45 | || detect_init_system(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `detect_init_system` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/collectors/system.rs:51:21 [INFO] [stdout] | [INFO] [stdout] 51 | || crate::collectors::desktop::detect_wm_or_de(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `crate::collectors::desktop::detect_wm_or_de` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/collectors/system.rs:54:29 [INFO] [stdout] | [INFO] [stdout] 54 | ... || get_editor(), [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `get_editor` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/collectors/system.rs:55:44 [INFO] [stdout] | [INFO] [stdout] 55 | ... || rayon::join(|| get_shell(), || get_terminal()), [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace the closure with the function itself: `get_shell` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/collectors/system.rs:55:60 [INFO] [stdout] | [INFO] [stdout] 55 | ... || rayon::join(|| get_shell(), || get_terminal()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `get_terminal` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/collectors/system.rs:295:5 [INFO] [stdout] | [INFO] [stdout] 295 | / std::env::var("SHELL") [INFO] [stdout] 296 | | .unwrap_or_else(|_| "Unknown".to_string()) [INFO] [stdout] 297 | | .split('/') [INFO] [stdout] 298 | | .last() [INFO] [stdout] | |_______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] = note: `#[warn(clippy::double_ended_iterator_last)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 298 - .last() [INFO] [stdout] 298 + .next_back() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> src/collectors/system.rs:351:9 [INFO] [stdout] | [INFO] [stdout] 351 | / for entry in entries { [INFO] [stdout] 352 | | if let Ok(entry) = entry { [INFO] [stdout] 353 | | let name = entry.file_name(); [INFO] [stdout] 354 | | let name_str = name.to_string_lossy(); [INFO] [stdout] ... | [INFO] [stdout] 383 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/collectors/system.rs:352:13 [INFO] [stdout] | [INFO] [stdout] 352 | / if let Ok(entry) = entry { [INFO] [stdout] 353 | | let name = entry.file_name(); [INFO] [stdout] 354 | | let name_str = name.to_string_lossy(); [INFO] [stdout] ... | [INFO] [stdout] 382 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 351 ~ for entry in entries.flatten() { [INFO] [stdout] 352 + let name = entry.file_name(); [INFO] [stdout] 353 + let name_str = name.to_string_lossy(); [INFO] [stdout] 354 + [INFO] [stdout] 355 + // Look for BAT* entries (typical battery naming) [INFO] [stdout] 356 + if name_str.starts_with("BAT") { [INFO] [stdout] 357 + let battery_path = entry.path(); [INFO] [stdout] 358 + [INFO] [stdout] 359 + // Read capacity percentage [INFO] [stdout] 360 + let capacity_path = battery_path.join("capacity"); [INFO] [stdout] 361 + let status_path = battery_path.join("status"); [INFO] [stdout] 362 + [INFO] [stdout] 363 + if let (Ok(capacity), Ok(status)) = ( [INFO] [stdout] 364 + fs::read_to_string(&capacity_path), [INFO] [stdout] 365 + fs::read_to_string(&status_path), [INFO] [stdout] 366 + ) { [INFO] [stdout] 367 + let capacity = capacity.trim(); [INFO] [stdout] 368 + let status = status.trim(); [INFO] [stdout] 369 + [INFO] [stdout] 370 + let status_icon = match status { [INFO] [stdout] 371 ~ "Charging" => "⚡", [INFO] [stdout] 372 ~ "Discharging" => "🔋", [INFO] [stdout] 373 ~ "Full" => "🔋", [INFO] [stdout] 374 ~ "Not charging" => "🔌", [INFO] [stdout] 375 ~ _ => "🔋", [INFO] [stdout] 376 + }; [INFO] [stdout] 377 + [INFO] [stdout] 378 + return Ok(format!("{}% {}", capacity, status_icon)); [INFO] [stdout] 379 + } [INFO] [stdout] 380 + } [INFO] [stdout] 381 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/collectors/packages.rs:49:8 [INFO] [stdout] | [INFO] [stdout] 49 | if !fs::metadata(flatpak_dir).is_ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `fs::metadata(flatpak_dir).is_err()` [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: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> src/collectors/packages.rs:186:9 [INFO] [stdout] | [INFO] [stdout] 186 | / for entry in entries { [INFO] [stdout] 187 | | if let Ok(entry) = entry { [INFO] [stdout] 188 | | let path = entry.path(); [INFO] [stdout] 189 | | if path.is_dir() { [INFO] [stdout] ... | [INFO] [stdout] 195 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/collectors/packages.rs:187:13 [INFO] [stdout] | [INFO] [stdout] 187 | / if let Ok(entry) = entry { [INFO] [stdout] 188 | | let path = entry.path(); [INFO] [stdout] 189 | | if path.is_dir() { [INFO] [stdout] 190 | | if let Ok(sub_entries) = fs::read_dir(&path) { [INFO] [stdout] ... | [INFO] [stdout] 194 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 186 ~ for entry in entries.flatten() { [INFO] [stdout] 187 + let path = entry.path(); [INFO] [stdout] 188 + if path.is_dir() { [INFO] [stdout] 189 + if let Ok(sub_entries) = fs::read_dir(&path) { [INFO] [stdout] 190 + count += sub_entries.count(); [INFO] [stdout] 191 + } [INFO] [stdout] 192 + } [INFO] [stdout] 193 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> src/collectors/sensors.rs:11:9 [INFO] [stdout] | [INFO] [stdout] 11 | / for entry in entries { [INFO] [stdout] 12 | | if let Ok(entry) = entry { [INFO] [stdout] 13 | | let name = entry.file_name(); [INFO] [stdout] 14 | | let name_str = name.to_string_lossy(); [INFO] [stdout] ... | [INFO] [stdout] 43 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/collectors/sensors.rs:12:13 [INFO] [stdout] | [INFO] [stdout] 12 | / if let Ok(entry) = entry { [INFO] [stdout] 13 | | let name = entry.file_name(); [INFO] [stdout] 14 | | let name_str = name.to_string_lossy(); [INFO] [stdout] ... | [INFO] [stdout] 42 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 11 ~ for entry in entries.flatten() { [INFO] [stdout] 12 + let name = entry.file_name(); [INFO] [stdout] 13 + let name_str = name.to_string_lossy(); [INFO] [stdout] 14 + [INFO] [stdout] 15 + // Look for BAT* entries (typical battery naming) [INFO] [stdout] 16 + if name_str.starts_with("BAT") { [INFO] [stdout] 17 + let battery_path = entry.path(); [INFO] [stdout] 18 + [INFO] [stdout] 19 + // Read capacity percentage [INFO] [stdout] 20 + let capacity_path = battery_path.join("capacity"); [INFO] [stdout] 21 + let status_path = battery_path.join("status"); [INFO] [stdout] 22 + [INFO] [stdout] 23 + if let (Ok(capacity), Ok(status)) = ( [INFO] [stdout] 24 + fs::read_to_string(&capacity_path), [INFO] [stdout] 25 + fs::read_to_string(&status_path), [INFO] [stdout] 26 + ) { [INFO] [stdout] 27 + let capacity = capacity.trim(); [INFO] [stdout] 28 + let status = status.trim(); [INFO] [stdout] 29 + [INFO] [stdout] 30 + let status_icon = match status { [INFO] [stdout] 31 ~ "Charging" => "⚡", [INFO] [stdout] 32 ~ "Discharging" => "🔋", [INFO] [stdout] 33 ~ "Full" => "🔋", [INFO] [stdout] 34 ~ "Not charging" => "🔌", [INFO] [stdout] 35 ~ _ => "🔋", [INFO] [stdout] 36 + }; [INFO] [stdout] 37 + [INFO] [stdout] 38 + return Ok(format!("{}% {}", capacity, status_icon)); [INFO] [stdout] 39 + } [INFO] [stdout] 40 + } [INFO] [stdout] 41 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/collectors/system.rs:12:9 [INFO] [stdout] | [INFO] [stdout] 12 | || get_os_age(), [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `get_os_age` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/collectors/system.rs:11:24 [INFO] [stdout] | [INFO] [stdout] 11 | || rayon::join(|| read_os_name(), || read_kernel_version()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `read_os_name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/collectors/system.rs:11:43 [INFO] [stdout] | [INFO] [stdout] 11 | || rayon::join(|| read_os_name(), || read_kernel_version()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `read_kernel_version` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/collectors/system.rs:45:21 [INFO] [stdout] | [INFO] [stdout] 45 | || detect_init_system(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `detect_init_system` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/collectors/system.rs:51:21 [INFO] [stdout] | [INFO] [stdout] 51 | || crate::collectors::desktop::detect_wm_or_de(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `crate::collectors::desktop::detect_wm_or_de` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/collectors/system.rs:54:29 [INFO] [stdout] | [INFO] [stdout] 54 | ... || get_editor(), [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `get_editor` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/collectors/system.rs:55:44 [INFO] [stdout] | [INFO] [stdout] 55 | ... || rayon::join(|| get_shell(), || get_terminal()), [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace the closure with the function itself: `get_shell` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/collectors/system.rs:55:60 [INFO] [stdout] | [INFO] [stdout] 55 | ... || rayon::join(|| get_shell(), || get_terminal()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `get_terminal` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/collectors/system.rs:295:5 [INFO] [stdout] | [INFO] [stdout] 295 | / std::env::var("SHELL") [INFO] [stdout] 296 | | .unwrap_or_else(|_| "Unknown".to_string()) [INFO] [stdout] 297 | | .split('/') [INFO] [stdout] 298 | | .last() [INFO] [stdout] | |_______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] = note: `#[warn(clippy::double_ended_iterator_last)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 298 - .last() [INFO] [stdout] 298 + .next_back() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> src/collectors/system.rs:351:9 [INFO] [stdout] | [INFO] [stdout] 351 | / for entry in entries { [INFO] [stdout] 352 | | if let Ok(entry) = entry { [INFO] [stdout] 353 | | let name = entry.file_name(); [INFO] [stdout] 354 | | let name_str = name.to_string_lossy(); [INFO] [stdout] ... | [INFO] [stdout] 383 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/collectors/system.rs:352:13 [INFO] [stdout] | [INFO] [stdout] 352 | / if let Ok(entry) = entry { [INFO] [stdout] 353 | | let name = entry.file_name(); [INFO] [stdout] 354 | | let name_str = name.to_string_lossy(); [INFO] [stdout] ... | [INFO] [stdout] 382 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 351 ~ for entry in entries.flatten() { [INFO] [stdout] 352 + let name = entry.file_name(); [INFO] [stdout] 353 + let name_str = name.to_string_lossy(); [INFO] [stdout] 354 + [INFO] [stdout] 355 + // Look for BAT* entries (typical battery naming) [INFO] [stdout] 356 + if name_str.starts_with("BAT") { [INFO] [stdout] 357 + let battery_path = entry.path(); [INFO] [stdout] 358 + [INFO] [stdout] 359 + // Read capacity percentage [INFO] [stdout] 360 + let capacity_path = battery_path.join("capacity"); [INFO] [stdout] 361 + let status_path = battery_path.join("status"); [INFO] [stdout] 362 + [INFO] [stdout] 363 + if let (Ok(capacity), Ok(status)) = ( [INFO] [stdout] 364 + fs::read_to_string(&capacity_path), [INFO] [stdout] 365 + fs::read_to_string(&status_path), [INFO] [stdout] 366 + ) { [INFO] [stdout] 367 + let capacity = capacity.trim(); [INFO] [stdout] 368 + let status = status.trim(); [INFO] [stdout] 369 + [INFO] [stdout] 370 + let status_icon = match status { [INFO] [stdout] 371 ~ "Charging" => "⚡", [INFO] [stdout] 372 ~ "Discharging" => "🔋", [INFO] [stdout] 373 ~ "Full" => "🔋", [INFO] [stdout] 374 ~ "Not charging" => "🔌", [INFO] [stdout] 375 ~ _ => "🔋", [INFO] [stdout] 376 + }; [INFO] [stdout] 377 + [INFO] [stdout] 378 + return Ok(format!("{}% {}", capacity, status_icon)); [INFO] [stdout] 379 + } [INFO] [stdout] 380 + } [INFO] [stdout] 381 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `filter_map()` will run forever if the iterator repeatedly produces an `Err` [INFO] [stdout] --> src/display.rs:106:26 [INFO] [stdout] | [INFO] [stdout] 106 | .filter_map(Result::ok) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `map_while(Result::ok)` [INFO] [stdout] | [INFO] [stdout] note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error [INFO] [stdout] --> src/display.rs:104:28 [INFO] [stdout] | [INFO] [stdout] 104 | return io::BufReader::new(file) [INFO] [stdout] | ____________________________^ [INFO] [stdout] 105 | | .lines() [INFO] [stdout] | |________________________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lines_filter_map_ok [INFO] [stdout] = note: `#[warn(clippy::lines_filter_map_ok)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `ascii_lines` [INFO] [stdout] --> src/display.rs:341:14 [INFO] [stdout] | [INFO] [stdout] 341 | for i in rendered_items.len()..ascii_lines.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 341 - for i in rendered_items.len()..ascii_lines.len() { [INFO] [stdout] 341 + for in ascii_lines.iter().skip(rendered_items.len()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `system_data [INFO] [stdout] .all_gpus.get(0)` [INFO] [stdout] --> src/display.rs:363:23 [INFO] [stdout] | [INFO] [stdout] 363 | "gpu1" => system_data [INFO] [stdout] | _______________________^ [INFO] [stdout] 364 | | .all_gpus [INFO] [stdout] 365 | | .get(0) [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 363 ~ "gpu1" => system_data [INFO] [stdout] 364 + .all_gpus.first() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/display.rs:478:5 [INFO] [stdout] | [INFO] [stdout] 478 | / pub fn render_image( [INFO] [stdout] 479 | | path: &str, [INFO] [stdout] 480 | | target_width: Option, [INFO] [stdout] 481 | | target_height: Option, [INFO] [stdout] ... | [INFO] [stdout] 486 | | output: &mut String, [INFO] [stdout] 487 | | ) -> Result { [INFO] [stdout] | |_________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] = note: `#[warn(clippy::too_many_arguments)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/main.rs:54:17 [INFO] [stdout] | [INFO] [stdout] 54 | || collectors::system::collect_os_info(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `collectors::system::collect_os_info` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/main.rs:55:17 [INFO] [stdout] | [INFO] [stdout] 55 | || collectors::hardware::collect_hardware_info(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `collectors::hardware::collect_hardware_info` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/main.rs:60:17 [INFO] [stdout] | [INFO] [stdout] 60 | || collectors::packages::collect_package_info(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `collectors::packages::collect_package_info` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/main.rs:63:25 [INFO] [stdout] | [INFO] [stdout] 63 | || collectors::system::collect_system_status(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `collectors::system::collect_system_status` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/main.rs:64:25 [INFO] [stdout] | [INFO] [stdout] 64 | || collectors::system::collect_user_info(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `collectors::system::collect_user_info` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `filter_map()` will run forever if the iterator repeatedly produces an `Err` [INFO] [stdout] --> src/display.rs:106:26 [INFO] [stdout] | [INFO] [stdout] 106 | .filter_map(Result::ok) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `map_while(Result::ok)` [INFO] [stdout] | [INFO] [stdout] note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error [INFO] [stdout] --> src/display.rs:104:28 [INFO] [stdout] | [INFO] [stdout] 104 | return io::BufReader::new(file) [INFO] [stdout] | ____________________________^ [INFO] [stdout] 105 | | .lines() [INFO] [stdout] | |________________________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lines_filter_map_ok [INFO] [stdout] = note: `#[warn(clippy::lines_filter_map_ok)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `ascii_lines` [INFO] [stdout] --> src/display.rs:341:14 [INFO] [stdout] | [INFO] [stdout] 341 | for i in rendered_items.len()..ascii_lines.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 341 - for i in rendered_items.len()..ascii_lines.len() { [INFO] [stdout] 341 + for in ascii_lines.iter().skip(rendered_items.len()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `system_data [INFO] [stdout] .all_gpus.get(0)` [INFO] [stdout] --> src/display.rs:363:23 [INFO] [stdout] | [INFO] [stdout] 363 | "gpu1" => system_data [INFO] [stdout] | _______________________^ [INFO] [stdout] 364 | | .all_gpus [INFO] [stdout] 365 | | .get(0) [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 363 ~ "gpu1" => system_data [INFO] [stdout] 364 + .all_gpus.first() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/display.rs:478:5 [INFO] [stdout] | [INFO] [stdout] 478 | / pub fn render_image( [INFO] [stdout] 479 | | path: &str, [INFO] [stdout] 480 | | target_width: Option, [INFO] [stdout] 481 | | target_height: Option, [INFO] [stdout] ... | [INFO] [stdout] 486 | | output: &mut String, [INFO] [stdout] 487 | | ) -> Result { [INFO] [stdout] | |_________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] = note: `#[warn(clippy::too_many_arguments)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/main.rs:54:17 [INFO] [stdout] | [INFO] [stdout] 54 | || collectors::system::collect_os_info(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `collectors::system::collect_os_info` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/main.rs:55:17 [INFO] [stdout] | [INFO] [stdout] 55 | || collectors::hardware::collect_hardware_info(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `collectors::hardware::collect_hardware_info` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/main.rs:60:17 [INFO] [stdout] | [INFO] [stdout] 60 | || collectors::packages::collect_package_info(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `collectors::packages::collect_package_info` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/main.rs:63:25 [INFO] [stdout] | [INFO] [stdout] 63 | || collectors::system::collect_system_status(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `collectors::system::collect_system_status` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/main.rs:64:25 [INFO] [stdout] | [INFO] [stdout] 64 | || collectors::system::collect_user_info(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `collectors::system::collect_user_info` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 13.88s [INFO] running `Command { std: "docker" "inspect" "3fb72c56169114b0d0357a6c794228f75054b28763d53f3a9d1e0b24fa131b53", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "3fb72c56169114b0d0357a6c794228f75054b28763d53f3a9d1e0b24fa131b53", kill_on_drop: false }` [INFO] [stdout] 3fb72c56169114b0d0357a6c794228f75054b28763d53f3a9d1e0b24fa131b53