Skip to content

Commit b7d6af0

Browse files
pierwillalexandruag
authored andcommitted
Add Safety heading to from_raw_fd docs
Signed-off-by: pierwill <[email protected]>
1 parent 771afde commit b7d6af0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/ioctls/device.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,9 @@ impl AsRawFd for DeviceFd {
164164
}
165165

166166
impl FromRawFd for DeviceFd {
167-
/// This function is also unsafe as the primitives currently returned have the contract that
167+
/// # Safety
168+
///
169+
/// This function is unsafe as the primitives currently returned have the contract that
168170
/// they are the sole owner of the file descriptor they are wrapping. Usage of this function
169171
/// could accidentally allow violating this contract which can cause memory unsafety in code
170172
/// that relies on it being true.

0 commit comments

Comments
 (0)