mirror of https://github.com/vacp2p/nim-libp2p.git
Fix compilation error.
This commit is contained in:
parent
a7c54c76fb
commit
8b00514dd7
|
@ -607,7 +607,7 @@ proc init*(mtype: typedesc[MultiAddress], value: string): MultiAddress =
|
|||
"Missing protocol '" & part & "' argument")
|
||||
|
||||
if proto.kind in {Fixed, Length}:
|
||||
result.data.writeCodec(proto.mcodec)
|
||||
result.data.write(proto.mcodec)
|
||||
let res = proto.coder.stringToBuffer(parts[offset + 1], result.data)
|
||||
if not res:
|
||||
raise newException(MultiAddressError,
|
||||
|
@ -615,13 +615,13 @@ proc init*(mtype: typedesc[MultiAddress], value: string): MultiAddress =
|
|||
offset += 2
|
||||
elif proto.kind == Path:
|
||||
var path = "/" & (parts[(offset + 1)..^1].join("/"))
|
||||
result.data.writeCodec(proto.mcodec)
|
||||
result.data.write(proto.mcodec)
|
||||
if not proto.coder.stringToBuffer(path, result.data):
|
||||
raise newException(MultiAddressError,
|
||||
"Error encoding `$1/$2`" % [part, path])
|
||||
break
|
||||
elif proto.kind == Marker:
|
||||
result.data.writeCodec(proto.mcodec)
|
||||
result.data.write(proto.mcodec)
|
||||
offset += 1
|
||||
result.data.finish()
|
||||
|
||||
|
|
Loading…
Reference in New Issue