diff options
author | Dean Li <deantvv@gmail.com> | 2021-10-16 12:33:50 +0800 |
---|---|---|
committer | Dean Li <deantvv@gmail.com> | 2022-02-07 21:39:29 +0800 |
commit | 378530d6159a6732053ae02585df7ac5a8961c37 (patch) | |
tree | 96404e4af5499f7b812f6570899c673da592c92f | |
parent | 16ceae331c0a3e53b75a841aae1d7927c3d474c6 (diff) | |
download | nix-378530d6159a6732053ae02585df7ac5a8961c37.zip |
Impl `AsRawFd` for `OwningIter`
For issue #1558
-rw-r--r-- | src/dir.rs | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -142,6 +142,14 @@ impl Iterator for OwningIter { } } +/// The file descriptor continues to be owned by the `OwningIter`, +/// so callers must not keep a `RawFd` after the `OwningIter` is dropped. +impl AsRawFd for OwningIter { + fn as_raw_fd(&self) -> RawFd { + self.0.as_raw_fd() + } +} + impl IntoIterator for Dir { type Item = Result<Entry>; type IntoIter = OwningIter; |