aboutsummaryrefslogtreecommitdiff
path: root/src/io.zig
diff options
context:
space:
mode:
authorJulien Dessaux2024-11-22 09:27:23 +0100
committerJulien Dessaux2024-11-22 09:28:09 +0100
commit06468c1272035fcacf6d46a80b5738b55cffae38 (patch)
tree55ae36dc5c9d25cbf73da49c6bd6c887fe79605f /src/io.zig
parentRemoved useless testing boilerplate (diff)
downloadzigfunge98-06468c1272035fcacf6d46a80b5738b55cffae38.tar.gz
zigfunge98-06468c1272035fcacf6d46a80b5738b55cffae38.tar.bz2
zigfunge98-06468c1272035fcacf6d46a80b5738b55cffae38.zip
zig 0.12 and 0.13 changesHEADmaster
Diffstat (limited to '')
-rw-r--r--src/io.zig6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/io.zig b/src/io.zig
index b37d172..66b19be 100644
--- a/src/io.zig
+++ b/src/io.zig
@@ -12,14 +12,14 @@ pub fn Context(comptime readerType: anytype, comptime writerType: anytype) type
return c;
}
var buffer = [_]u8{0};
- var n = try self.reader.read(buffer[0..]);
+ const n = try self.reader.read(buffer[0..]);
if (n == 1) {
return buffer[0];
}
return error.IOError;
}
test "characterInput" {
- var stdin = std.io.fixedBufferStream("ab0");
+ const stdin = std.io.fixedBufferStream("ab0");
var stdout = std.ArrayList(u8).init(std.testing.allocator);
defer stdout.deinit();
var ioContext = context(stdin, stdout);
@@ -49,7 +49,7 @@ pub fn Context(comptime readerType: anytype, comptime writerType: anytype) type
return result;
}
test "decimalInput" {
- var stdin = std.io.fixedBufferStream("1 234abc5d6ef");
+ const stdin = std.io.fixedBufferStream("1 234abc5d6ef");
var stdout = std.ArrayList(u8).init(std.testing.allocator);
defer stdout.deinit();
var ioContext = context(stdin, stdout);