From 5ec91331d31d818fb71e0ba7a1e81d2faddf0dd4 Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Mon, 21 Oct 2024 12:40:31 -0400 Subject: [PATCH] format::desktop_entry: Clean up next --- format/desktop_entry/scan.ha | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/format/desktop_entry/scan.ha b/format/desktop_entry/scan.ha index 38ae90b..b82effe 100644 --- a/format/desktop_entry/scan.ha +++ b/format/desktop_entry/scan.ha @@ -23,13 +23,9 @@ export fn scan(input: io::handle) scanner = scanner { // borrowed from the [[scanner]]. Use [[strings::dup]], [[entry_dup]], etc. to // retain a copy. If all you want is the file's data, use [[next_entry]]. export fn next(this: *scanner) (line | io::EOF | error) = { - let text = match (bufio::scan_line(&this.scanner)) { - case let text: const str => - yield text; - case let err: (io::error | utf8::invalid) => - return err; - case io::EOF => - return io::EOF; + let text = match (bufio::scan_line(&this.scanner)?) { + case let text: const str => yield text; + case io::EOF => return io::EOF; }; if (text == "") {