summaryrefslogtreecommitdiffstats
path: root/src/app
diff options
context:
space:
mode:
authorYuri Astrakhan <yuriastrakhan@gmail.com>2023-10-22 22:29:03 -0400
committerGitHub <noreply@github.com>2023-10-22 22:29:03 -0400
commit1e16456d5f7bedc9dfc1148991353011243831cf (patch)
treef8c9e93d6510f23c8131358439238a62e3704fdc /src/app
parent4174012b8f14cbf92536c103c924b280e7a53b58 (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')
-rw-r--r--src/app/data_harvester.rs2
-rw-r--r--src/app/data_harvester/cpu/sysinfo.rs4
-rw-r--r--src/app/data_harvester/disks/unix/linux/partition.rs4
-rw-r--r--src/app/query.rs2
4 files changed, 5 insertions, 7 deletions
diff --git a/src/app/data_harvester.rs b/src/app/data_harvester.rs
index 17ca95e4..e4571597 100644
--- a/src/app/data_harvester.rs
+++ b/src/app/data_harvester.rs
@@ -124,7 +124,7 @@ pub struct DataCollector {
battery_list: Option<Vec<Battery>>,
#[cfg(target_family = "unix")]
- user_table: self::processes::UserTable,
+ user_table: processes::UserTable,
}
impl DataCollector {
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");
diff --git a/src/app/query.rs b/src/app/query.rs
index b99fb0ec..713e7d62 100644
--- a/src/app/query.rs
+++ b/src/app/query.rs
@@ -717,7 +717,7 @@ impl Prefix {
let rhs: f64 = rhs.into();
match condition {
- QueryComparison::Equal => (lhs - rhs).abs() < std::f64::EPSILON,
+ QueryComparison::Equal => (lhs - rhs).abs() < f64::EPSILON,
QueryComparison::Less => lhs < rhs,
QueryComparison::Greater => lhs > rhs,
QueryComparison::LessOrEqual => lhs <= rhs,