diff options
Diffstat (limited to 'src/docs/single_match_else.txt')
| -rw-r--r-- | src/docs/single_match_else.txt | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/src/docs/single_match_else.txt b/src/docs/single_match_else.txt deleted file mode 100644 index 29a447af09b..00000000000 --- a/src/docs/single_match_else.txt +++ /dev/null @@ -1,29 +0,0 @@ -### What it does -Checks for matches with two arms where an `if let else` will -usually suffice. - -### Why is this bad? -Just readability – `if let` nests less than a `match`. - -### Known problems -Personal style preferences may differ. - -### Example -Using `match`: - -``` -match x { - Some(ref foo) => bar(foo), - _ => bar(&other_ref), -} -``` - -Using `if let` with `else`: - -``` -if let Some(ref foo) = x { - bar(foo); -} else { - bar(&other_ref); -} -``` \ No newline at end of file |
