From 9fcdfc5d8a3f4310660891cf46fdb57c5586859e Mon Sep 17 00:00:00 2001 From: daladim Date: Fri, 25 Jun 2021 11:17:17 +0200 Subject: [PATCH] [minor] Clippy --- heim-cpu/src/sys/linux/freq.rs | 4 ++-- heim-disk/src/sys/linux/counters.rs | 6 +++--- heim-process/src/sys/unix/env.rs | 5 +---- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/heim-cpu/src/sys/linux/freq.rs b/heim-cpu/src/sys/linux/freq.rs index 9242dee3..7a9ed565 100644 --- a/heim-cpu/src/sys/linux/freq.rs +++ b/heim-cpu/src/sys/linux/freq.rs @@ -46,7 +46,7 @@ impl ops::Add for CpuFrequency { (None, None) => None, }; - CpuFrequency { current, max, min } + CpuFrequency { current, min, max } } } @@ -69,7 +69,7 @@ fn _frequencies() -> impl Iterator> { let max = max_freq(&path); let min = min_freq(&path); - Ok(CpuFrequency { current, max, min }) + Ok(CpuFrequency { current, min, max }) }) } diff --git a/heim-disk/src/sys/linux/counters.rs b/heim-disk/src/sys/linux/counters.rs index 42c66bea..1277e9a9 100644 --- a/heim-disk/src/sys/linux/counters.rs +++ b/heim-disk/src/sys/linux/counters.rs @@ -104,12 +104,12 @@ impl FromStr for IoCounters { Ok(IoCounters { name, read_count, - read_merged_count, - read_bytes, write_count, - write_merged_count, + read_bytes, write_bytes, busy_time, + read_merged_count, + write_merged_count, }) } } diff --git a/heim-process/src/sys/unix/env.rs b/heim-process/src/sys/unix/env.rs index b2464009..454a9ddd 100644 --- a/heim-process/src/sys/unix/env.rs +++ b/heim-process/src/sys/unix/env.rs @@ -93,10 +93,7 @@ impl<'e> Iterator for EnvironmentIter<'e> { type Item = (&'e OsStr, &'e OsStr); fn next(&mut self) -> Option { - match self.0.next() { - Some((k, v)) => Some((k.as_os_str(), v.as_os_str())), - None => None, - } + self.0.next().map(|(k, v)| (k.as_os_str(), v.as_os_str())) } fn size_hint(&self) -> (usize, Option) {