mirror of https://github.com/status-im/nim-rlp.git
Alternative fix for the Nimble binary-only package problem
This commit is contained in:
parent
1d721f4eca
commit
8114c9fe1e
|
@ -6,9 +6,8 @@ author = "Status Research & Development GmbH"
|
||||||
description = "RLP serialization library for Nim"
|
description = "RLP serialization library for Nim"
|
||||||
license = "Apache License 2.0"
|
license = "Apache License 2.0"
|
||||||
skipDirs = @["tests"]
|
skipDirs = @["tests"]
|
||||||
|
installDirs = @["rlp"]
|
||||||
bin = @["rlp/bin/rlp_inspect"]
|
bin = @["rlp/bin/rlp_inspect"]
|
||||||
# avoid being considered a binary-only package: https://github.com/nim-lang/nimble/blob/66d79bf9a0970542351988fa31f487a1e70144f7/src/nimblepkg/packageparser.nim#L280
|
|
||||||
installExt = @["nim"]
|
|
||||||
|
|
||||||
requires "nim >= 0.17.0",
|
requires "nim >= 0.17.0",
|
||||||
"ranges"
|
"ranges"
|
||||||
|
|
|
@ -241,14 +241,14 @@ proc appendImpl(self; data: tuple) {.inline.} =
|
||||||
|
|
||||||
# We define a single `append` template with a pretty low specifity
|
# We define a single `append` template with a pretty low specifity
|
||||||
# score in order to facilitate easier overloading with user types:
|
# score in order to facilitate easier overloading with user types:
|
||||||
template append*[T](self; data: T) =
|
template append*[T](w: var RlpWriter; data: T) =
|
||||||
when data is float64:
|
when data is float64:
|
||||||
# XXX: This works around an overloading bug.
|
# XXX: This works around an overloading bug.
|
||||||
# Apparently, integer literals will be converted to `float64`
|
# Apparently, integer literals will be converted to `float64`
|
||||||
# values with higher precedence than the generic match to Integer
|
# values with higher precedence than the generic match to Integer
|
||||||
appendFloat(self, data)
|
appendFloat(w, data)
|
||||||
else:
|
else:
|
||||||
appendImpl(self, data)
|
appendImpl(w, data)
|
||||||
|
|
||||||
proc initRlpList*(listSize: int): RlpWriter =
|
proc initRlpList*(listSize: int): RlpWriter =
|
||||||
result = initRlpWriter()
|
result = initRlpWriter()
|
||||||
|
|
Loading…
Reference in New Issue