Skip to content

Commit

Permalink
Remove unnecessary unsafe block in process_unix
Browse files Browse the repository at this point in the history
  • Loading branch information
LeSeulArtichaut committed Aug 24, 2021
1 parent f66e825 commit 22112e4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions library/std/src/sys/unix/process/process_unix.rs
Expand Up @@ -552,8 +552,7 @@ impl Process {
use crate::os::unix::io::FromRawFd;
use crate::sys_common::FromInner;
// Safety: If `pidfd` is nonnegative, we assume it's valid and otherwise unowned.
let pidfd = (pidfd >= 0)
.then(|| PidFd::from_inner(unsafe { sys::fd::FileDesc::from_raw_fd(pidfd) }));
let pidfd = (pidfd >= 0).then(|| PidFd::from_inner(sys::fd::FileDesc::from_raw_fd(pidfd)));
Process { pid, status: None, pidfd }
}

Expand Down

0 comments on commit 22112e4

Please sign in to comment.