diff --git a/vlib/cli/flag.v b/vlib/cli/flag.v index 64af6a2693..086dfb02c7 100644 --- a/vlib/cli/flag.v +++ b/vlib/cli/flag.v @@ -32,9 +32,7 @@ pub fn (flag Flag) get_bool() ?bool { } pub fn (flags []Flag) get_bool(name string) ?bool { - flag := flags.get(name) or { - return error(err) - } + flag := flags.get(name)? return flag.get_bool() } @@ -53,9 +51,7 @@ pub fn (flag Flag) get_int() ?int { } pub fn (flags []Flag) get_int(name string) ?int { - flag := flags.get(name) or { - return error(err) - } + flag := flags.get(name)? return flag.get_int() } @@ -74,9 +70,7 @@ pub fn (flag Flag) get_float() ?f64 { } pub fn (flags []Flag) get_float(name string) ?f64 { - flag := flags.get(name) or { - return error(err) - } + flag := flags.get(name)? return flag.get_float() } @@ -95,9 +89,7 @@ pub fn (flag Flag) get_string() ?string { } pub fn (flags []Flag) get_string(name string) ?string { - flag := flags.get(name) or { - return error(err) - } + flag := flags.get(name)? return flag.get_string() } @@ -112,14 +104,10 @@ pub fn (flags []Flag) get_string_or(name, or_value string) string { fn (mut flag Flag) parse(args []string, with_abbrev bool) ?[]string { if flag.matches(args, with_abbrev) { if flag.flag == .bool { - new_args := flag.parse_bool(args) or { - return error(err) - } + new_args := flag.parse_bool(args)? return new_args } else { - new_args := flag.parse_raw(args) or { - return error(err) - } + new_args := flag.parse_raw(args)? return new_args } } else { diff --git a/vlib/crypto/rand/utils.v b/vlib/crypto/rand/utils.v index 14796acb84..d5f852b026 100644 --- a/vlib/crypto/rand/utils.v +++ b/vlib/crypto/rand/utils.v @@ -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)< 1 { '?' + v[1] } else { '' } return &Uri{