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

all: automatic error propagation in place of "or { return(err) }"

This commit is contained in:
Maciej Obarski
2020-08-29 01:58:03 +02:00
committed by GitHub
parent 4d425b0e6d
commit 7bd2804ce9
23 changed files with 79 additions and 235 deletions

View File

@ -19,9 +19,7 @@ pub fn int_u64(max u64) ?u64 {
}
mut n := u64(0)
for {
mut bytes := read(k) or {
return error(err)
}
mut bytes := read(k)?
bytes[0] &= byte(int(u64(1)<<b) - 1)
x := bytes_to_u64(bytes)
n = x[0]