]> git.lizzy.rs Git - rust.git/blob - src/docs/match_wild_err_arm.txt
Add iter_kv_map lint
[rust.git] / src / docs / match_wild_err_arm.txt
1 ### What it does
2 Checks for arm which matches all errors with `Err(_)`
3 and take drastic actions like `panic!`.
4
5 ### Why is this bad?
6 It is generally a bad practice, similar to
7 catching all exceptions in java with `catch(Exception)`
8
9 ### Example
10 ```
11 let x: Result<i32, &str> = Ok(3);
12 match x {
13     Ok(_) => println!("ok"),
14     Err(_) => panic!("err"),
15 }
16 ```