commit: cc632e47a371eab73da6b2637a4cba7bda37d0cd
parent ba894102ae802231fcf674769b798b91e84a0abc
Author: Sebastian <sebastian@sebsite.pw>
Date: Thu, 5 May 2022 17:58:04 -0400
Simplify is_blob
Signed-off-by: Sebastian <sebastian@sebsite.pw>
Diffstat:
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/main.ha b/main.ha
@@ -26,10 +26,7 @@ fn is_blob(filename: str) (bool | fs::error | io::error) = {
const file = os::open(filename)?;
defer io::close(file)!;
- const n = match (io::read(file, buffer)?) {
- case let s: size =>
- yield s;
- case io::EOF =>
+ if (io::readall(file, buffer)? is io::EOF) {
// empty file
return false;
};