diff options
author | Leah Neukirchen <leah@vuxu.org> | 2022-12-13 13:47:23 +0100 |
---|---|---|
committer | Leah Neukirchen <leah@vuxu.org> | 2022-12-13 13:47:23 +0100 |
commit | 367eba7b1379c2a82fd04f0abaa8130e72ddb9fb (patch) | |
tree | 51c4e4070c89db213b90772f86151a012d46bef1 | |
parent | bbddbd9ff822396e6bcb656fcc0d2c492af0af1a (diff) | |
download | adventofcode2022-367eba7b1379c2a82fd04f0abaa8130e72ddb9fb.tar.gz adventofcode2022-367eba7b1379c2a82fd04f0abaa8130e72ddb9fb.tar.xz adventofcode2022-367eba7b1379c2a82fd04f0abaa8130e72ddb9fb.zip |
day07: use std.mem.startsWith
-rw-r--r-- | day07.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/day07.zig b/day07.zig index edc16df..089f054 100644 --- a/day07.zig +++ b/day07.zig @@ -30,7 +30,7 @@ pub fn main() !void { if (line.len == 0) break; - if (eql(u8, line[0..4], "$ cd")) { + if (std.mem.startsWith(u8, line, "$ cd")) { var parts = std.mem.tokenize(u8, line, " "); _ = parts.next(); _ = parts.next(); @@ -46,7 +46,7 @@ pub fn main() !void { if (dirline[0] == '$') break; _ = lines.next(); - if (eql(u8, dirline[0..4], "dir ")) continue; + if (std.mem.startsWith(u8, dirline, "dir ")) continue; var parts = std.mem.split(u8, dirline, " "); |