]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/src/docs/semicolon_if_nothing_returned.txt
Auto merge of #104673 - matthiaskrgr:rollup-85f65ov, r=matthiaskrgr
[rust.git] / src / tools / clippy / src / docs / semicolon_if_nothing_returned.txt
1 ### What it does
2 Looks for blocks of expressions and fires if the last expression returns
3 `()` but is not followed by a semicolon.
4
5 ### Why is this bad?
6 The semicolon might be optional but when extending the block with new
7 code, it doesn't require a change in previous last line.
8
9 ### Example
10 ```
11 fn main() {
12     println!("Hello world")
13 }
14 ```
15 Use instead:
16 ```
17 fn main() {
18     println!("Hello world");
19 }
20 ```