]> git.lizzy.rs Git - rust.git/blob - src/docs/needless_return.txt
Auto merge of #9421 - xphoniex:fix-#9420, r=giraffate
[rust.git] / src / docs / needless_return.txt
1 ### What it does
2 Checks for return statements at the end of a block.
3
4 ### Why is this bad?
5 Removing the `return` and semicolon will make the code
6 more rusty.
7
8 ### Example
9 ```
10 fn foo(x: usize) -> usize {
11     return x;
12 }
13 ```
14 simplify to
15 ```
16 fn foo(x: usize) -> usize {
17     x
18 }
19 ```