Skip to content

Commit 42bfbff

Browse files
committed
fix: clippy
1 parent e2d0ac4 commit 42bfbff

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

crates/libs/kill_tree/src/macos.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,16 @@ pub(crate) async fn get_process_info(process_id: ProcessId) -> Option<ProcessInf
3535
return None;
3636
}
3737
};
38+
let process_id_sign = match i32::try_from(process_id) {
39+
Ok(x) => x,
40+
Err(e) => {
41+
debug!(error = ?e, process_id, "failed to convert process id");
42+
return None;
43+
}
44+
};
3845
let result = unsafe {
3946
libproc::proc_pidinfo(
40-
process_id as i32,
47+
process_id_sign,
4148
proc_pidtbsdinfo_sign,
4249
0,
4350
std::ptr::addr_of_mut!(proc_bsdinfo).cast::<c_void>(),

0 commit comments

Comments
 (0)