From a2b85a8126b25590ddbffc17b568f4e88cd6caba Mon Sep 17 00:00:00 2001 From: cheatfate Date: Wed, 27 Mar 2019 07:54:41 +0200 Subject: [PATCH] Fix for `$`(0). --- chronos/timer.nim | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/chronos/timer.nim b/chronos/timer.nim index 10b73da..72208a5 100644 --- a/chronos/timer.nim +++ b/chronos/timer.nim @@ -400,8 +400,7 @@ func `$`*(a: Duration): string {.inline.} = if v >= Microsecond.value: result &= $(v div Microsecond.value) & "us" v = v mod Microsecond.value - if v >= Nanosecond.value: - result &= $(v div Nanosecond.value) & "ns" + result &= $(v div Nanosecond.value) & "ns" func `$`*(a: Moment): string {.inline.} = ## Returns string representation of Moment ``a`` as nanoseconds value.