commit 450bb249bc646113c24d74b498d01a1f3664d970
parent 68763770dbc7c585e2a8527ee0d540c87c4c8c01
Author: Sebastian <sebastian@sebsite.pw>
Date: Tue, 17 Oct 2023 21:08:53 -0400
io: use writeall for teestream
Signed-off-by: Sebastian <sebastian@sebsite.pw>
Diffstat:
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/io/tee.ha b/io/tee.ha
@@ -33,17 +33,13 @@ fn tee_read(s: *stream, buf: []u8) (size | EOF | error) = {
case let z: size =>
yield z;
};
- for (let n = 0z; n < z) {
- n += write(s.sink, buf[n..z])?;
- };
+ writeall(s.sink, buf[..z])?;
return z;
};
fn tee_write(s: *stream, buf: const []u8) (size | error) = {
let s = s: *teestream;
const z = write(s.h, buf)?;
- for (let n = 0z; n < z) {
- n += write(s.sink, buf[n..z])?;
- };
+ writeall(s.sink, buf[..z])?;
return z;
};