Impl From<Errno> for syscall::Error.

This commit is contained in:
4lDO2
2024-06-23 13:24:05 +02:00
parent c217745524
commit b6eb7dcf0f
+6
View File
@@ -92,6 +92,12 @@ impl From<syscall::Error> for Errno {
Errno(value.errno)
}
}
#[cfg(target_os = "redox")]
impl From<Errno> for syscall::Error {
fn from(value: Errno) -> Self {
syscall::Error::new(value.0)
}
}
pub trait ResultExt<T> {
fn or_minus_one_errno(self) -> T;