summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorClement Tsang <34804052+ClementTsang@users.noreply.github.com>2021-05-08 19:55:01 -0400
committerGitHub <noreply@github.com>2021-05-08 19:55:01 -0400
commite367a37b1a9e5fa08fd2624c52f8abf5e46ade6c (patch)
tree0401aae6fe706bb4eb9e4faf640c9ae3ac8f3ff2 /src
parent5e56c3bc0b7a40ce32cf45c1d2d911c7bdd96b1e (diff)
deps: Update dependencies 2021-05-08 (#466)
Did not update crossterm (and tui-rs) since it seems to have resulted in a massive CPU usage increase. Also fix minor clippy error with a duplicated to_string call.
Diffstat (limited to 'src')
-rw-r--r--src/app/data_harvester/processes.rs11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/app/data_harvester/processes.rs b/src/app/data_harvester/processes.rs
index e2efea79..42c6ac58 100644
--- a/src/app/data_harvester/processes.rs
+++ b/src/app/data_harvester/processes.rs
@@ -233,10 +233,7 @@ fn read_path_contents(path: &Path) -> std::io::Result<String> {
fn get_linux_process_state(stat: &[&str]) -> (char, String) {
// The -2 offset is because of us cutting off name + pid, normally it's 2
if let Some(first_char) = stat[0].chars().collect::<Vec<char>>().first() {
- (
- *first_char,
- ProcessStatus::from(*first_char).to_string().to_string(),
- )
+ (*first_char, ProcessStatus::from(*first_char).to_string())
} else {
('?', String::default())
}
@@ -604,7 +601,7 @@ pub fn get_process_data(
write_bytes_per_sec: disk_usage.written_bytes,
total_read_bytes: disk_usage.total_read_bytes,
total_write_bytes: disk_usage.total_written_bytes,
- process_state: process_val.status().to_string().to_string(),
+ process_state: process_val.status().to_string(),
process_state_char: convert_process_status_to_char(process_val.status()),
uid: Some(process_val.uid),
gid: Some(process_val.gid),
@@ -628,7 +625,7 @@ pub fn get_process_data(
write_bytes_per_sec: disk_usage.written_bytes,
total_read_bytes: disk_usage.total_read_bytes,
total_write_bytes: disk_usage.total_written_bytes,
- process_state: process_val.status().to_string().to_string(),
+ process_state: process_val.status().to_string(),
process_state_char: convert_process_status_to_char(process_val.status()),
});
}
@@ -636,7 +633,7 @@ pub fn get_process_data(
#[cfg(target_os = "macos")]
{
- let unknown_state = ProcessStatus::Unknown(0).to_string().to_string();
+ let unknown_state = ProcessStatus::Unknown(0).to_string();
let cpu_usage_unknown_pids: Vec<i32> = process_vector
.iter()
.filter(|process| process.process_state == unknown_state)