diff options
| author | Dave Gauer <ratfactor@gmail.com> | 2022-01-06 18:08:43 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-06 18:08:43 -0500 |
| commit | 4bdbeadef5ab51fba6c96566dda071a82f8fc8fb (patch) | |
| tree | 62a24ae4a7c56aa5251cf5f2f35d8e706e1cd961 /exercises/063_labels.zig | |
| parent | 75ea370352de75471ffb0df8c3076e824be9acd5 (diff) | |
| parent | 39e432748e067cce6f30fc7200685a994c1258ad (diff) | |
Merge pull request #88 from adamu/const
use const for variables that are never modified
Diffstat (limited to 'exercises/063_labels.zig')
| -rw-r--r-- | exercises/063_labels.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/exercises/063_labels.zig b/exercises/063_labels.zig index cdde229..f82ea6d 100644 --- a/exercises/063_labels.zig +++ b/exercises/063_labels.zig @@ -103,7 +103,7 @@ pub fn main() void { const wanted_ingredients = [_]u8{ 0, 3 }; // Chili, Cheese // Look at each Food on the menu... - var meal = food_loop: for (menu) |food| { + const meal = food_loop: for (menu) |food| { // Now look at each required ingredient for the Food... for (food.requires) |required, required_ingredient| { @@ -115,7 +115,7 @@ pub fn main() void { // (Remember that want_it will be the index number of // the ingredient based on its position in the // required ingredient list for each food.) - var found = for (wanted_ingredients) |want_it| { + const found = for (wanted_ingredients) |want_it| { if (required_ingredient == want_it) break true; } else false; |
