From 9cd4befc3187b6dd5e01e6402c1cd10c29262f18 Mon Sep 17 00:00:00 2001 From: Bloxx12 Date: Sun, 4 May 2025 21:42:35 +0200 Subject: [PATCH] src/main.rs: cleanup --- Cargo.toml | 3 --- src/main.rs | 7 +++---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 9b1a61b..b15b8bb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,6 +7,3 @@ edition = "2024" clap = { version = "4.5.37", features = ["derive"] } colored = "3.0.0" regex = "1.11.1" - -[workspace.lints.clippy] -pedantic = { level = "warn", priority = -1 } diff --git a/src/main.rs b/src/main.rs index 261f2b0..8202bdd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -217,7 +217,7 @@ fn check_nix_available() -> bool { nix_available.is_some() && nix_query_available.is_some() } -fn get_closure_size(path: &std::path::Path) -> u64 { +fn get_closure_size(path: &std::path::Path) -> i64 { Command::new("nix") .arg("path-info") .arg("--closure-size") @@ -229,9 +229,8 @@ fn get_closure_size(path: &std::path::Path) -> u64 { .ok()? .split_whitespace() .last()? - .parse::() + .parse::() .ok() }) - .map(|size| size / 1024 / 1024) - .unwrap_or(0) + .map_or(0, |size| size / 1024 / 1024) }