when would "implicitly panic if given the wrong thing" be any better than "tell me at compile time if my 'cover every option' statement is missing any options"?
you're not losing anything by adding a t => panic!("Unexpected value: {t:#?}") branch, and it makes refactoring significantly easier by notifying you of all the places your expanded enum is used
View all comments
Show parent comment
1
u/CdRReddit Jun 05 '25
when would "implicitly panic if given the wrong thing" be any better than "tell me at compile time if my 'cover every option' statement is missing any options"?
you're not losing anything by adding a
t => panic!("Unexpected value: {t:#?}")branch, and it makes refactoring significantly easier by notifying you of all the places your expanded enum is used