mirror of
https://github.com/RGBCube/dix
synced 2025-07-28 12:17:45 +00:00
src/main.rs: cleanup
This commit is contained in:
parent
5b304cd7bb
commit
9cd4befc31
2 changed files with 3 additions and 7 deletions
|
@ -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 }
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue