Fix compiler warnings

This commit is contained in:
Zed
2021-12-20 03:11:12 +01:00
parent f02515fda2
commit 7af71ec480
12 changed files with 21 additions and 23 deletions

View File

@@ -43,14 +43,14 @@ template getError*(js: JsonNode): Error =
if js.kind != JArray or js.len == 0: null
else: Error(js[0]{"code"}.getInt)
template parseTime(time: string; f: static string; flen: int): Time =
template parseTime(time: string; f: static string; flen: int): DateTime =
if time.len != flen: return
parse(time, f).toTime
parse(time, f, utc())
proc getDateTime*(js: JsonNode): Time =
proc getDateTime*(js: JsonNode): DateTime =
parseTime(js.getStr, "yyyy-MM-dd\'T\'HH:mm:ss\'Z\'", 20)
proc getTime*(js: JsonNode): Time =
proc getTime*(js: JsonNode): DateTime =
parseTime(js.getStr, "ddd MMM dd hh:mm:ss \'+0000\' yyyy", 30)
proc getId*(id: string): string {.inline.} =