diff --git a/src/common/disk.rs b/src/common/disk.rs index cf570e3e7..04986f86b 100644 --- a/src/common/disk.rs +++ b/src/common/disk.rs @@ -157,7 +157,7 @@ impl Disk { /// /// let mut disks = Disks::new_with_refreshed_list(); /// for disk in disks.list_mut() { - /// disk.refresh_specifics(DiskRefreshKind::new()); + /// disk.refresh_specifics(DiskRefreshKind::nothing()); /// } /// ``` pub fn refresh_specifics(&mut self, refreshes: DiskRefreshKind) -> bool { @@ -283,7 +283,7 @@ impl Disks { /// ```no_run /// use sysinfo::{Disks, DiskRefreshKind}; /// - /// let mut disks = Disks::new_with_refreshed_list_specifics(DiskRefreshKind::new()); + /// let mut disks = Disks::new_with_refreshed_list_specifics(DiskRefreshKind::nothing()); /// for disk in disks.list() { /// println!("{disk:?}"); /// } @@ -380,7 +380,7 @@ impl Disks { /// use sysinfo::{Disks, DiskRefreshKind}; /// /// let mut disks = Disks::new(); - /// disks.refresh_list_specifics(true, DiskRefreshKind::new()); + /// disks.refresh_list_specifics(true, DiskRefreshKind::nothing()); /// ``` pub fn refresh_list_specifics( &mut self, @@ -466,13 +466,13 @@ impl DiskRefreshKind { /// ``` /// use sysinfo::DiskRefreshKind; /// - /// let r = DiskRefreshKind::new(); + /// let r = DiskRefreshKind::nothing(); /// /// assert_eq!(r.kind(), false); /// assert_eq!(r.storage(), false); /// assert_eq!(r.io_usage(), false); /// ``` - pub fn new() -> Self { + pub fn nothing() -> Self { Self::default() } diff --git a/src/common/impl_get_set.rs b/src/common/impl_get_set.rs index 2df3616db..2743c7ba0 100644 --- a/src/common/impl_get_set.rs +++ b/src/common/impl_get_set.rs @@ -10,7 +10,7 @@ macro_rules! impl_get_set { ``` use sysinfo::", stringify!($ty_name), "; -let r = ", stringify!($ty_name), "::new(); +let r = ", stringify!($ty_name), "::nothing(); let r = r.with_", stringify!($name), "(); assert_eq!(r.", stringify!($name), "(), true); @@ -27,7 +27,7 @@ assert_eq!(r.", stringify!($name), "(), false); ``` use sysinfo::", stringify!($ty_name), "; -let r = ", stringify!($ty_name), "::new(); +let r = ", stringify!($ty_name), "::nothing(); let r = r.with_", stringify!($name), "(); assert_eq!(r.", stringify!($name), "(), true); @@ -66,7 +66,7 @@ assert_eq!(r.", stringify!($name), "(), false); ``` use sysinfo::{", stringify!($ty_name), ", UpdateKind}; -let r = ", stringify!($ty_name), "::new(); +let r = ", stringify!($ty_name), "::nothing(); assert_eq!(r.", stringify!($name), "(), UpdateKind::Never); let r = r.with_", stringify!($name), "(UpdateKind::OnlyIfNotSet); @@ -84,7 +84,7 @@ assert_eq!(r.", stringify!($name), "(), UpdateKind::Never); ``` use sysinfo::{", stringify!($ty_name), ", UpdateKind}; -let r = ", stringify!($ty_name), "::new(); +let r = ", stringify!($ty_name), "::nothing(); assert_eq!(r.", stringify!($name), "(), UpdateKind::Never); let r = r.with_", stringify!($name), "(UpdateKind::OnlyIfNotSet); @@ -121,7 +121,7 @@ assert_eq!(r.", stringify!($name), "(), UpdateKind::Never); ``` use sysinfo::{", stringify!($ty_name), ", ", stringify!($typ), "}; -let r = ", stringify!($ty_name), "::new(); +let r = ", stringify!($ty_name), "::nothing(); assert_eq!(r.", stringify!($name), "().is_some(), false); let r = r.with_", stringify!($name), "(", stringify!($typ), "::everything()); @@ -139,7 +139,7 @@ assert_eq!(r.", stringify!($name), "().is_some(), false); ``` use sysinfo::{", stringify!($ty_name), ", ", stringify!($typ), "}; -let r = ", stringify!($ty_name), "::new(); +let r = ", stringify!($ty_name), "::nothing(); assert_eq!(r.", stringify!($name), "().is_some(), false); let r = r.with_", stringify!($name), "(", stringify!($typ), "::everything()); diff --git a/src/common/system.rs b/src/common/system.rs index 73fd41078..450357f58 100644 --- a/src/common/system.rs +++ b/src/common/system.rs @@ -45,7 +45,7 @@ impl System { /// let s = System::new(); /// ``` pub fn new() -> Self { - Self::new_with_specifics(RefreshKind::new()) + Self::new_with_specifics(RefreshKind::nothing()) } /// Creates a new [`System`] instance with everything loaded. @@ -73,7 +73,7 @@ impl System { /// /// // We want to only refresh processes. /// let mut system = System::new_with_specifics( - /// RefreshKind::new().with_processes(ProcessRefreshKind::everything()), + /// RefreshKind::nothing().with_processes(ProcessRefreshKind::everything()), /// ); /// /// # if sysinfo::IS_SUPPORTED_SYSTEM && !cfg!(feature = "apple-sandbox") { @@ -98,7 +98,7 @@ impl System { /// /// // Let's just update processes: /// s.refresh_specifics( - /// RefreshKind::new().with_processes(ProcessRefreshKind::everything()), + /// RefreshKind::nothing().with_processes(ProcessRefreshKind::everything()), /// ); /// ``` pub fn refresh_specifics(&mut self, refreshes: RefreshKind) { @@ -152,7 +152,7 @@ impl System { /// use sysinfo::{MemoryRefreshKind, System}; /// /// let mut s = System::new(); - /// s.refresh_memory_specifics(MemoryRefreshKind::new().with_ram()); + /// s.refresh_memory_specifics(MemoryRefreshKind::nothing().with_ram()); /// ``` pub fn refresh_memory_specifics(&mut self, refresh_kind: MemoryRefreshKind) { self.inner.refresh_memory_specifics(refresh_kind) @@ -166,7 +166,7 @@ impl System { /// to get accurate value as it uses previous results to compute the next value. /// /// Calling this method is the same as calling - /// `system.refresh_cpu_specifics(CpuRefreshKind::new().with_cpu_usage())`. + /// `system.refresh_cpu_specifics(CpuRefreshKind::nothing().with_cpu_usage())`. /// /// ```no_run /// use sysinfo::System; @@ -180,13 +180,13 @@ impl System { /// /// [`MINIMUM_CPU_UPDATE_INTERVAL`]: crate::MINIMUM_CPU_UPDATE_INTERVAL pub fn refresh_cpu_usage(&mut self) { - self.refresh_cpu_specifics(CpuRefreshKind::new().with_cpu_usage()) + self.refresh_cpu_specifics(CpuRefreshKind::nothing().with_cpu_usage()) } /// Refreshes CPUs frequency information. /// /// Calling this method is the same as calling - /// `system.refresh_cpu_specifics(CpuRefreshKind::new().with_frequency())`. + /// `system.refresh_cpu_specifics(CpuRefreshKind::nothing().with_frequency())`. /// /// ```no_run /// use sysinfo::System; @@ -195,7 +195,7 @@ impl System { /// s.refresh_cpu_frequency(); /// ``` pub fn refresh_cpu_frequency(&mut self) { - self.refresh_cpu_specifics(CpuRefreshKind::new().with_frequency()) + self.refresh_cpu_specifics(CpuRefreshKind::nothing().with_frequency()) } /// Refreshes the list of CPU. @@ -265,7 +265,7 @@ impl System { /// system.refresh_processes_specifics( /// ProcessesToUpdate::All, /// true, - /// ProcessRefreshKind::new() + /// ProcessRefreshKind::nothing() /// .with_memory() /// .with_cpu() /// .with_disk_usage() @@ -296,7 +296,7 @@ impl System { self.refresh_processes_specifics( processes_to_update, remove_dead_processes, - ProcessRefreshKind::new() + ProcessRefreshKind::nothing() .with_memory() .with_cpu() .with_disk_usage() @@ -469,7 +469,7 @@ impl System { /// use sysinfo::{CpuRefreshKind, RefreshKind, System}; /// /// let mut s = System::new_with_specifics( - /// RefreshKind::new().with_cpu(CpuRefreshKind::everything()), + /// RefreshKind::nothing().with_cpu(CpuRefreshKind::everything()), /// ); /// // Wait a bit because CPU usage is based on diff. /// std::thread::sleep(sysinfo::MINIMUM_CPU_UPDATE_INTERVAL); @@ -490,7 +490,7 @@ impl System { /// use sysinfo::{CpuRefreshKind, RefreshKind, System}; /// /// let mut s = System::new_with_specifics( - /// RefreshKind::new().with_cpu(CpuRefreshKind::everything()), + /// RefreshKind::nothing().with_cpu(CpuRefreshKind::everything()), /// ); /// // Wait a bit because CPU usage is based on diff. /// std::thread::sleep(sysinfo::MINIMUM_CPU_UPDATE_INTERVAL); @@ -1393,7 +1393,7 @@ impl Process { /// s.refresh_processes_specifics( /// ProcessesToUpdate::All, /// true, - /// ProcessRefreshKind::new().with_cpu() + /// ProcessRefreshKind::nothing().with_cpu() /// ); /// if let Some(process) = s.process(Pid::from(1337)) { /// println!("{}%", process.cpu_usage()); @@ -1699,7 +1699,7 @@ cfg_if! { /// system.refresh_processes_specifics( /// ProcessesToUpdate::All, /// true, -/// ProcessRefreshKind::new().with_exe(UpdateKind::OnlyIfNotSet), +/// ProcessRefreshKind::nothing().with_exe(UpdateKind::OnlyIfNotSet), /// ); /// ``` #[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] @@ -1803,12 +1803,12 @@ impl ProcessRefreshKind { /// ``` /// use sysinfo::{ProcessRefreshKind, UpdateKind}; /// - /// let r = ProcessRefreshKind::new(); + /// let r = ProcessRefreshKind::nothing(); /// /// assert_eq!(r.cpu(), false); /// assert_eq!(r.user(), UpdateKind::Never); /// ``` - pub fn new() -> Self { + pub fn nothing() -> Self { Self::default() } @@ -1910,12 +1910,12 @@ impl CpuRefreshKind { /// ``` /// use sysinfo::CpuRefreshKind; /// - /// let r = CpuRefreshKind::new(); + /// let r = CpuRefreshKind::nothing(); /// /// assert_eq!(r.frequency(), false); /// assert_eq!(r.cpu_usage(), false); /// ``` - pub fn new() -> Self { + pub fn nothing() -> Self { Self::default() } @@ -1952,7 +1952,7 @@ impl CpuRefreshKind { /// let mut system = System::new(); /// /// // We don't want to update all memories information. -/// system.refresh_memory_specifics(MemoryRefreshKind::new().with_ram()); +/// system.refresh_memory_specifics(MemoryRefreshKind::nothing().with_ram()); /// /// println!("total RAM: {}", system.total_memory()); /// println!("free RAM: {}", system.free_memory()); @@ -1969,12 +1969,12 @@ impl MemoryRefreshKind { /// ``` /// use sysinfo::MemoryRefreshKind; /// - /// let r = MemoryRefreshKind::new(); + /// let r = MemoryRefreshKind::nothing(); /// /// assert_eq!(r.ram(), false); /// assert_eq!(r.swap(), false); /// ``` - pub fn new() -> Self { + pub fn nothing() -> Self { Self::default() } @@ -2029,13 +2029,13 @@ impl RefreshKind { /// ``` /// use sysinfo::RefreshKind; /// - /// let r = RefreshKind::new(); + /// let r = RefreshKind::nothing(); /// /// assert_eq!(r.processes().is_some(), false); /// assert_eq!(r.memory().is_some(), false); /// assert_eq!(r.cpu().is_some(), false); /// ``` - pub fn new() -> Self { + pub fn nothing() -> Self { Self::default() } @@ -2129,7 +2129,7 @@ pub fn get_current_pid() -> Result { /// use sysinfo::{System, RefreshKind, CpuRefreshKind}; /// /// let mut s = System::new_with_specifics( -/// RefreshKind::new().with_cpu(CpuRefreshKind::everything()), +/// RefreshKind::nothing().with_cpu(CpuRefreshKind::everything()), /// ); /// /// // Wait a bit because CPU usage is based on diff. @@ -2155,7 +2155,7 @@ impl Cpu { /// use sysinfo::{System, RefreshKind, CpuRefreshKind}; /// /// let mut s = System::new_with_specifics( - /// RefreshKind::new().with_cpu(CpuRefreshKind::everything()), + /// RefreshKind::nothing().with_cpu(CpuRefreshKind::everything()), /// ); /// /// // Wait a bit because CPU usage is based on diff. @@ -2177,7 +2177,7 @@ impl Cpu { /// use sysinfo::{System, RefreshKind, CpuRefreshKind}; /// /// let s = System::new_with_specifics( - /// RefreshKind::new().with_cpu(CpuRefreshKind::everything()), + /// RefreshKind::nothing().with_cpu(CpuRefreshKind::everything()), /// ); /// for cpu in s.cpus() { /// println!("{}", cpu.name()); @@ -2193,7 +2193,7 @@ impl Cpu { /// use sysinfo::{System, RefreshKind, CpuRefreshKind}; /// /// let s = System::new_with_specifics( - /// RefreshKind::new().with_cpu(CpuRefreshKind::everything()), + /// RefreshKind::nothing().with_cpu(CpuRefreshKind::everything()), /// ); /// for cpu in s.cpus() { /// println!("{}", cpu.vendor_id()); @@ -2209,7 +2209,7 @@ impl Cpu { /// use sysinfo::{System, RefreshKind, CpuRefreshKind}; /// /// let s = System::new_with_specifics( - /// RefreshKind::new().with_cpu(CpuRefreshKind::everything()), + /// RefreshKind::nothing().with_cpu(CpuRefreshKind::everything()), /// ); /// for cpu in s.cpus() { /// println!("{}", cpu.brand()); @@ -2225,7 +2225,7 @@ impl Cpu { /// use sysinfo::{System, RefreshKind, CpuRefreshKind}; /// /// let s = System::new_with_specifics( - /// RefreshKind::new().with_cpu(CpuRefreshKind::everything()), + /// RefreshKind::nothing().with_cpu(CpuRefreshKind::everything()), /// ); /// for cpu in s.cpus() { /// println!("{}", cpu.frequency()); diff --git a/src/lib.rs b/src/lib.rs index c04c3be1a..35b6e01ee 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -305,10 +305,10 @@ mod test { #[cfg(feature = "system")] { // And now check that our `get_user_by_id` method works. - let s = System::new_with_specifics( - RefreshKind::new() - .with_processes(ProcessRefreshKind::new().with_user(UpdateKind::Always)), - ); + let s = + System::new_with_specifics(RefreshKind::nothing().with_processes( + ProcessRefreshKind::nothing().with_user(UpdateKind::Always), + )); assert!(s .processes() .iter() @@ -325,8 +325,8 @@ mod test { // If `getent` doesn't find them, we can assume it's a dark secret from the linux land. if IS_SUPPORTED_SYSTEM && cfg!(not(target_os = "linux")) { let s = System::new_with_specifics( - RefreshKind::new() - .with_processes(ProcessRefreshKind::new().with_user(UpdateKind::Always)), + RefreshKind::nothing() + .with_processes(ProcessRefreshKind::nothing().with_user(UpdateKind::Always)), ); let users = Users::new_with_refreshed_list(); diff --git a/src/unix/apple/cpu.rs b/src/unix/apple/cpu.rs index c366cba4d..419c37e34 100644 --- a/src/unix/apple/cpu.rs +++ b/src/unix/apple/cpu.rs @@ -426,7 +426,7 @@ mod test { let stdout = String::from_utf8(child.stdout).expect("Not valid UTF8"); let sys = System::new_with_specifics( - crate::RefreshKind::new().with_cpu(CpuRefreshKind::new().with_cpu_usage()), + crate::RefreshKind::nothing().with_cpu(CpuRefreshKind::nothing().with_cpu_usage()), ); let cpus = sys.cpus(); assert!(!cpus.is_empty(), "no CPU found"); diff --git a/src/unix/linux/system.rs b/src/unix/linux/system.rs index c696119c0..11fc77696 100644 --- a/src/unix/linux/system.rs +++ b/src/unix/linux/system.rs @@ -181,7 +181,7 @@ impl SystemInner { return; } self.cpus - .refresh_if_needed(true, CpuRefreshKind::new().with_cpu_usage()); + .refresh_if_needed(true, CpuRefreshKind::nothing().with_cpu_usage()); if self.cpus.is_empty() { sysinfo_debug!("cannot compute processes CPU usage: no CPU found..."); diff --git a/src/windows/cpu.rs b/src/windows/cpu.rs index 861c252c7..d9d46621c 100644 --- a/src/windows/cpu.rs +++ b/src/windows/cpu.rs @@ -285,7 +285,7 @@ impl CpusWrapper { } pub fn len(&mut self) -> usize { - self.init_if_needed(CpuRefreshKind::new()); + self.init_if_needed(CpuRefreshKind::nothing()); self.cpus.len() } diff --git a/tests/disk.rs b/tests/disk.rs index 0ec0f75da..94af64c2a 100644 --- a/tests/disk.rs +++ b/tests/disk.rs @@ -47,7 +47,7 @@ fn test_disk_refresh_kind() { .iter() .powerset() { - let mut refreshes = DiskRefreshKind::new(); + let mut refreshes = DiskRefreshKind::nothing(); for f in fs { refreshes = f(refreshes); } @@ -124,7 +124,7 @@ fn test_disk_refresh_kind() { assertions("full", &disks); // load with minimal `DiskRefreshKind`, then refresh for added detail should also work! - let mut disks = Disks::new_with_refreshed_list_specifics(DiskRefreshKind::new()); + let mut disks = Disks::new_with_refreshed_list_specifics(DiskRefreshKind::nothing()); disks.refresh_specifics(refreshes); assertions("incremental", &disks); } diff --git a/tests/process.rs b/tests/process.rs index 8aa2690e3..4b64c7af1 100644 --- a/tests/process.rs +++ b/tests/process.rs @@ -38,7 +38,7 @@ fn test_cwd() { s.refresh_processes_specifics( ProcessesToUpdate::All, false, - ProcessRefreshKind::new().with_cwd(UpdateKind::Always), + ProcessRefreshKind::nothing().with_cwd(UpdateKind::Always), ); p.kill().expect("Unable to kill process."); @@ -65,7 +65,7 @@ fn test_cmd() { s.refresh_processes_specifics( ProcessesToUpdate::All, false, - ProcessRefreshKind::new().with_cmd(UpdateKind::Always), + ProcessRefreshKind::nothing().with_cmd(UpdateKind::Always), ); p.kill().expect("Unable to kill process"); assert!(!s.processes().is_empty()); @@ -150,7 +150,7 @@ fn test_environ() { s.refresh_processes_specifics( ProcessesToUpdate::All, false, - ProcessRefreshKind::new().with_environ(UpdateKind::Always), + ProcessRefreshKind::nothing().with_environ(UpdateKind::Always), ); let processes = s.processes(); @@ -374,7 +374,7 @@ fn test_refresh_process_doesnt_remove() { // Checks that the process is listed as it should. let mut s = System::new_with_specifics( - RefreshKind::new().with_processes(sysinfo::ProcessRefreshKind::new()), + RefreshKind::nothing().with_processes(sysinfo::ProcessRefreshKind::nothing()), ); s.refresh_processes(ProcessesToUpdate::All, false); @@ -589,7 +589,7 @@ fn test_process_iterator_lifetimes() { } let s = System::new_with_specifics( - sysinfo::RefreshKind::new().with_processes(sysinfo::ProcessRefreshKind::new()), + sysinfo::RefreshKind::nothing().with_processes(sysinfo::ProcessRefreshKind::nothing()), ); let process: Option<&sysinfo::Process>; @@ -702,13 +702,13 @@ fn test_process_specific_refresh() { macro_rules! update_specific_and_check { (memory) => { - s.refresh_processes_specifics(ProcessesToUpdate::Some(&[pid]), false, ProcessRefreshKind::new()); + s.refresh_processes_specifics(ProcessesToUpdate::Some(&[pid]), false, ProcessRefreshKind::nothing()); { let p = s.process(pid).unwrap(); assert_eq!(p.memory(), 0, "failed 0 check for memory"); assert_eq!(p.virtual_memory(), 0, "failed 0 check for virtual memory"); } - s.refresh_processes_specifics(ProcessesToUpdate::Some(&[pid]), false, ProcessRefreshKind::new().with_memory()); + s.refresh_processes_specifics(ProcessesToUpdate::Some(&[pid]), false, ProcessRefreshKind::nothing().with_memory()); { let p = s.process(pid).unwrap(); assert_ne!(p.memory(), 0, "failed non-0 check for memory"); @@ -716,7 +716,7 @@ fn test_process_specific_refresh() { } // And now we check that re-refreshing nothing won't remove the // information. - s.refresh_processes_specifics(ProcessesToUpdate::Some(&[pid]), false, ProcessRefreshKind::new()); + s.refresh_processes_specifics(ProcessesToUpdate::Some(&[pid]), false, ProcessRefreshKind::nothing()); { let p = s.process(pid).unwrap(); assert_ne!(p.memory(), 0, "failed non-0 check (number 2) for memory"); @@ -724,7 +724,7 @@ fn test_process_specific_refresh() { } }; ($name:ident, $method:ident, $($extra:tt)+) => { - s.refresh_processes_specifics(ProcessesToUpdate::Some(&[pid]), false, ProcessRefreshKind::new()); + s.refresh_processes_specifics(ProcessesToUpdate::Some(&[pid]), false, ProcessRefreshKind::nothing()); { let p = s.process(pid).unwrap(); assert_eq!( @@ -732,7 +732,7 @@ fn test_process_specific_refresh() { concat!("failed 0 check check for ", stringify!($name)), ); } - s.refresh_processes_specifics(ProcessesToUpdate::Some(&[pid]), false, ProcessRefreshKind::new().$method(UpdateKind::Always)); + s.refresh_processes_specifics(ProcessesToUpdate::Some(&[pid]), false, ProcessRefreshKind::nothing().$method(UpdateKind::Always)); { let p = s.process(pid).unwrap(); assert_ne!( @@ -741,7 +741,7 @@ fn test_process_specific_refresh() { } // And now we check that re-refreshing nothing won't remove the // information. - s.refresh_processes_specifics(ProcessesToUpdate::Some(&[pid]), false, ProcessRefreshKind::new()); + s.refresh_processes_specifics(ProcessesToUpdate::Some(&[pid]), false, ProcessRefreshKind::nothing()); { let p = s.process(pid).unwrap(); assert_ne!( @@ -754,14 +754,14 @@ fn test_process_specific_refresh() { s.refresh_processes_specifics( ProcessesToUpdate::Some(&[pid]), false, - ProcessRefreshKind::new(), + ProcessRefreshKind::nothing(), ); check_empty(&s, pid); s.refresh_processes_specifics( ProcessesToUpdate::Some(&[pid]), false, - ProcessRefreshKind::new(), + ProcessRefreshKind::nothing(), ); check_empty(&s, pid); @@ -894,7 +894,7 @@ fn test_multiple_single_process_refresh() { let pid_b = Pid::from_u32(p_b.id() as _); let mut s = System::new(); - let process_refresh_kind = ProcessRefreshKind::new().with_cpu(); + let process_refresh_kind = ProcessRefreshKind::nothing().with_cpu(); s.refresh_processes_specifics( ProcessesToUpdate::Some(&[pid_a]), false, diff --git a/tests/system.rs b/tests/system.rs index dac837dca..ca7a342f2 100644 --- a/tests/system.rs +++ b/tests/system.rs @@ -143,7 +143,7 @@ fn test_consecutive_cpu_usage_update() { sys.refresh_processes_specifics( ProcessesToUpdate::All, true, - ProcessRefreshKind::new().with_cpu(), + ProcessRefreshKind::nothing().with_cpu(), ); let stop = Arc::new(AtomicBool::new(false)); @@ -176,7 +176,7 @@ fn test_consecutive_cpu_usage_update() { sys.refresh_processes_specifics( ProcessesToUpdate::Some(&[*pid]), true, - ProcessRefreshKind::new().with_cpu(), + ProcessRefreshKind::nothing().with_cpu(), ); } // To ensure that Linux doesn't give too high numbers. @@ -206,7 +206,7 @@ fn test_refresh_memory() { assert_eq!(s.total_memory(), 0); assert_eq!(s.free_memory(), 0); - s.refresh_memory_specifics(sysinfo::MemoryRefreshKind::new().with_ram()); + s.refresh_memory_specifics(sysinfo::MemoryRefreshKind::nothing().with_ram()); assert_ne!(s.total_memory(), 0); assert_ne!(s.free_memory(), 0); @@ -227,7 +227,7 @@ fn test_refresh_memory() { return; } - s.refresh_memory_specifics(sysinfo::MemoryRefreshKind::new().with_swap()); + s.refresh_memory_specifics(sysinfo::MemoryRefreshKind::nothing().with_swap()); // SWAP can be 0 on macOS so this test is disabled #[cfg(not(target_os = "macos"))] {