]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/src/docs/unused_unit.txt
Rollup merge of #101389 - lukaslueg:rcgetmutdocs, r=m-ou-se
[rust.git] / src / tools / clippy / src / docs / unused_unit.txt
1 ### What it does
2 Checks for unit (`()`) expressions that can be removed.
3
4 ### Why is this bad?
5 Such expressions add no value, but can make the code
6 less readable. Depending on formatting they can make a `break` or `return`
7 statement look like a function call.
8
9 ### Example
10 ```
11 fn return_unit() -> () {
12     ()
13 }
14 ```
15 is equivalent to
16 ```
17 fn return_unit() {}
18 ```