implement std::error::Error for Error

This commit is contained in:
eater
2021-08-22 23:35:47 +02:00
parent 1af4c675c7
commit 9fe741d913

View File

@@ -1,4 +1,5 @@
use std::io; use std::{fmt::{Debug,Display}, io};
use std::error::Error as StdError;
use super::fourcc::FourCC; use super::fourcc::FourCC;
use uuid; use uuid;
@@ -43,6 +44,14 @@ pub enum Error {
} }
impl StdError for Error {}
impl Display for Error {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
Debug::fmt(self, f)
}
}
impl From<io::Error> for Error { impl From<io::Error> for Error {
fn from(error: io::Error) -> Error { fn from(error: io::Error) -> Error {