rust/src/docs/needless_return.txt
2022-09-09 13:36:26 +02:00

19 lines
No EOL
278 B
Text

### What it does
Checks for return statements at the end of a block.
### Why is this bad?
Removing the `return` and semicolon will make the code
more rusty.
### Example
```
fn foo(x: usize) -> usize {
return x;
}
```
simplify to
```
fn foo(x: usize) -> usize {
x
}
```