Skip to content

Instantly share code, notes, and snippets.

@tailhook
Created May 29, 2016 23:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tailhook/57bc9a7ba119e9303277c5fd41ca881f to your computer and use it in GitHub Desktop.
Save tailhook/57bc9a7ba119e9303277c5fd41ca881f to your computer and use it in GitHub Desktop.
quick_error! {
enum DocsError {
Io(path: PathBuf, io::Error) {
context(path: &Path, err: io::Error)
-> (path.to_path_buf(), err)
}
Format(path: PathBuf, lineno: usize, doc::FormatError) {
context(file_line: (&Path, usize), err: io::Error)
-> (file_line.0.to_path_buf(), file_line.1, err)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment