diff options
Diffstat (limited to 'src/tools/clippy/src/docs/redundant_pattern.txt')
-rw-r--r-- | src/tools/clippy/src/docs/redundant_pattern.txt | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/tools/clippy/src/docs/redundant_pattern.txt b/src/tools/clippy/src/docs/redundant_pattern.txt new file mode 100644 index 000000000..45f6cfc86 --- /dev/null +++ b/src/tools/clippy/src/docs/redundant_pattern.txt @@ -0,0 +1,22 @@ +### What it does +Checks for patterns in the form `name @ _`. + +### Why is this bad? +It's almost always more readable to just use direct +bindings. + +### Example +``` +match v { + Some(x) => (), + y @ _ => (), +} +``` + +Use instead: +``` +match v { + Some(x) => (), + y => (), +} +```
\ No newline at end of file |