summaryrefslogtreecommitdiffstats
path: root/vendor/rustix/src/pid.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 05:48:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 05:48:48 +0000
commitef24de24a82fe681581cc130f342363c47c0969a (patch)
tree0d494f7e1a38b95c92426f58fe6eaa877303a86c /vendor/rustix/src/pid.rs
parentReleasing progress-linux version 1.74.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-ef24de24a82fe681581cc130f342363c47c0969a.tar.xz
rustc-ef24de24a82fe681581cc130f342363c47c0969a.zip
Merging upstream version 1.75.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/rustix/src/pid.rs')
-rw-r--r--vendor/rustix/src/pid.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/vendor/rustix/src/pid.rs b/vendor/rustix/src/pid.rs
index 3911e4c7a..5f2b9ad2a 100644
--- a/vendor/rustix/src/pid.rs
+++ b/vendor/rustix/src/pid.rs
@@ -26,8 +26,7 @@ impl Pid {
/// Converts a `RawPid` into a `Pid`.
///
- /// Returns `Some` for strictly positive `RawPid`s. Otherwise, returns
- /// `None`.
+ /// Returns `Some` for positive `RawPid`s. Otherwise, returns `None`.
///
/// This is safe because a `Pid` is a number without any guarantees for the
/// kernel. Non-child `Pid`s are always racy for any syscalls, but can only
@@ -39,18 +38,18 @@ impl Pid {
#[inline]
pub const fn from_raw(raw: RawPid) -> Option<Self> {
if raw > 0 {
- // SAFETY: raw > 0.
+ // SAFETY: We just checked that `raw > 0`.
unsafe { Some(Self::from_raw_unchecked(raw)) }
} else {
None
}
}
- /// Converts a known strictly positive `RawPid` into a `Pid`.
+ /// Converts a known positive `RawPid` into a `Pid`.
///
/// # Safety
///
- /// The caller must guarantee `raw` is strictly positive.
+ /// The caller must guarantee `raw` is positive.
#[inline]
pub const unsafe fn from_raw_unchecked(raw: RawPid) -> Self {
debug_assert!(raw > 0);