From 9c86e253dd0c3da7360e2d4a35631ba7945850a8 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Sat, 5 Oct 2024 23:45:29 +0200 Subject: [PATCH 1/4] Fix new clippy lints --- src/unix/apple/system.rs | 4 ++-- src/unix/freebsd/utils.rs | 4 ++-- src/unix/linux/process.rs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/unix/apple/system.rs b/src/unix/apple/system.rs index 2d5014f8c..44406f623 100644 --- a/src/unix/apple/system.rs +++ b/src/unix/apple/system.rs @@ -89,9 +89,9 @@ pub(crate) struct SystemInner { pub(crate) struct Wrap<'a>(pub UnsafeCell<&'a mut HashMap>); #[cfg(all(target_os = "macos", not(feature = "apple-sandbox")))] -unsafe impl<'a> Send for Wrap<'a> {} +unsafe impl Send for Wrap<'_> {} #[cfg(all(target_os = "macos", not(feature = "apple-sandbox")))] -unsafe impl<'a> Sync for Wrap<'a> {} +unsafe impl Sync for Wrap<'_> {} fn boot_time() -> u64 { let mut boot_time = timeval { diff --git a/src/unix/freebsd/utils.rs b/src/unix/freebsd/utils.rs index 7e6d00bfc..6aa611f01 100644 --- a/src/unix/freebsd/utils.rs +++ b/src/unix/freebsd/utils.rs @@ -223,9 +223,9 @@ pub(crate) struct WrapMap<'a>( ); #[cfg(feature = "system")] -unsafe impl<'a> Send for WrapMap<'a> {} +unsafe impl Send for WrapMap<'_> {} #[cfg(feature = "system")] -unsafe impl<'a> Sync for WrapMap<'a> {} +unsafe impl Sync for WrapMap<'_> {} #[cfg(feature = "system")] #[repr(transparent)] diff --git a/src/unix/linux/process.rs b/src/unix/linux/process.rs index cd2a5d056..c7c2307be 100644 --- a/src/unix/linux/process.rs +++ b/src/unix/linux/process.rs @@ -351,8 +351,8 @@ impl<'a, T> Wrap<'a, T> { } #[allow(clippy::non_send_fields_in_send_ty)] -unsafe impl<'a, T> Send for Wrap<'a, T> {} -unsafe impl<'a, T> Sync for Wrap<'a, T> {} +unsafe impl Send for Wrap<'_, T> {} +unsafe impl Sync for Wrap<'_, T> {} #[inline(always)] fn compute_start_time_without_boot_time(parts: &Parts<'_>, info: &SystemInfo) -> u64 { From eb7f147b27ad46c4d01dac2ffb6bba0337da1432 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Sat, 5 Oct 2024 23:38:25 +0200 Subject: [PATCH 2/4] Update CHANGELOG for 0.32.0 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b6e60de54..898aeec6b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# 0.32.0 + + * Add new `Disk::is_read_only` API. + * Add new `remove_dead_processes` argument to `System::refresh_processes` and `System::refresh_processes_specifics`. + * macOS: Fix memory leak in disk refresh. + # 0.31.4 * macOS: Force memory cleanup in disk list retrieval. From 9f14cba660204703cdbed2c26e9433a597bada1d Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Sat, 5 Oct 2024 23:39:19 +0200 Subject: [PATCH 3/4] Update crate version to 0.32.0 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 2ca8c6dd2..249e90dab 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.31.4" +version = "0.32.0" authors = ["Guillaume Gomez "] description = "Library to get system information such as processes, CPUs, disks, components and networks" repository = "https://github.com/GuillaumeGomez/sysinfo" From 0c5ca6af60df2f1c659e26fed469f3e39b99710c Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Sat, 5 Oct 2024 23:41:32 +0200 Subject: [PATCH 4/4] Update migration guide for 0.32 --- migration_guide.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/migration_guide.md b/migration_guide.md index 65558816a..f9b09daa8 100644 --- a/migration_guide.md +++ b/migration_guide.md @@ -1,5 +1,13 @@ # Migration guide +## 0.31 to 0.32 + +### Major changes + +`System::refresh_process` and `System::refresh_process_specifics` methods now take +an extra `remove_dead_processes` argument. When set to `true`, dead processes will +be removed. + ## 0.30 to 0.31 With this update, the minimum supported Rust version goes up to 1.74.