Skip to content

Commit 22112e4

Browse files
Remove unnecessary unsafe block in process_unix
1 parent f66e825 commit 22112e4

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

library/std/src/sys/unix/process/process_unix.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -552,8 +552,7 @@ impl Process {
552552
use crate::os::unix::io::FromRawFd;
553553
use crate::sys_common::FromInner;
554554
// Safety: If `pidfd` is nonnegative, we assume it's valid and otherwise unowned.
555-
let pidfd = (pidfd >= 0)
556-
.then(|| PidFd::from_inner(unsafe { sys::fd::FileDesc::from_raw_fd(pidfd) }));
555+
let pidfd = (pidfd >= 0).then(|| PidFd::from_inner(sys::fd::FileDesc::from_raw_fd(pidfd)));
557556
Process { pid, status: None, pidfd }
558557
}
559558

0 commit comments

Comments
 (0)