diff options
Diffstat (limited to 'src/tools/clippy/src/docs/or_then_unwrap.txt')
-rw-r--r-- | src/tools/clippy/src/docs/or_then_unwrap.txt | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/src/tools/clippy/src/docs/or_then_unwrap.txt b/src/tools/clippy/src/docs/or_then_unwrap.txt deleted file mode 100644 index 64ac53749..000000000 --- a/src/tools/clippy/src/docs/or_then_unwrap.txt +++ /dev/null @@ -1,22 +0,0 @@ -### What it does -Checks for `.or(…).unwrap()` calls to Options and Results. - -### Why is this bad? -You should use `.unwrap_or(…)` instead for clarity. - -### Example -``` -// Result -let value = result.or::<Error>(Ok(fallback)).unwrap(); - -// Option -let value = option.or(Some(fallback)).unwrap(); -``` -Use instead: -``` -// Result -let value = result.unwrap_or(fallback); - -// Option -let value = option.unwrap_or(fallback); -```
\ No newline at end of file |