Skip to content

Commit 3647c34

Browse files
committed
doc comment for LazyReadDir variants
1 parent f68ee84 commit 3647c34

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

library/std/src/sys/unix/fs/dir_fd.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,14 @@ mod remove_dir_all_xat {
134134
}
135135

136136
enum LazyReadDir<'a> {
137-
Fd(Option<OwnedFd>), // only Fd(None) temporarily in ensure_open()
138-
OpenReadDir(ReadDir, BorrowedFd<'a>), // also store the fd to avoid having to call dirfd(3)
137+
/// Contains the file descriptor of the directory, while it has not been opened for reading.
138+
/// It is only `Fd(None)` temporarily in `ensure_open()`.
139+
Fd(Option<OwnedFd>),
140+
141+
// Contains the `ReadDir` for the directory while it is being read. The ReadDir does not contain
142+
// a valid `root` path, because it is not needed. It also contains the file descriptor of the
143+
// directory to avoid calls to dirfd(3).
144+
OpenReadDir(ReadDir, BorrowedFd<'a>),
139145
}
140146

141147
impl LazyReadDir<'_> {

0 commit comments

Comments
 (0)