mirror of
https://github.com/haraldh/chainerror.git
synced 2025-06-08 17:04:42 +02:00
deref
This commit is contained in:
parent
4762a75cfe
commit
c9259a3ea3
3 changed files with 39 additions and 7 deletions
|
@ -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