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
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -73,5 +73,5 @@ The `_` pattern matches anything that wasn't matched by the previous patterns.
73
73
By using this catch-all pattern, you _won't_ get the benefits of compiler-driven refactoring.\
74
74
If you add a new enum variant, the compiler _won't_ tell you that you're not handling it.
75
75
76
-
In general, prefer to avoid catch-all patterns unless you're really sure future new variants should be handled the same way.
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