diff options
| author | klensy <klensy@users.noreply.github.com> | 2024-02-22 14:01:13 +0300 |
|---|---|---|
| committer | klensy <klensy@users.noreply.github.com> | 2024-02-22 14:01:13 +0300 |
| commit | 0b44330c388e4d2a8d64e0f2c9e8c9270fe701dd (patch) | |
| tree | 8d65080c04f05eaff80c7509ca18afe0c1dfa808 /src/tools | |
| parent | bea5bebf3defc56e5e3446b4a95c685dbb885fd3 (diff) | |
| download | rust-0b44330c388e4d2a8d64e0f2c9e8c9270fe701dd.tar.gz rust-0b44330c388e4d2a8d64e0f2c9e8c9270fe701dd.zip | |
bump sysinfo
Diffstat (limited to 'src/tools')
| -rw-r--r-- | src/tools/opt-dist/Cargo.toml | 2 | ||||
| -rw-r--r-- | src/tools/opt-dist/src/utils/mod.rs | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/tools/opt-dist/Cargo.toml b/src/tools/opt-dist/Cargo.toml index eb6f889a6f3..5d46113fe8d 100644 --- a/src/tools/opt-dist/Cargo.toml +++ b/src/tools/opt-dist/Cargo.toml @@ -10,7 +10,7 @@ log = "0.4" anyhow = { version = "1", features = ["backtrace"] } humantime = "2" humansize = "2" -sysinfo = { version = "0.29", default-features = false } +sysinfo = { version = "0.30", default-features = false } fs_extra = "1" camino = "1" reqwest = { version = "0.11", features = ["blocking"] } diff --git a/src/tools/opt-dist/src/utils/mod.rs b/src/tools/opt-dist/src/utils/mod.rs index ca1292dd5b8..22b0483c071 100644 --- a/src/tools/opt-dist/src/utils/mod.rs +++ b/src/tools/opt-dist/src/utils/mod.rs @@ -1,4 +1,4 @@ -use sysinfo::{DiskExt, RefreshKind, System, SystemExt}; +use sysinfo::Disks; use crate::environment::Environment; use crate::timer::Timer; @@ -15,9 +15,9 @@ pub fn format_env_variables() -> String { } pub fn print_free_disk_space() -> anyhow::Result<()> { - let sys = System::new_with_specifics(RefreshKind::default().with_disks_list().with_disks()); - let available_space: u64 = sys.disks().iter().map(|d| d.available_space()).sum(); - let total_space: u64 = sys.disks().iter().map(|d| d.total_space()).sum(); + let disks = Disks::new_with_refreshed_list(); + let available_space: u64 = disks.list().iter().map(|d| d.available_space()).sum(); + let total_space: u64 = disks.list().iter().map(|d| d.total_space()).sum(); let used_space = total_space - available_space; log::info!( |
