Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve documentation #1160

Merged
merged 1 commit into from
Nov 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ impl Default for System {
impl System {
/// Creates a new [`System`] instance with nothing loaded.
///
/// Use the [`refresh_all`] method to update its internal information (or any of the `refresh_`
/// method).
/// Use one of the refresh methods (like [`refresh_all`]) to update its internal information.
///
/// [`System`]: crate::System
/// [`refresh_all`]: #method.refresh_all
Expand Down Expand Up @@ -119,7 +118,10 @@ impl System {

/// Refreshes all system and processes information.
///
/// It is the equivalent of usin `system.refresh_specifics(RefreshKind::everything())`.
/// It is the same as calling `system.refresh_specifics(RefreshKind::everything())`.
///
/// Don't forget to take a look at [`ProcessRefreshKind::everything`] method to see what it
/// will update for processes more in details.
///
/// ```no_run
/// use sysinfo::System;
Expand Down Expand Up @@ -151,7 +153,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
/// `refresh_cpu_specifics(CpuRefreshKind::new().with_cpu_usage())`.
/// `system.refresh_cpu_specifics(CpuRefreshKind::new().with_cpu_usage())`.
///
/// ```no_run
/// use sysinfo::System;
Expand All @@ -168,7 +170,7 @@ impl System {
/// Refreshes CPUs frequency information.
///
/// Calling this method is the same as calling
/// `refresh_cpu_specifics(CpuRefreshKind::new().with_frequency())`.
/// `system.refresh_cpu_specifics(CpuRefreshKind::new().with_frequency())`.
///
/// ```no_run
/// use sysinfo::System;
Expand All @@ -188,7 +190,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
/// `refresh_cpu_specifics(CpuRefreshKind::everything())`.
/// `system.refresh_cpu_specifics(CpuRefreshKind::everything())`.
///
/// ```no_run
/// use sysinfo::System;
Expand Down Expand Up @@ -1548,7 +1550,7 @@ impl ProcessRefreshKind {
}

/// Creates a new `ProcessRefreshKind` with every refresh set to `true` or
/// `UpdateKind::OnlyIfNotSet`.
/// [`UpdateKind::OnlyIfNotSet`].
///
/// ```
/// use sysinfo::{ProcessRefreshKind, UpdateKind};
Expand Down
Loading