mirror of
https://github.com/encounter/rust-ffmpeg.git
synced 2026-07-10 21:18:39 -07:00
error: implement From<Error> for io::Error
This commit is contained in:
@@ -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<c_int> for Error {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Error> 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))
|
||||
|
||||
Reference in New Issue
Block a user