diff options
author | ClementTsang <clementjhtsang@gmail.com> | 2019-09-15 01:32:08 -0400 |
---|---|---|
committer | ClementTsang <clementjhtsang@gmail.com> | 2019-09-15 01:32:08 -0400 |
commit | 05d4e8215351e0f05f366d7f25aceb3dfe49dfdc (patch) | |
tree | dd44e6fe1c3ff3dca97d523ca23a5408f74f7952 /src/app | |
parent | e593149ef91d5075179e2a56efdbe8518cfcf01d (diff) |
[skip travis] Changed rustfmt, formatting.
Diffstat (limited to 'src/app')
-rw-r--r-- | src/app/data_collection/cpu.rs | 5 | ||||
-rw-r--r-- | src/app/data_collection/disks.rs | 13 | ||||
-rw-r--r-- | src/app/data_collection/processes.rs | 5 |
3 files changed, 19 insertions, 4 deletions
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<CPUPackage, heim::Error> { }) } - 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<IOPackage, heim::E } } - Ok(IOPackage { io_list, instant : Instant::now() }) + Ok(IOPackage { + io_list, + instant : Instant::now(), + }) } pub async fn get_disk_usage_list() -> Result<Vec<DiskData>, heim::Error> { @@ -65,7 +68,13 @@ pub async fn get_disk_usage_list() -> Result<Vec<DiskData>, heim::Error> { used_space : usage.used().get::<heim_common::units::information::megabyte>(), total_space : usage.total().get::<heim_common::units::information::megabyte>(), 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 |