]> git.lizzy.rs Git - rust.git/blob - src/docs/ok_expect.txt
Add iter_kv_map lint
[rust.git] / src / docs / ok_expect.txt
1 ### What it does
2 Checks for usage of `ok().expect(..)`.
3
4 ### Why is this bad?
5 Because you usually call `expect()` on the `Result`
6 directly to get a better error message.
7
8 ### Known problems
9 The error type needs to implement `Debug`
10
11 ### Example
12 ```
13 x.ok().expect("why did I do this again?");
14 ```
15
16 Use instead:
17 ```
18 x.expect("why did I do this again?");
19 ```