fixes #11723
This commit is contained in:
parent
dd7dd1b6dc
commit
76f9ddb6ab
2 changed files with 20 additions and 2 deletions
|
|
@ -415,7 +415,7 @@ proc parseStandardFormatSpecifier*(s: string; start = 0;
|
|||
raise newException(ValueError,
|
||||
"invalid format string, cannot parse: " & s[i..^1])
|
||||
|
||||
proc formatValue*(result: var string; value: SomeInteger; specifier: string) =
|
||||
proc formatValue*[T: SomeInteger](result: var string; value: T; specifier: string) =
|
||||
## Standard format implementation for ``SomeInteger``. It makes little
|
||||
## sense to call this directly, but it is required to exist
|
||||
## by the ``&`` macro.
|
||||
|
|
@ -509,7 +509,7 @@ proc formatValue*(result: var string; value: string; specifier: string) =
|
|||
setLen(value, runeOffset(value, spec.precision))
|
||||
result.add alignString(value, spec.minimumWidth, spec.align, spec.fill)
|
||||
|
||||
proc formatValue[T](result: var string; value: T; specifier: string) =
|
||||
proc formatValue[T: not SomeInteger](result: var string; value: T; specifier: string) =
|
||||
mixin `$`
|
||||
formatValue(result, $value, specifier)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue