1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

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
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() }