diff --git a/src/tools/fs.rs b/src/tools/fs.rs index 25e04b33..f000bfac 100644 --- a/src/tools/fs.rs +++ b/src/tools/fs.rs @@ -66,6 +66,10 @@ impl ReadDirEntry { pub fn parent_fd(&self) -> RawFd { self.parent_fd } + + pub unsafe fn file_name_utf8_unchecked(&self) -> &str { + std::str::from_utf8_unchecked(self.file_name().to_bytes()) + } } // Since Tied implements Deref to U, a Tied already implements Iterator.