diff options
Diffstat (limited to 'ext/io/fs.rs')
-rw-r--r-- | ext/io/fs.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/ext/io/fs.rs b/ext/io/fs.rs index bb6bdec4f..a333e1dd5 100644 --- a/ext/io/fs.rs +++ b/ext/io/fs.rs @@ -21,6 +21,16 @@ pub enum FsError { NotSupported, } +impl FsError { + pub fn kind(&self) -> io::ErrorKind { + match self { + Self::Io(err) => err.kind(), + Self::FileBusy => io::ErrorKind::Other, + Self::NotSupported => io::ErrorKind::Other, + } + } +} + impl From<io::Error> for FsError { fn from(err: io::Error) -> Self { Self::Io(err) |