diff options
Diffstat (limited to '')
-rw-r--r-- | src/tools/clippy/src/docs/panicking_unwrap.txt | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/src/tools/clippy/src/docs/panicking_unwrap.txt b/src/tools/clippy/src/docs/panicking_unwrap.txt deleted file mode 100644 index 1fbc245c8..000000000 --- a/src/tools/clippy/src/docs/panicking_unwrap.txt +++ /dev/null @@ -1,18 +0,0 @@ -### What it does -Checks for calls of `unwrap[_err]()` that will always fail. - -### Why is this bad? -If panicking is desired, an explicit `panic!()` should be used. - -### Known problems -This lint only checks `if` conditions not assignments. -So something like `let x: Option<()> = None; x.unwrap();` will not be recognized. - -### Example -``` -if option.is_none() { - do_something_with(option.unwrap()) -} -``` - -This code will always panic. The if condition should probably be inverted.
\ No newline at end of file |