diff options
| author | Chris Boesch <chrboesch@noreply.codeberg.org> | 2024-09-19 10:16:08 +0000 |
|---|---|---|
| committer | Chris Boesch <chrboesch@noreply.codeberg.org> | 2024-09-19 10:16:08 +0000 |
| commit | 94b5b4bf4bd2cef9adcca401dc75d1b6cd079fb4 (patch) | |
| tree | 1e97f8c1f0cc1cf96d5deef7e925cddfdc386094 /patches | |
| parent | 102ba8c894ebc39e0d61634ad17ca9751984e715 (diff) | |
| parent | f0c2c56087bfd4398b896d3a8304a90cddbb3583 (diff) | |
Merge pull request 'Add a new exercise for a labeled switch' (#161) from nm-remarkable/exercises:main into main
Reviewed-on: https://codeberg.org/ziglings/exercises/pulls/161
Diffstat (limited to 'patches')
| -rw-r--r-- | patches/patches/108_labeled_switch.patch | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/patches/patches/108_labeled_switch.patch b/patches/patches/108_labeled_switch.patch new file mode 100644 index 0000000..467540c --- /dev/null +++ b/patches/patches/108_labeled_switch.patch @@ -0,0 +1,18 @@ +--- a/exercises/108_labeled_switch.zig ++++ b/exercises/108_labeled_switch.zig +@@ -65,13 +65,13 @@ pub fn main() void { + // how would you fix it? + pr: switch (@as(PullRequestState, PullRequestState.Draft)) { + PullRequestState.Draft => continue :pr PullRequestState.InReview, +- PullRequestState.InReview => continue :pr PullRequestState.Rejected, ++ PullRequestState.InReview => continue :pr PullRequestState.Approved, + PullRequestState.Approved => continue :pr PullRequestState.Merged, + PullRequestState.Rejected => { + std.debug.print("The pull request has been rejected", .{}); + return; + }, +- PullRequestState.Merged => break, // Would you know where to break to? ++ PullRequestState.Merged => break :pr, // Would you know where to break to? + } + std.debug.print("The pull request has been merged", .{}); + } |
