mirror of
https://github.com/haraldh/chainerror.git
synced 2025-05-31 22:08:07 +02:00
add more docs
This commit is contained in:
parent
4762a75cfe
commit
f5457a2a51
4 changed files with 40 additions and 7 deletions
|
@ -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)
|
|
@ -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:}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue