Bump sysinfo from 0.29 to 0.30 (#11484)

# Description
Bumps `sysinfo` to 0.30.

* Changelog
 https://github.com/GuillaumeGomez/sysinfo/blob/master/CHANGELOG.md#0304

# User-Facing Changes
N/A
This commit is contained in:
nibon7
2024-01-05 19:31:29 +08:00
committed by GitHub
parent ad95e4cc27
commit 7e26b4fcc2
8 changed files with 100 additions and 90 deletions

View File

@ -15,7 +15,7 @@ bench = false
[dependencies]
libc = "0.2"
log = "0.4"
sysinfo = "0.29"
sysinfo = "0.30"
[target.'cfg(target_family = "unix")'.dependencies]
nix = { version = "0.27", default-features = false, features = ["fs", "term", "process", "signal"] }

View File

@ -1,5 +1,3 @@
use sysinfo::SystemExt;
pub fn get_os_name() -> &'static str {
std::env::consts::OS
}
@ -13,8 +11,7 @@ pub fn get_os_family() -> &'static str {
}
pub fn get_kernel_version() -> String {
let sys = sysinfo::System::new();
match sys.kernel_version() {
match sysinfo::System::kernel_version() {
Some(v) => v,
None => "unknown".to_string(),
}