From 4c6161774e35bbadf4b3a81e22aaa2e17fabd44d Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Tue, 2 Apr 2024 16:58:58 +0200 Subject: [PATCH 1/4] Remove usage of too recent feature --- src/unix/apple/cpu.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/unix/apple/cpu.rs b/src/unix/apple/cpu.rs index 023e0b67d..2c39286e7 100644 --- a/src/unix/apple/cpu.rs +++ b/src/unix/apple/cpu.rs @@ -38,7 +38,8 @@ impl CpusWrapper { pub(crate) fn refresh(&mut self, refresh_kind: CpuRefreshKind, port: mach_port_t) { let need_cpu_usage_update = self .last_update - .is_some_and(|last_update| last_update.elapsed() > crate::MINIMUM_CPU_UPDATE_INTERVAL); + .map(|last_update| last_update.elapsed() > crate::MINIMUM_CPU_UPDATE_INTERVAL) + .unwrap_or(false); let cpus = &mut self.cpus; if cpus.is_empty() { From 814facc9c9591c1bdaf5346611693b57a605ece3 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Tue, 2 Apr 2024 17:01:01 +0200 Subject: [PATCH 2/4] Ignore new clippy lint --- src/unix/apple/macos/process.rs | 2 ++ src/unix/freebsd/system.rs | 1 + src/unix/linux/cpu.rs | 1 + 3 files changed, 4 insertions(+) diff --git a/src/unix/apple/macos/process.rs b/src/unix/apple/macos/process.rs index 1ea19186b..4e235ffc6 100644 --- a/src/unix/apple/macos/process.rs +++ b/src/unix/apple/macos/process.rs @@ -1,5 +1,7 @@ // Take a look at the license at the top of the repository in the LICENSE file. +#![allow(clippy::assigning_clones)] + use std::mem::{self, MaybeUninit}; use std::path::{Path, PathBuf}; diff --git a/src/unix/freebsd/system.rs b/src/unix/freebsd/system.rs index 8b8d66e9a..31f632c6b 100644 --- a/src/unix/freebsd/system.rs +++ b/src/unix/freebsd/system.rs @@ -362,6 +362,7 @@ impl SystemInner { } } +#[allow(clippy::assigning_clones)] unsafe fn add_missing_proc_info( system_info: &mut SystemInfo, kproc: &libc::kinfo_proc, diff --git a/src/unix/linux/cpu.rs b/src/unix/linux/cpu.rs index 618b49273..e1ca97be1 100644 --- a/src/unix/linux/cpu.rs +++ b/src/unix/linux/cpu.rs @@ -67,6 +67,7 @@ impl CpusWrapper { } } + #[allow(clippy::assigning_clones)] pub(crate) fn refresh(&mut self, only_update_global_cpu: bool, refresh_kind: CpuRefreshKind) { let need_cpu_usage_update = self .last_update From 407955351f9c1db7330e0b5a2782d2c1d4598211 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Tue, 2 Apr 2024 16:55:30 +0200 Subject: [PATCH 3/4] Update CHANGELOG for 0.30.8 --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e175a078f..2bd5b5fb0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# 0.30.8 + + * Linux: Fix missing parallelization. + * Linux: Add `cargo` feature flag `linux-tmpfs` to list `tmpfs` mounts. + * macOS: Fix CPU usage returning `NaN`. + * `Components::refresh` is now parallelized. + # 0.30.7 * Linux: Fix cgroup memory computation. From 23d07beea014fb81c48c357e7988c2dd67f35851 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Tue, 2 Apr 2024 16:55:39 +0200 Subject: [PATCH 4/4] Update crate version to 0.30.8 --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9209bbce8..e1e2dbc86 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -201,7 +201,7 @@ dependencies = [ [[package]] name = "sysinfo" -version = "0.30.7" +version = "0.30.8" dependencies = [ "cfg-if", "core-foundation-sys", diff --git a/Cargo.toml b/Cargo.toml index cc5b0e3e3..8c3ba6f57 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.30.7" +version = "0.30.8" authors = ["Guillaume Gomez "] description = "Library to get system information such as processes, CPUs, disks, components and networks" repository = "https://github.com/GuillaumeGomez/sysinfo"