format::desktop_entry: Clean up next

This commit is contained in:
Sasha Koshka 2024-10-21 12:40:31 -04:00
parent bd5b9f5d75
commit 5ec91331d3

View File

@ -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 == "") {