Skip to content

Commit e2d0ac4

Browse files
committed
fix: clippy
1 parent 51ec382 commit e2d0ac4

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
@@ -28,10 +28,17 @@ pub(crate) async fn get_process_info(process_id: ProcessId) -> Option<ProcessInf
2828
}
2929
};
3030
let mut proc_bsdinfo = unsafe { std::mem::zeroed::<libproc::proc_bsdinfo>() };
31+
let proc_pidtbsdinfo_sign = match i32::try_from(libproc::PROC_PIDTBSDINFO) {
32+
Ok(x) => x,
33+
Err(e) => {
34+
debug!(error = ?e, "failed to convert PROC_PIDTBSDINFO");
35+
return None;
36+
}
37+
};
3138
let result = unsafe {
3239
libproc::proc_pidinfo(
3340
process_id as i32,
34-
libproc::PROC_PIDTBSDINFO as i32,
41+
proc_pidtbsdinfo_sign,
3542
0,
3643
std::ptr::addr_of_mut!(proc_bsdinfo).cast::<c_void>(),
3744
proc_bsdinfo_size_sign,

0 commit comments

Comments
 (0)