Commit Graph
6 Commits
Author SHA1 Message Date
mikkurogue 5cdaee7420 Update: Remove the 4th branch in favour of just making that the else branch
Probably easier to not have an "unused" branch that returns the same as the else branch in the example.

Signed-off-by: mikkurogue <mikkurogue@noreply.codeberg.org>
2025-01-07 10:15:59 +00:00
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