Skip to content

Commit

Permalink
fix: 修复编译错误
Browse files Browse the repository at this point in the history
  • Loading branch information
Cnotech committed Aug 5, 2024
1 parent 2d6eeb9 commit 64e9c3f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/types/steps/kill.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions src/utils/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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()
}

Expand Down

0 comments on commit 64e9c3f

Please sign in to comment.