add more docs

This commit is contained in:
Harald Hoyer 2019-02-03 19:33:26 +01:00 committed by Harald Hoyer
parent 4762a75cfe
commit f5457a2a51
4 changed files with 40 additions and 7 deletions

View file

@ -13,5 +13,6 @@
- [Selective Error Handling](tutorial9.md)
- [ErrorKind to the rescue](tutorial10.md)
- [Debug for the ErrorKind](tutorial11.md)
- [Deref for the ErrorKind](tutorial12.md)
[The End](end.md)

View file

@ -1,7 +1,7 @@
# Deref for the ErrorKind
Because ChainError<T> implements Deref to &T, we can also match on `*e` instead of `e.kind()`.
Because ChainError<T> implements Deref to &T, we can also match on `*e` instead of `e.kind()`
or call a function with `&e`
~~~rust
use crate::chainerror::*;
{{#include ../examples/tutorial12.rs:2:}}