times.nim: minor code cleanup
This commit is contained in:
parent
6fd0a33265
commit
fab4498727
1 changed files with 2 additions and 3 deletions
|
|
@ -608,7 +608,6 @@ proc stringifyUnit(value: int | int64, unit: TimeUnit): string =
|
|||
|
||||
proc humanizeParts(parts: seq[string]): string =
|
||||
## Make date string parts human-readable
|
||||
|
||||
result = ""
|
||||
if parts.len == 0:
|
||||
result.add "0 nanoseconds"
|
||||
|
|
@ -617,8 +616,8 @@ proc humanizeParts(parts: seq[string]): string =
|
|||
elif parts.len == 2:
|
||||
result = parts[0] & " and " & parts[1]
|
||||
else:
|
||||
for part in parts[0..high(parts)-1]:
|
||||
result.add part & ", "
|
||||
for i in 0..high(parts)-1:
|
||||
result.add parts[i] & ", "
|
||||
result.add "and " & parts[high(parts)]
|
||||
|
||||
proc `$`*(dur: Duration): string =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue