use const for variables that are never modified

This commit is contained in:
Adam Millerchip 2021-12-26 13:24:01 +09:00
parent ef9bdb1382
commit 669d4f7337
4 changed files with 6 additions and 6 deletions

View file

@ -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;