summary refs log tree commit diff stats
path: root/lib/pure
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2019-02-20 12:30:51 +0100
committerAraq <rumpf_a@web.de>2019-02-20 12:30:51 +0100
commitffd0f812471b78d15863b8299b7db35fa1951c77 (patch)
tree9ecd698ac0fd79b84bbeca8842c7be029d0f4825 /lib/pure
parent2990a5ea5416520596b158a7fcb96106763e680f (diff)
downloadNim-ffd0f812471b78d15863b8299b7db35fa1951c77.tar.gz
times.nim: avoid some stdlib dependencies
Diffstat (limited to 'lib/pure')
-rw-r--r--lib/pure/times.nim10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/pure/times.nim b/lib/pure/times.nim
index 09ec786b5..cc6a61b21 100644
--- a/lib/pure/times.nim
+++ b/lib/pure/times.nim
@@ -187,7 +187,7 @@
   the same as 25 hours.
 ]##
 
-import strutils, algorithm, math, options, strformat
+import strutils, math, options
 
 include "system/inclrtl"
 
@@ -1757,7 +1757,7 @@ proc `$`*(f: TimeFormat): string =
 
 proc raiseParseException(f: TimeFormat, input: string, msg: string) =
   raise newException(TimeParseError,
-                     &"Failed to parse '{input}' with format '{f}'. {msg}")
+                     "Failed to parse '" & input & "' with format '" & $f & "'. " & msg)
 
 proc parseInt(s: string, b: var int, start = 0, maxLen = int.high,
               allowSign = false): int =
@@ -1809,7 +1809,7 @@ iterator tokens(f: string): tuple[kind: FormatTokenKind, token: string] =
 
         if i > f.high:
           raise newException(TimeFormatParseError,
-                             &"Unclosed ' in time format string. " &
+                             "Unclosed ' in time format string. " &
                              "For a literal ', use ''.")
         i.inc
         yield (tkLiteral, token)
@@ -1866,7 +1866,7 @@ proc stringToPattern(str: string): FormatPattern =
   of "zzzz": result = zzzz
   of "g": result = g
   else: raise newException(TimeFormatParseError,
-                           &"'{str}' is not a valid pattern")
+                           "'" & str & "' is not a valid pattern")
 
 proc initTimeFormat*(format: string): TimeFormat =
   ## Construct a new time format for parsing & formatting time types.
@@ -2377,7 +2377,7 @@ proc parse*(input: string, f: TimeFormat, zone: Timezone = local()): DateTime
         patIdx.inc
     else:
       if not parsePattern(input, pattern, inpIdx, parsed):
-        raiseParseException(f, input, &"Failed on pattern '{pattern}'")
+        raiseParseException(f, input, "Failed on pattern '" & $pattern & "'")
       patIdx.inc
 
   if inpIdx <= input.high: