commit 371d77bfabe50949b4e0e5b253f7d9ead369e020
parent 1bc55022dccbbf88df4b6e908b4710ad6d807255
Author: Drew DeVault <sir@cmpwn.com>
Date: Sun, 10 Jan 2021 15:07:08 -0500
04-strings: use const where possible
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tests/04-strings.ha b/tests/04-strings.ha
@@ -7,9 +7,9 @@ fn measurements() void = {
};
fn charptr() void = {
- let x = "Hello!";
- let y = x: *const char;
- let z = y: *[*]u8;
+ const x = "Hello!";
+ const y = x: *const char;
+ const z = y: *[*]u8;
assert(z[0] == 'H': u32: u8);
assert(z[1] == 'e': u32: u8);
assert(z[2] == 'l': u32: u8);