You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: book/src/05_ticket_v2/02_match.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -68,3 +68,10 @@ match status {
68
68
```
69
69
70
70
The `_` pattern matches anything that wasn't matched by the previous patterns.
71
+
72
+
<divclass="warning">
73
+
By using this catch-all pattern, you _won't_ get the benefits of compiler-driven refactoring.\
74
+
If you add a new enum variant, the compiler _won't_ tell you that you're not handling it.
75
+
76
+
If you're keen on correctness, avoid using catch-alls. Leverage the compiler to re-examine all matching sites and determine how new enum variants should be handled.
0 commit comments