hare

The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit ab69d42db3385e4af1e5e53f29daed2d1d95d694
parent f1f54f68a82f52d941660fa2e302ce3531de713b
Author: Drew DeVault <sir@cmpwn.com>
Date:   Mon,  1 Feb 2021 10:23:34 -0500

os::fdstream: style

Diffstat:
Mos/+linux/fdstream.ha | 10++++------
1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/os/+linux/fdstream.ha b/os/+linux/fdstream.ha @@ -14,7 +14,7 @@ export fn fdopen(fd: int, name: str) *io::stream = { // should be supported let stream = alloc(*fd_stream, fd_stream { stream = io::stream { - name = strings::dup(name), + name = strings::dup(name), reader = &fd_read, writer = &fd_write, closer = &fd_close, @@ -49,11 +49,9 @@ fn fd_read(s: *io::stream, buf: []u8) (size | io::error) = { let r = rt::read(stream.fd, (&buf: *types::slice).data: *[*]u8, len(buf)); return match (rt::wrap_return(r)) { err: rt::errno => errno_to_io(err), - n: size => { - switch (n) { - 0z => io::closed: io::error, - * => n, - }; + n: size => switch (n) { + 0z => io::closed: io::error, + * => n, }, }; };