Advertisement
Guest User

Untitled

a guest
Jul 1st, 2015
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rust 0.49 KB | None | 0 0
  1. pub struct QuestionError {
  2.     pub kind: QuestionErrorKind,
  3.     pub desc: String,
  4. }
  5.  
  6. #[derive(Debug)]
  7. pub enum QuestionErrorKind {
  8.     HyperError,
  9.     StdError,
  10. }
  11.  
  12. impl From<HyperError> for QuestionError {
  13.  
  14.     fn from(err: HyperError) -> QuestionError {
  15.         QuestionError { kind: err, desc: String::from("") }
  16.     }
  17. }
  18.  
  19. impl From<StdError> for QuestionError {
  20.  
  21.     fn from(err: StdError) -> QuestionError {
  22.         QuestionError { kind: err, desc: String::from("") }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement