]> git.lizzy.rs Git - rust.git/blob - src/docs/if_same_then_else.txt
Auto merge of #9421 - xphoniex:fix-#9420, r=giraffate
[rust.git] / src / docs / if_same_then_else.txt
1 ### What it does
2 Checks for `if/else` with the same body as the *then* part
3 and the *else* part.
4
5 ### Why is this bad?
6 This is probably a copy & paste error.
7
8 ### Example
9 ```
10 let foo = if … {
11     42
12 } else {
13     42
14 };
15 ```