diff options
Diffstat (limited to 'src/mount/bsd.rs')
-rw-r--r-- | src/mount/bsd.rs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/mount/bsd.rs b/src/mount/bsd.rs index 3ee1f068..01449081 100644 --- a/src/mount/bsd.rs +++ b/src/mount/bsd.rs @@ -1,4 +1,5 @@ use crate::{ + Error, Errno, NixPath, Result, @@ -99,7 +100,7 @@ libc_bitflags!( /// by `nmount(2)`. #[derive(Debug)] pub struct NmountError { - errno: Errno, + errno: Error, errmsg: Option<String> } @@ -109,14 +110,14 @@ impl NmountError { self.errmsg.as_deref() } - /// Returns the inner [`Errno`] - pub fn errno(&self) -> Errno { + /// Returns the inner [`Error`] + pub fn error(&self) -> Error { self.errno } - fn new(errno: Errno, errmsg: Option<&CStr>) -> Self { + fn new(error: Error, errmsg: Option<&CStr>) -> Self { Self { - errno, + errno: error, errmsg: errmsg.map(CStr::to_string_lossy).map(Cow::into_owned) } } |