From 9b2ef6c1c0c3d63fb3d3ceabacfe8045ae3ebe7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Maita?= <47983254+mnmaita@users.noreply.github.com> Date: Tue, 17 Dec 2024 06:06:50 +0100 Subject: [PATCH] Update sysinfo requirement from 0.32.0 to 0.33.0 (#16851) # Objective - Fixes #16722 ## Solution - Replaced renamed methods to migrate `sysinfo` properly to 0.33.0. ## Testing - CI checks are passing now. --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Alice Cecile --- crates/bevy_diagnostic/Cargo.toml | 4 ++-- .../src/system_information_diagnostics_plugin.rs | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/crates/bevy_diagnostic/Cargo.toml b/crates/bevy_diagnostic/Cargo.toml index cc9d7f1019..ac16a7567b 100644 --- a/crates/bevy_diagnostic/Cargo.toml +++ b/crates/bevy_diagnostic/Cargo.toml @@ -27,14 +27,14 @@ const-fnv1a-hash = "1.1.0" # macOS [target.'cfg(all(target_os="macos"))'.dependencies] # Some features of sysinfo are not supported by apple. This will disable those features on apple devices -sysinfo = { version = "0.32.0", optional = true, default-features = false, features = [ +sysinfo = { version = "0.33.0", optional = true, default-features = false, features = [ "apple-app-store", "system", ] } # Only include when on linux/windows/android/freebsd [target.'cfg(any(target_os = "linux", target_os = "windows", target_os = "android", target_os = "freebsd"))'.dependencies] -sysinfo = { version = "0.32.0", optional = true, default-features = false, features = [ +sysinfo = { version = "0.33.0", optional = true, default-features = false, features = [ "system", ] } diff --git a/crates/bevy_diagnostic/src/system_information_diagnostics_plugin.rs b/crates/bevy_diagnostic/src/system_information_diagnostics_plugin.rs index 975d0f04b7..44e4d4698b 100644 --- a/crates/bevy_diagnostic/src/system_information_diagnostics_plugin.rs +++ b/crates/bevy_diagnostic/src/system_information_diagnostics_plugin.rs @@ -108,8 +108,8 @@ pub mod internal { ) { let sysinfo = sysinfo.get_or_insert_with(|| { Arc::new(Mutex::new(System::new_with_specifics( - RefreshKind::new() - .with_cpu(CpuRefreshKind::new().with_cpu_usage()) + RefreshKind::nothing() + .with_cpu(CpuRefreshKind::nothing().with_cpu_usage()) .with_memory(MemoryRefreshKind::everything()), ))) }); @@ -129,7 +129,7 @@ pub mod internal { let task = thread_pool.spawn(async move { let mut sys = sys.lock().unwrap(); - sys.refresh_cpu_specifics(CpuRefreshKind::new().with_cpu_usage()); + sys.refresh_cpu_specifics(CpuRefreshKind::nothing().with_cpu_usage()); sys.refresh_memory(); let current_cpu_usage = sys.global_cpu_usage().into(); // `memory()` fns return a value in bytes @@ -166,9 +166,9 @@ pub mod internal { impl Default for SystemInfo { fn default() -> Self { let sys = System::new_with_specifics( - RefreshKind::new() - .with_cpu(CpuRefreshKind::new()) - .with_memory(MemoryRefreshKind::new().with_ram()), + RefreshKind::nothing() + .with_cpu(CpuRefreshKind::nothing()) + .with_memory(MemoryRefreshKind::nothing().with_ram()), ); let system_info = SystemInfo {