commit 9fec2b3347b20d6e16d0e2ccaf30cdbe27bf353d
parent f3f5aaa25cd37018dc5bae5e1f9c96e400cc14f1
Author: Sebastian LaVine <mail@smlavine.com>
Date: Fri, 11 Aug 2023 19:54:44 -0400
io: make io::writeall take const []u8
This matches the signature of io::write.
Signed-off-by: Sebastian LaVine <mail@smlavine.com>
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/io/util.ha b/io/util.ha
@@ -25,7 +25,7 @@ export fn readall(in: handle, buf: []u8) (size | EOF | error) = {
// Writes an entire buffer, perhaps issuing several [[write]] calls to do so.
// Aborts on errors after partial writes. Hence it should only be used if it is
// certain that the underlying writes will not fail after an initial write.
-export fn writeall(out: handle, buf: []u8) (size | error) = {
+export fn writeall(out: handle, buf: const []u8) (size | error) = {
let z: size = 0;
for (z < len(buf)) {
z += match (write(out, buf[z..])) {