Skip to content

Commit

Permalink
Add impl From<E> for Error<E> for easier error conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
Nemo157 committed Mar 7, 2018
1 parent 109aad9 commit e9ca180
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,12 @@ impl<E> Error<E> {
}
}

impl<E> From<E> for Error<E> {
fn from(error: E) -> Error<E> {
Error::Other(error)
}
}

/// Await operation (*won't work until the language gains support for
/// generators*)
///
Expand Down

0 comments on commit e9ca180

Please sign in to comment.