summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/src/docs/wildcard_in_or_patterns.txt
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/clippy/src/docs/wildcard_in_or_patterns.txt')
-rw-r--r--src/tools/clippy/src/docs/wildcard_in_or_patterns.txt22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/tools/clippy/src/docs/wildcard_in_or_patterns.txt b/src/tools/clippy/src/docs/wildcard_in_or_patterns.txt
new file mode 100644
index 000000000..70468ca41
--- /dev/null
+++ b/src/tools/clippy/src/docs/wildcard_in_or_patterns.txt
@@ -0,0 +1,22 @@
+### What it does
+Checks for wildcard pattern used with others patterns in same match arm.
+
+### Why is this bad?
+Wildcard pattern already covers any other pattern as it will match anyway.
+It makes the code less readable, especially to spot wildcard pattern use in match arm.
+
+### Example
+```
+match s {
+ "a" => {},
+ "bar" | _ => {},
+}
+```
+
+Use instead:
+```
+match s {
+ "a" => {},
+ _ => {},
+}
+``` \ No newline at end of file