]> git.lizzy.rs Git - rust.git/blob - src/docs/short_circuit_statement.txt
[Arithmetic] Consider literals
[rust.git] / src / docs / short_circuit_statement.txt
1 ### What it does
2 Checks for the use of short circuit boolean conditions as
3 a
4 statement.
5
6 ### Why is this bad?
7 Using a short circuit boolean condition as a statement
8 may hide the fact that the second part is executed or not depending on the
9 outcome of the first part.
10
11 ### Example
12 ```
13 f() && g(); // We should write `if f() { g(); }`.
14 ```