summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/src/docs/let_and_return.txt
blob: eba5a90ddd66c57846806913fd0a81cb024df7ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
### What it does
Checks for `let`-bindings, which are subsequently
returned.

### Why is this bad?
It is just extraneous code. Remove it to make your code
more rusty.

### Example
```
fn foo() -> String {
    let x = String::new();
    x
}
```
instead, use
```
fn foo() -> String {
    String::new()
}
```