summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/src/docs/short_circuit_statement.txt
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/clippy/src/docs/short_circuit_statement.txt')
-rw-r--r--src/tools/clippy/src/docs/short_circuit_statement.txt14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/tools/clippy/src/docs/short_circuit_statement.txt b/src/tools/clippy/src/docs/short_circuit_statement.txt
new file mode 100644
index 000000000..31492bed0
--- /dev/null
+++ b/src/tools/clippy/src/docs/short_circuit_statement.txt
@@ -0,0 +1,14 @@
+### What it does
+Checks for the use of short circuit boolean conditions as
+a
+statement.
+
+### Why is this bad?
+Using a short circuit boolean condition as a statement
+may hide the fact that the second part is executed or not depending on the
+outcome of the first part.
+
+### Example
+```
+f() && g(); // We should write `if f() { g(); }`.
+``` \ No newline at end of file