1
Fork 0
mirror of https://github.com/RGBCube/dix synced 2025-07-28 04:07:46 +00:00

src/main.rs: cleanup

This commit is contained in:
Bloxx12 2025-05-04 21:42:35 +02:00
parent 5b304cd7bb
commit 9cd4befc31
No known key found for this signature in database
2 changed files with 3 additions and 7 deletions

View file

@ -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 }

View file

@ -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::<u64>()
.parse::<i64>()
.ok()
})
.map(|size| size / 1024 / 1024)
.unwrap_or(0)
.map_or(0, |size| size / 1024 / 1024)
}