Skip to content

Commit 0e72f68

Browse files
committed
fix: clippy
1 parent 0cfd142 commit 0e72f68

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
@@ -20,14 +20,21 @@ pub(crate) async fn get_process_info(process_id: ProcessId) -> Option<ProcessInf
2020
return None;
2121
}
2222
};
23+
let proc_bsdinfo_size_sign = match i32::try_from(proc_bsdinfo_size) {
24+
Ok(x) => x,
25+
Err(e) => {
26+
debug!(error = ?e, "failed to convert size of proc_bsdinfo");
27+
return None;
28+
}
29+
};
2330
let mut proc_bsdinfo = unsafe { std::mem::zeroed::<libproc::proc_bsdinfo>() };
2431
let result = unsafe {
2532
libproc::proc_pidinfo(
2633
process_id as i32,
2734
libproc::PROC_PIDTBSDINFO as i32,
2835
0,
2936
&mut proc_bsdinfo as *mut _ as *mut c_void,
30-
proc_bsdinfo_size as i32,
37+
proc_bsdinfo_size_sign,
3138
)
3239
};
3340
if result <= 0 {

0 commit comments

Comments
 (0)