Skip to content

Commit

Permalink
Clarify CpuInfo.get_field docs
Browse files Browse the repository at this point in the history
  • Loading branch information
eminence committed Oct 29, 2023
1 parent 71addc0 commit bc33001
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 bc33001

Please sign in to comment.