From 05d4e8215351e0f05f366d7f25aceb3dfe49dfdc Mon Sep 17 00:00:00 2001 From: ClementTsang Date: Sun, 15 Sep 2019 01:32:08 -0400 Subject: [skip travis] Changed rustfmt, formatting. --- src/app/data_collection/cpu.rs | 5 ++++- src/app/data_collection/disks.rs | 13 +++++++++++-- src/app/data_collection/processes.rs | 5 ++++- 3 files changed, 19 insertions(+), 4 deletions(-) (limited to 'src/app') diff --git a/src/app/data_collection/cpu.rs b/src/app/data_collection/cpu.rs index e2a00272..8a09ee17 100644 --- a/src/app/data_collection/cpu.rs +++ b/src/app/data_collection/cpu.rs @@ -24,5 +24,8 @@ pub fn get_cpu_data_list(sys : &System) -> Result { }) } - Ok(CPUPackage { cpu_vec, instant : Instant::now() }) + Ok(CPUPackage { + cpu_vec, + instant : Instant::now(), + }) } diff --git a/src/app/data_collection/disks.rs b/src/app/data_collection/disks.rs index 1700ddbb..4e532b8a 100644 --- a/src/app/data_collection/disks.rs +++ b/src/app/data_collection/disks.rs @@ -48,7 +48,10 @@ pub async fn get_io_usage_list(get_physical : bool) -> Result Result, heim::Error> { @@ -65,7 +68,13 @@ pub async fn get_disk_usage_list() -> Result, heim::Error> { used_space : usage.used().get::(), total_space : usage.total().get::(), mount_point : Box::from(partition.mount_point().to_str().unwrap_or("Name Unavailable")), - name : Box::from(partition.device().unwrap_or_else(|| std::ffi::OsStr::new("Name Unavailable")).to_str().unwrap_or("Name Unavailable")), + name : Box::from( + partition + .device() + .unwrap_or_else(|| std::ffi::OsStr::new("Name Unavailable")) + .to_str() + .unwrap_or("Name Unavailable"), + ), }); } } diff --git a/src/app/data_collection/processes.rs b/src/app/data_collection/processes.rs index 85ce5a61..3f8512e0 100644 --- a/src/app/data_collection/processes.rs +++ b/src/app/data_collection/processes.rs @@ -173,7 +173,10 @@ pub async fn get_sorted_processes_list(prev_idle : &mut f64, prev_non_idle : &mu if cfg!(target_os = "linux") { // Linux specific - this is a massive pain... ugh. - let ps_result = Command::new("ps").args(&["-axo", "pid:10,comm:50,%mem:5", "--noheader"]).output().expect("Failed to execute."); + let ps_result = Command::new("ps") + .args(&["-axo", "pid:10,comm:50,%mem:5", "--noheader"]) + .output() + .expect("Failed to execute."); let ps_stdout = String::from_utf8_lossy(&ps_result.stdout); let split_string = ps_stdout.split('\n'); let cpu_usage = vangelis_cpu_usage_calculation(prev_idle, prev_non_idle).unwrap(); // TODO: FIX THIS ERROR CHECKING -- cgit v1.2.3