1
0
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:
Alexey 2020-04-11 19:56:39 +03:00 committed by GitHub
parent 0050c1915b
commit 1fde205f97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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,
fields[1].str, fields[4].str)
t := parse(tos(tmstr, count)) or {
// FIXME Remove this when optional forwarding is fixed.
return error('Invalid time format: $s')
}
return t
return parse(tos(tmstr, count))
}