Skip to content

Commit

Permalink
Merge pull request #291 from eminence/cpuinfo_docs
Browse files Browse the repository at this point in the history
Clarify CpuInfo.get_field docs
  • Loading branch information
eminence authored Nov 21, 2023
2 parents fa6e798 + bc33001 commit a00c3fc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion procfs-core/src/cpuinfo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,11 @@ impl CpuInfo {

/// Get the content of a specific field associated to a CPU
///
/// Returns None if the requested cpu index is not found.
/// If the field is not found in the set of CPU-specific fields, then
/// it is returned from the set of common fields.
///
/// Returns None if the requested cpu index is not found, or if the field
/// is not found.
pub fn get_field(&self, cpu_num: usize, field_name: &str) -> Option<&str> {
self.cpus.get(cpu_num).and_then(|cpu_fields| {
cpu_fields
Expand Down

0 comments on commit a00c3fc

Please sign in to comment.