Add impl_from! macro to shorten up error code

This commit is contained in:
Lucien Greathouse
2019-01-15 13:08:02 -08:00
parent 9d3638fa46
commit aae1d8b34f
6 changed files with 41 additions and 56 deletions

View File

@@ -15,11 +15,9 @@ pub enum InitError {
ProjectInitError(#[fail(cause)] ProjectInitError)
}
impl From<ProjectInitError> for InitError {
fn from(error: ProjectInitError) -> InitError {
InitError::ProjectInitError(error)
}
}
impl_from!(InitError {
ProjectInitError => ProjectInitError,
});
#[derive(Debug)]
pub struct InitOptions<'a> {