autocommit 2022-05-01 17:23:55 CEST
This commit is contained in:
parent
4373ed05bf
commit
e1d5bf0e5d
39 changed files with 1772 additions and 57 deletions
|
|
@ -204,3 +204,17 @@ impl Display for OsError {
|
|||
write!(f, "{} (os error {})", msg, self.0)
|
||||
}
|
||||
}
|
||||
|
||||
pub trait OsErrorExt {
|
||||
type Container;
|
||||
|
||||
fn to_os_error(self) -> Self::Container;
|
||||
}
|
||||
|
||||
impl<T> OsErrorExt for Result<T, Errno> {
|
||||
type Container = Result<T, OsError>;
|
||||
|
||||
fn to_os_error(self) -> Self::Container {
|
||||
self.map_err(|e| e.into())
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue