os: refactor err == IError(os.Eof{}) to err is os.Eof

This commit is contained in:
Delyan Angelov 2022-11-16 00:53:37 +02:00
parent ddc1a1fc08
commit 9bb1867be0
No known key found for this signature in database
GPG key ID: 66886C0F12D595ED
3 changed files with 4 additions and 4 deletions

View file

@ -89,7 +89,7 @@ fn slurp_file_in_builder(fp &C.FILE) !strings.Builder {
mut sb := strings.new_builder(os.buf_size)
for {
mut read_bytes := fread(&buf[0], 1, os.buf_size, fp) or {
if err == IError(Eof{}) {
if err is Eof {
break
}
unsafe { sb.free() }