mirror of
https://github.com/codex-storage/nim-libp2p.git
synced 2025-01-12 03:54:06 +00:00
adding bool suport to protobuf methods
This commit is contained in:
parent
003b72ec27
commit
875ec346e6
@ -90,6 +90,11 @@ proc initProtoField*(index: int, value: SomeVarint): ProtoField =
|
||||
else:
|
||||
result.vint = cast[uint64](value)
|
||||
|
||||
proc initProtoField*(index: int, value: bool): ProtoField =
|
||||
## Initialize ProtoField with integer value.
|
||||
result = ProtoField(kind: Varint, index: index)
|
||||
result.vint = byte(value)
|
||||
|
||||
proc initProtoField*(index: int, value: openarray[byte]): ProtoField =
|
||||
## Initialize ProtoField with bytes array.
|
||||
result = ProtoField(kind: Length, index: index)
|
||||
|
Loading…
x
Reference in New Issue
Block a user