format::desktop_entry: Clean up next
This commit is contained in:
parent
bd5b9f5d75
commit
5ec91331d3
@ -23,13 +23,9 @@ export fn scan(input: io::handle) scanner = scanner {
|
|||||||
// borrowed from the [[scanner]]. Use [[strings::dup]], [[entry_dup]], etc. to
|
// 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]].
|
// retain a copy. If all you want is the file's data, use [[next_entry]].
|
||||||
export fn next(this: *scanner) (line | io::EOF | error) = {
|
export fn next(this: *scanner) (line | io::EOF | error) = {
|
||||||
let text = match (bufio::scan_line(&this.scanner)) {
|
let text = match (bufio::scan_line(&this.scanner)?) {
|
||||||
case let text: const str =>
|
case let text: const str => yield text;
|
||||||
yield text;
|
case io::EOF => return io::EOF;
|
||||||
case let err: (io::error | utf8::invalid) =>
|
|
||||||
return err;
|
|
||||||
case io::EOF =>
|
|
||||||
return io::EOF;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if (text == "") {
|
if (text == "") {
|
||||||
|
Loading…
Reference in New Issue
Block a user