time: return optional value directly

pull/4351/head
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
1 changed files with 1 additions and 6 deletions

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))
}