src/tools/fs.rs - read_dir: return nix::Result

This commit is contained in:
Dietmar Maurer 2019-07-04 10:47:16 +02:00
parent a57360983b
commit c698636a5d

View File

@ -93,7 +93,7 @@ impl Iterator for ReadDir {
/// Create an iterator over sub directory entries. /// Create an iterator over sub directory entries.
/// This uses `openat` on `dirfd`, so `path` can be relative to that or an absolute path. /// This uses `openat` on `dirfd`, so `path` can be relative to that or an absolute path.
pub fn read_subdir<P: ?Sized + nix::NixPath>(dirfd: RawFd, path: &P) -> Result<ReadDir, Error> { pub fn read_subdir<P: ?Sized + nix::NixPath>(dirfd: RawFd, path: &P) -> nix::Result<ReadDir> {
use nix::fcntl::OFlag; use nix::fcntl::OFlag;
use nix::sys::stat::Mode; use nix::sys::stat::Mode;