diff options
author | Dave Gauer <dave@ratfactor.com> | 2021-06-30 19:00:50 -0400 |
---|---|---|
committer | Dave Gauer <dave@ratfactor.com> | 2021-06-30 19:00:50 -0400 |
commit | 680e2913f7dc6b6b242e74fd99472b24d57ea3ae (patch) | |
tree | c07f748335ac0644fc2a1eb9d12a1a0426d50a51 | |
parent | 584993b7b8110bcfc5d8af543d889d671e78a484 (diff) | |
download | ziglings-680e2913f7dc6b6b242e74fd99472b24d57ea3ae.tar.gz ziglings-680e2913f7dc6b6b242e74fd99472b24d57ea3ae.tar.bz2 ziglings-680e2913f7dc6b6b242e74fd99472b24d57ea3ae.tar.xz ziglings-680e2913f7dc6b6b242e74fd99472b24d57ea3ae.zip |
unused consts now errors
-rw-r--r-- | exercises/051_values.zig | 17 | ||||
-rw-r--r-- | patches/patches/033_iferror.patch | 2 | ||||
-rw-r--r-- | patches/patches/051_values.patch | 6 |
3 files changed, 10 insertions, 15 deletions
diff --git a/exercises/051_values.zig b/exercises/051_values.zig index 956b742..f2653f9 100644 --- a/exercises/051_values.zig +++ b/exercises/051_values.zig @@ -69,17 +69,12 @@ pub fn main() void { .gold = 30, }; - // However, this "skull_farmer" character will be put in the - // global immutable data even though it's defined in a function. - // Since it's immutable, all invocations of the function can share - // this one value. - - const skull_farmer = Character{}; - - // The "reward_xp" value is interesting. It's a constant value, so - // it could go with other global data. But being such a small - // value, it may also simply be inlined as a literal value in your - // instruction code where it is used. It's up to the compiler. + // The "reward_xp" value is interesting. It's an immutable + // value, so even though it is local, it can be put in global + // data and shared between all invocations. But being such a + // small value, it may also simply be inlined as a literal + // value in your instruction code where it is used. It's up + // to the compiler. const reward_xp: u32 = 200; diff --git a/patches/patches/033_iferror.patch b/patches/patches/033_iferror.patch index 62904db..a1db7b8 100644 --- a/patches/patches/033_iferror.patch +++ b/patches/patches/033_iferror.patch @@ -1,2 +1,2 @@ -36a37 +35a36 > MyNumberError.TooSmall => std.debug.print("<4. ", .{}), diff --git a/patches/patches/051_values.patch b/patches/patches/051_values.patch index 6d3c53b..03dfc88 100644 --- a/patches/patches/051_values.patch +++ b/patches/patches/051_values.patch @@ -1,12 +1,12 @@ -95c95 +90c90 < const print = ???; --- > const print = std.debug.print; -160c160 +155c155 < levelUp(glorp, reward_xp); --- > levelUp(&glorp, reward_xp); -166c166 +161c161 < fn levelUp(character_access: Character, xp: u32) void { --- > fn levelUp(character_access: *Character, xp: u32) void { |