Skip to content

Commit

Permalink
Fix strings on last few examples (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
passcod authored Apr 25, 2020
1 parent 3ac0be8 commit fa398e7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ anyhow the following is valid.

```rust
// Works
let val = get_optional_val.ok_or_else(|| anyhow!("failed to get value)).unwrap();
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
Expand All @@ -307,10 +307,10 @@ via your return type or a type annotation.

```rust
// Broken
let val = get_optional_val.ok_or_else(|| eyre!("failed to get value)).unwrap();
let val = get_optional_val.ok_or_else(|| eyre!("failed to get value")).unwrap();

// Works
let val: Report = get_optional_val.ok_or_else(|| eyre!("failed to get value)).unwrap();
let val: Report = get_optional_val.ok_or_else(|| eyre!("failed to get value")).unwrap();
```
[Report]: https://docs.rs/eyre/*/eyre/struct.Report.html
[`eyre::EyreContext`]: https://docs.rs/eyre/*/eyre/trait.EyreContext.html
Expand Down

0 comments on commit fa398e7

Please sign in to comment.