]>
Commit | Line | Data |
---|---|---|
f2b60f7d FG |
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 | ``` |