KB6THMJJPQ56OLYYODIM5IVEF3IAPCAEC2HGH3C7LAEF24IW6XQQC
MSP7OSXV27W2UISXGWOGV52O4MWLPHQZ4EVBUFEX5KKCR4MXI63AC
6ASXQDFE2S6ADA43ELZTBDTRJ7BG3NFJIKVSAKEU5FMYNRWCHOPAC
LNM226ITXRMWOSX6GOJ4HO72BWFRBDKQTEZMF4QUJUACUIOKIEJQC
EKYR4HDT6DHI7H5YMSHEBHXLPDCA2X2XNXYHDKHWGMPHNVTUBCMQC
GFUITBG5JGUCDMG34FEMPPJAZGQKURXA5L2RYS6YOQC4DIQGASMAC
FJ7MWHMLIDTBGJJNKCNS5GIBQIJBUQRXLQEAFOCVZI7O4NA4XGSAC
K7UY4GCWKGWKQKFKOE4ETLPGEMN5LDIGBOQKN57Q24UUQGYU2WOAC
YWW5TKMSPEGRZ52FQZ3SC4C3DEZ57U5XUO4LHZC34BJA7QR5NSCQC
D3IJE5IHSC64GMC3QZUYMSPZL2PXIVOHCWF7BREKRQXJQLURZBLQC
N7U2FHPRHGARPZ6M7LYBDJ52NMYE23VD5YALZ7CC76W3V5OLBP7QC
JSBVL45BUNWMQIONEJFWAVI3XGZOUDJXGAYT6FWJZS4TJIJBQVIAC
DK2344VK2P47NVSA774Q7BY3LP24ZWWVUEGCLKJ5IDZFP5YWNDDQC
2XZLORI35AOKD4YITN2XAVXDXZXRNUKNXJXPA2TTBAXYYLJB77GAC
OXKWHQFHTDDOWX3QDMHDWHCT3HFKWQS7Z7DEL3ILJBA7GNITA4GAC
CITEDKPB6MKVZUEYEDE5ZKTNVY35HCOAXKDPYG7YLLEOVFNMSRXQC
ZDN7BJ3JA3VL4AYWX3SV24GHP6NCAETJVAKAXKMIZTLHTWLUNMOQC
```
**Note**: The way the `eyre!` macro works in practice differs from how
`anyhow!` works due to the addition of the generic type parameter. In anyhow
the following is valid.
```rust
// Works
let val = get_optional_val.ok_or_else(|| anyhow!("failed to get value)).unwrap();
Where as with `eyre!` this will fail due to being unable to infer the type for
the Context parameter. The solution to this problem, should you encounter it,
is to give the compiler a hint for what type it should be resolving to, either
via your return type or a type annotation.
```rust
// Broken
let val = get_optional_val.ok_or_else(|| eyre!("failed to get value)).unwrap();
// Works
let val: ErrReport = get_optional_val.ok_or_else(|| eyre!("failed to get value)).unwrap();
```
[ErrReport]: https://docs.rs/eyre/1.0/eyre/struct.ErrReport.html
[actions-badge]: https://github.com/yaahc/eyre/workflows/Continuous%20integration/badge.svg
[actions-url]: https://github.com/yaahc/eyre/actions?query=workflow%3A%22Continuous+integration%22
## Incompatibilities with anyhow
Beyond the fact that eyre renames many of the core APIs in anyhow the addition
of the type parameter makes the `eyre!` macro not work in certain places where
`anyhow!` does work. In anyhow the following is valid.
```rust
// Works
let val = get_optional_val.ok_or_else(|| anyhow!("failed to get value)).unwrap();
```
Where as with `eyre!` this will fail due to being unable to infer the type for
the Context parameter. The solution to this problem, should you encounter it,
is to give the compiler a hint for what type it should be resolving to, either
via your return type or a type annotation.
```rust
// Broken
let val = get_optional_val.ok_or_else(|| eyre!("failed to get value)).unwrap();
// Works
let val: ErrReport = get_optional_val.ok_or_else(|| eyre!("failed to get value)).unwrap();
```
[ErrReport]: https://docs.rs/eyre/1.0/eyre/struct.ErrReport.html
[actions-badge]: https://github.com/yaahc/eyre/workflows/Continuous%20integration/badge.svg
[actions-url]: https://github.com/yaahc/eyre/actions?query=workflow%3A%22Continuous+integration%22