mirror of
https://github.com/zedeus/nitter
synced 2026-09-05 22:59:31 +00:00
Fix compiler warnings
This commit is contained in:
parent
f02515fda2
commit
7af71ec480
12 changed files with 21 additions and 23 deletions
|
|
@ -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.} =
|
||||
|
|
|
|||
Loading…
Reference in a new issue