hare

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

commit 0eca26b7957a2602565278493fd4d2c3a1925919
parent 380529eb5ac3325ea7cc741f00ba76b754d70d7c
Author: Alexey Yerin <yyp@disroot.org>
Date:   Mon, 23 Jan 2023 21:47:17 +0300

bufio::scanbyte: remove underread check

io::readall handles this case automatically.
Signed-off-by: Alexey Yerin <yyp@disroot.org>

Diffstat:
Mbufio/scanner.ha | 10+++-------
1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/bufio/scanner.ha b/bufio/scanner.ha @@ -1,5 +1,5 @@ // License: MPL-2.0 -// (c) 2021-2022 Alexey Yerin <yyp@disroot.org> +// (c) 2021-2023 Alexey Yerin <yyp@disroot.org> // (c) 2021 Drew DeVault <sir@cmpwn.com> // (c) 2021 Ember Sawady <ecs@d2evs.net> use bytes; @@ -13,12 +13,8 @@ export fn scanbyte(file: io::handle) (u8 | io::EOF | io::error) = { let buf: [1]u8 = [0...]; match (io::readall(file, buf)?) { - case let read: size => - if (read > 0) { - return buf[0]; - } else { - return io::EOF; - }; + case size => + return buf[0]; case io::EOF => return io::EOF; };