-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Remove alt check #3101
Copy link
Copy link
Closed
Labels
A-grammarArea: The grammar of RustArea: The grammar of RustE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Milestone
Metadata
Metadata
Assignees
Labels
A-grammarArea: The grammar of RustArea: The grammar of RustE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
This is an unnecessary corner of the language, the only remaining use of the
checkkeyword. I know I have misexplained the difference betweenaltandalt checkbefore.alt checkis a bit of an anti-pattern because it:Which is clearer?
The first requires explaination. The second says exactly what the fallthrough behavior is, occurs syntactically where the fallthrough behavior occurs, and is more natural to write (once you've written all the cases you intend to cover you then write the fallthrough case instead of going back to the top of the structure and changing it).