implement display for EcloadError
This commit is contained in:
parent
782fff9ac8
commit
eb7502f52e
4 changed files with 57 additions and 37 deletions
|
@ -1,3 +1,5 @@
|
|||
use std::fmt;
|
||||
|
||||
#[derive(Debug)]
|
||||
/// Convert different errors into a common one.
|
||||
pub enum EcloadError {
|
||||
|
@ -8,6 +10,12 @@ pub enum EcloadError {
|
|||
ImageError(image::ImageError),
|
||||
}
|
||||
|
||||
impl fmt::Display for EcloadError {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "{}", self)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<std::io::Error> for EcloadError {
|
||||
fn from(e: std::io::Error) -> Self {
|
||||
EcloadError::StdError(e)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue