parent
8150dc2b1f
commit
a344423ba3
@ -1,32 +0,0 @@
|
||||
use std::fmt::{Display, Formatter, Result as FmtResult};
|
||||
|
||||
use log::SetLoggerError;
|
||||
|
||||
pub type RagResult<T> = Result<T, RagError>;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum RagError {
|
||||
SetLogger(SetLoggerError),
|
||||
Empty,
|
||||
}
|
||||
|
||||
impl From<()> for RagError {
|
||||
fn from(_: ()) -> RagError {
|
||||
RagError::Empty
|
||||
}
|
||||
}
|
||||
|
||||
impl From<SetLoggerError> for RagError {
|
||||
fn from(e: SetLoggerError) -> RagError {
|
||||
RagError::SetLogger(e)
|
||||
}
|
||||
}
|
||||
|
||||
impl Display for RagError {
|
||||
fn fmt(&self, f: &mut Formatter) -> FmtResult {
|
||||
match *self {
|
||||
RagError::SetLogger(ref e) => Display::fmt(e, f),
|
||||
RagError::Empty => Display::fmt("Empty", f),
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in new issue