9951 clippy errors in the test suite (#10030)

automerge
This commit is contained in:
Kristofer Peterson
2020-05-15 17:35:43 +01:00
committed by GitHub
parent 1da1667920
commit 58ef02f02b
106 changed files with 713 additions and 827 deletions

View File

@@ -81,18 +81,15 @@ mod tests {
impl CpuStats {
fn update(&self) {
match self.sys.cpu_load_aggregate() {
Ok(cpu) => {
std::thread::sleep(Duration::from_millis(400));
let cpu_new = CpuStatsInner::from(cpu.done().unwrap());
*self.stats.write().unwrap() = cpu_new;
}
_ => (),
if let Ok(cpu) = self.sys.cpu_load_aggregate() {
std::thread::sleep(Duration::from_millis(400));
let cpu_new = CpuStatsInner::from(cpu.done().unwrap());
*self.stats.write().unwrap() = cpu_new;
}
}
fn get_stats(&self) -> CpuStatsInner {
self.stats.read().unwrap().clone()
*self.stats.read().unwrap()
}
}
@@ -118,7 +115,7 @@ mod tests {
.unwrap();
Self {
cpu_stats: cpu_stats.clone(),
cpu_stats,
t_cleanup,
}
}