diff options
author | Yuri Astrakhan <yuriastrakhan@gmail.com> | 2023-10-22 22:29:03 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-22 22:29:03 -0400 |
commit | 1e16456d5f7bedc9dfc1148991353011243831cf (patch) | |
tree | f8c9e93d6510f23c8131358439238a62e3704fdc /src/app/data_harvester | |
parent | 4174012b8f14cbf92536c103c924b280e7a53b58 (diff) |
chore: Minor cleanup - remove un-needed ident qualifiers (#1307)
Keep code a bit tidier and consistent (i.e. if an identifier already has a `use` entry above, why in some cases still prove a full path to it?)
Diffstat (limited to 'src/app/data_harvester')
-rw-r--r-- | src/app/data_harvester/cpu/sysinfo.rs | 4 | ||||
-rw-r--r-- | src/app/data_harvester/disks/unix/linux/partition.rs | 4 |
2 files changed, 3 insertions, 5 deletions
diff --git a/src/app/data_harvester/cpu/sysinfo.rs b/src/app/data_harvester/cpu/sysinfo.rs index d3f000a0..0d79e347 100644 --- a/src/app/data_harvester/cpu/sysinfo.rs +++ b/src/app/data_harvester/cpu/sysinfo.rs @@ -8,9 +8,7 @@ use sysinfo::{CpuExt, LoadAvg, System, SystemExt}; use super::{CpuData, CpuDataType, CpuHarvest}; use crate::app::data_harvester::cpu::LoadAvgHarvest; -pub fn get_cpu_data_list( - sys: &sysinfo::System, show_average_cpu: bool, -) -> crate::error::Result<CpuHarvest> { +pub fn get_cpu_data_list(sys: &System, show_average_cpu: bool) -> crate::error::Result<CpuHarvest> { let mut cpu_deque: VecDeque<_> = sys .cpus() .iter() diff --git a/src/app/data_harvester/disks/unix/linux/partition.rs b/src/app/data_harvester/disks/unix/linux/partition.rs index 0e215747..94cdf113 100644 --- a/src/app/data_harvester/disks/unix/linux/partition.rs +++ b/src/app/data_harvester/disks/unix/linux/partition.rs @@ -51,7 +51,7 @@ impl Partition { .into_string() .unwrap_or_else(|_| "Name Unavailable".to_string()) } else { - let mut combined_path = std::path::PathBuf::new(); + let mut combined_path = PathBuf::new(); combined_path.push(device); combined_path.pop(); // Pop the current file... combined_path.push(path); @@ -110,7 +110,7 @@ impl FromStr for Partition { let mut parts = line.splitn(5, ' '); let device = match parts.next() { - Some(device) if device == "none" => None, + Some("none") => None, Some(device) => Some(device.to_string()), None => { bail!("missing device"); |