diff options
Diffstat (limited to 'src/tools/clippy/src/docs/match_wild_err_arm.txt')
-rw-r--r-- | src/tools/clippy/src/docs/match_wild_err_arm.txt | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/tools/clippy/src/docs/match_wild_err_arm.txt b/src/tools/clippy/src/docs/match_wild_err_arm.txt new file mode 100644 index 000000000..f89b3a23a --- /dev/null +++ b/src/tools/clippy/src/docs/match_wild_err_arm.txt @@ -0,0 +1,16 @@ +### What it does +Checks for arm which matches all errors with `Err(_)` +and take drastic actions like `panic!`. + +### Why is this bad? +It is generally a bad practice, similar to +catching all exceptions in java with `catch(Exception)` + +### Example +``` +let x: Result<i32, &str> = Ok(3); +match x { + Ok(_) => println!("ok"), + Err(_) => panic!("err"), +} +```
\ No newline at end of file |