Clean up err != nil usage

This commit is contained in:
gingerBill
2024-08-04 11:26:35 +01:00
parent 29b6eebcd5
commit a241168142
5 changed files with 21 additions and 33 deletions
+4 -6
View File
@@ -219,12 +219,10 @@ _processor_core_count :: proc() -> int {
return 1
}
file_size :: proc(fd: Handle) -> (i64, Errno) {
stat, err := wasi.fd_filestat_get(wasi.fd_t(fd))
if err != nil {
return 0, Platform_Error(err)
}
return i64(stat.size), nil
file_size :: proc(fd: Handle) -> (size: i64, err: Errno) {
stat := wasi.fd_filestat_get(wasi.fd_t(fd)) or_return
size = i64(stat.size)
return
}