]> git.proxmox.com Git - rustc.git/blame - src/tools/clippy/src/docs/unused_unit.txt
New upstream version 1.66.0+dfsg1
[rustc.git] / src / tools / clippy / src / docs / unused_unit.txt
CommitLineData
f2b60f7d
FG
1### What it does
2Checks for unit (`()`) expressions that can be removed.
3
4### Why is this bad?
5Such expressions add no value, but can make the code
6less readable. Depending on formatting they can make a `break` or `return`
7statement look like a function call.
8
9### Example
10```
11fn return_unit() -> () {
12 ()
13}
14```
15is equivalent to
16```
17fn return_unit() {}
18```