mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
time: return optional value directly
This commit is contained in:
parent
0050c1915b
commit
1fde205f97
@ -45,10 +45,5 @@ pub fn parse_rfc2822(s string) ?Time {
|
|||||||
count := C.snprintf(charptr(tmstr), (s.len * 2), '%s-%02d-%s %s', fields[3].str, mm,
|
count := C.snprintf(charptr(tmstr), (s.len * 2), '%s-%02d-%s %s', fields[3].str, mm,
|
||||||
fields[1].str, fields[4].str)
|
fields[1].str, fields[4].str)
|
||||||
|
|
||||||
t := parse(tos(tmstr, count)) or {
|
return parse(tos(tmstr, count))
|
||||||
// FIXME Remove this when optional forwarding is fixed.
|
|
||||||
return error('Invalid time format: $s')
|
|
||||||
}
|
|
||||||
|
|
||||||
return t
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user