diff --git a/src/util/error.rs b/src/util/error.rs index 5aafaa2..74fa544 100644 --- a/src/util/error.rs +++ b/src/util/error.rs @@ -1,4 +1,5 @@ use std::error; +use std::io; use std::fmt; use std::ffi::CStr; use std::str::from_utf8_unchecked; @@ -110,6 +111,12 @@ impl Into for Error { } } +impl From for io::Error { + fn from(value: Error) -> io::Error { + io::Error::new(io::ErrorKind::Other, value) + } +} + impl fmt::Display for Error { fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { f.write_str(error::Error::description(self))