diff options
Diffstat (limited to 'src/docs/unneeded_field_pattern.txt')
| -rw-r--r-- | src/docs/unneeded_field_pattern.txt | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/src/docs/unneeded_field_pattern.txt b/src/docs/unneeded_field_pattern.txt deleted file mode 100644 index 3cd00a0f3e3..00000000000 --- a/src/docs/unneeded_field_pattern.txt +++ /dev/null @@ -1,26 +0,0 @@ -### What it does -Checks for structure field patterns bound to wildcards. - -### Why is this bad? -Using `..` instead is shorter and leaves the focus on -the fields that are actually bound. - -### Example -``` -let f = Foo { a: 0, b: 0, c: 0 }; - -match f { - Foo { a: _, b: 0, .. } => {}, - Foo { a: _, b: _, c: _ } => {}, -} -``` - -Use instead: -``` -let f = Foo { a: 0, b: 0, c: 0 }; - -match f { - Foo { b: 0, .. } => {}, - Foo { .. } => {}, -} -``` \ No newline at end of file |
