Writing to FastStreams can have side-effects

This commit is contained in:
Zahary Karadjov 2020-04-14 19:36:15 +03:00
parent 805ef4f1b2
commit 8528ce28b4
No known key found for this signature in database
GPG Key ID: C8936F8A3073D609
1 changed files with 2 additions and 2 deletions

View File

@ -171,7 +171,7 @@ func readVarint*[Stream](input: var Stream,
raise newException(EOFError, "Failed to read a varint")
func appendVarintImpl[Stream](s: var Stream, x: SomeUnsignedInt) {.inline.} =
proc appendVarintImpl[Stream](s: var Stream, x: SomeUnsignedInt) {.inline.} =
mixin append
if x <= 0x7F:
@ -188,7 +188,7 @@ func appendVarintImpl[Stream](s: var Stream, x: SomeUnsignedInt) {.inline.} =
else:
s.append nextByte
func appendVarint*[Stream](s: var Stream, x: SomeInteger,
proc appendVarint*[Stream](s: var Stream, x: SomeInteger,
flavour: static VarintFlavour = ProtoBuf) {.inline.} =
## Writes a varint to a stream (e.g. faststreams.OutputStream)
when x is SomeSignedInt: