]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/src/docs/unwrap_or_else_default.txt
Merge commit 'b52fb5234cd7c11ecfae51897a6f7fa52e8777fc' into clippyup
[rust.git] / src / tools / clippy / src / docs / unwrap_or_else_default.txt
1 ### What it does
2 Checks for usages of `_.unwrap_or_else(Default::default)` on `Option` and
3 `Result` values.
4
5 ### Why is this bad?
6 Readability, these can be written as `_.unwrap_or_default`, which is
7 simpler and more concise.
8
9 ### Examples
10 ```
11 x.unwrap_or_else(Default::default);
12 x.unwrap_or_else(u32::default);
13 ```
14
15 Use instead:
16 ```
17 x.unwrap_or_default();
18 ```