Skip to content

Commit

Permalink
don't special-case the default of DiskRefreshKind.kind
Browse files Browse the repository at this point in the history
  • Loading branch information
dlowe committed Nov 26, 2024
1 parent 60e630b commit 4a62ae8
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions src/common/disk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -438,31 +438,21 @@ impl fmt::Display for DiskKind {
/// ```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::everything());
///
/// for disk in disks.list() {
/// assert_eq!(disk.total_space(), 0);
/// }
/// ```
#[derive(Clone, Copy, Debug)]
#[derive(Clone, Copy, Debug, Default)]
pub struct DiskRefreshKind {
kind: bool,
details: bool,
io_usage: bool,
}

impl Default for DiskRefreshKind {
fn default() -> Self {
Self {
kind: true,
details: false,
io_usage: false,
}
}
}

impl DiskRefreshKind {
/// Creates a new `DiskRefreshKind` with every refresh *except kind* set to false.
/// Creates a new `DiskRefreshKind` with every refresh set to false.
///
/// ```
/// use sysinfo::DiskRefreshKind;
Expand Down

0 comments on commit 4a62ae8

Please sign in to comment.