Commit graph

5 commits

Author SHA1 Message Date
mikkurogue
de353bcb3b Update: 108 Labeled switch example to contain default case for exhaustion
Update example text to give clarity on default/exhaustive case.

Reasoning:
The input for the example will not compile if user would want to test this for the logic of a labeled switch. Due the input not being an exhaustive input but rather "any u8 integer" (for the lack of better terminology) we need to use the else branch to indicate that the default case is handled, in this case by just emulating the '4' branch, but this could return an error.InvalidCaseProvided for example.

Signed-off-by: mikkurogue <michael.lindemans@outlook.com>
2025-01-04 11:56:25 +00:00
Chris Boesch
d1b49f353e
Minor improvements. 2024-09-20 12:10:55 +02:00
Nuno Mendes
ed1a20d51b improve explanantions in labeled switch 2024-09-18 23:26:33 +02:00
Nuno Mendes
db569a1478 update labeled switch to also have a break statement 2024-09-16 18:39:54 +02:00
Nuno Mendes
335a78f8f5 108: Add a exercise for a labeled switch 2024-09-15 20:14:49 +02:00