Skip to content

Commit aa509de

Browse files
committed
Clarify that AsFd implementations may also *borrow* their file descriptors.
1 parent bf1ef7f commit aa509de

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

text/0000-io-safety.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ These three traits are conceptual replacements for `AsRawFd`, `IntoRawFd`, and
150150

151151
Using these traits, the `do_some_io` example in the [motivation] can avoid
152152
the original problems. Since `AsFd` is only implemented for types which
153-
properly own their file descriptors, this version of `do_some_io` doesn't
154-
have to worry about being passed bogus or dangling file descriptors:
153+
properly own or borrow their file descriptors, this version of `do_some_io`
154+
doesn't have to worry about being passed bogus or dangling file descriptors:
155155

156156
```rust
157157
pub fn do_some_io<FD: AsFd>(input: &FD) -> io::Result<()> {

0 commit comments

Comments
 (0)