logo

deblob

remove binary executables from a directory git clone https://hacktivis.me/git/deblob.git
commit: c243707acbc1c030fed12db7302f71fb1f38af4d
parent d657bb96551c08cf057823d82660b9a0b2a282e0
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Fri,  6 May 2022 13:26:37 +0200

Keep using io::read in is_blob

io::readall on files <512 bytes would return [[underread]] as an error, meaning
an extra match-case to handle for little to no need as just few bytes are used.

Related to commit cc632e47a371eab73da6b2637a4cba7bda37d0cd.

Diffstat:

Mmain.ha2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/main.ha b/main.ha @@ -26,7 +26,7 @@ fn is_blob(filename: str) (bool | fs::error | io::error) = { const file = os::open(filename)?; defer io::close(file)!; - if (io::readall(file, buffer)? is io::EOF) { + if (io::read(file, buffer)? is io::EOF) { // empty file return false; };