diff --git a/src/types/steps/kill.rs b/src/types/steps/kill.rs index 8ebb625c..751ce19d 100644 --- a/src/types/steps/kill.rs +++ b/src/types/steps/kill.rs @@ -27,7 +27,7 @@ fn kill(target: &String) -> Result<()> { let s = System::new_all(); let mut count_suc = 0; let mut count_fail = 0; - for process in s.processes_by_exact_name(target) { + for process in s.processes_by_exact_name(target.as_ref()) { if process.kill() { count_suc += 1; } else { diff --git a/src/utils/process.rs b/src/utils/process.rs index c45b8fe6..236f3b1f 100644 --- a/src/utils/process.rs +++ b/src/utils/process.rs @@ -3,7 +3,7 @@ use sysinfo::System; pub fn kill_with_name(name: &str) -> bool { let s = System::new_all(); let mut res = true; - for process in s.processes_by_exact_name(name) { + for process in s.processes_by_exact_name(name.as_ref()) { if !process.kill() { res = false; } @@ -13,7 +13,7 @@ pub fn kill_with_name(name: &str) -> bool { pub fn is_alive_with_name(name: &str) -> bool { let s = System::new_all(); - let mut processes = s.processes_by_exact_name(name); + let mut processes = s.processes_by_exact_name(name.as_ref()); processes.next().is_some() }