Merge pull request #432 from matthiasbeyer/libimagerror/simple-into

libimagerror: Impl Into<error name> for all <errorkindname>
This commit is contained in:
Matthias Beyer 2016-05-24 15:23:08 +02:00
commit f19c057258
2 changed files with 8 additions and 8 deletions

View file

@ -82,6 +82,14 @@ macro_rules! generate_custom_error_types {
} }
impl Into<$name> for $kindname {
fn into(self) -> $name {
$name::new(self, None)
}
}
impl Display for $name { impl Display for $name {
fn fmt(&self, fmt: &mut Formatter) -> Result<(), FmtError> { fn fmt(&self, fmt: &mut Formatter) -> Result<(), FmtError> {

View file

@ -11,14 +11,6 @@ pub trait IntoHookError {
fn into_hookerror_with_cause(self, cause: Box<Error>) -> HookError; fn into_hookerror_with_cause(self, cause: Box<Error>) -> HookError;
} }
impl Into<HookError> for HookErrorKind {
fn into(self) -> HookError {
HookError::new(self, None)
}
}
impl Into<HookError> for (HookErrorKind, Box<Error>) { impl Into<HookError> for (HookErrorKind, Box<Error>) {
fn into(self) -> HookError { fn into(self) -> HookError {