commit ba79464342f7aad8841f11b0b3b0eeee6ac99bfd
parent c2032dda507daac991d54b41e55ffce40f8936a9
Author: Armin Preiml <apreiml@strohwolke.at>
Date: Wed, 4 May 2022 11:54:27 +0200
mime: fix match in load_systemdb
strings::try_fromutf8 does not return an io::error
Signed-off-by: Armin Preiml <apreiml@strohwolke.at>
Diffstat:
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/mime/system.ha b/mime/system.ha
@@ -24,7 +24,7 @@ fn load_systemdb() (void | fs::error | io::error) = {
const strm = bufio::buffered(file, buf, []);
for (true) {
- const line = match (bufio::scanline(&strm)?) {
+ const line = match (bufio::scanline(&strm)) {
case let bytes: []u8 =>
yield match (strings::try_fromutf8(bytes)) {
case utf8::invalid =>
@@ -32,13 +32,13 @@ fn load_systemdb() (void | fs::error | io::error) = {
io::close(&strm)?;
io::close(file)?;
return;
- case let err: io::error =>
- io::close(&strm): void;
- io::close(file): void;
- return err;
case let s: str =>
yield s;
};
+ case let err: io::error =>
+ io::close(&strm): void;
+ io::close(file): void;
+ return err;
case io::EOF =>
break;
};