]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/src/docs/let_and_return.txt
Auto merge of #99443 - jam1garner:mips-virt-feature, r=nagisa
[rust.git] / src / tools / clippy / src / docs / let_and_return.txt
1 ### What it does
2 Checks for `let`-bindings, which are subsequently
3 returned.
4
5 ### Why is this bad?
6 It is just extraneous code. Remove it to make your code
7 more rusty.
8
9 ### Example
10 ```
11 fn foo() -> String {
12     let x = String::new();
13     x
14 }
15 ```
16 instead, use
17 ```
18 fn foo() -> String {
19     String::new()
20 }
21 ```