chainerror/booksrc/tutorial12.md
2019-03-04 11:44:15 +01:00

12 lines
280 B
Markdown

# Deref for the ErrorKind
Because ChainError<T> implements Deref to &T, we can also match on `*e` instead of `e.kind()`
or call a function with `&e`
~~~rust
{{#include ../examples/tutorial12.rs}}
# #[allow(dead_code)]
# mod chainerror {
{{#includecomment ../src/lib.rs}}
# }
~~~