From 962f58b436141eb8a02a54baa057642ebb6319dc Mon Sep 17 00:00:00 2001 From: Dmitriy Ryajov Date: Fri, 6 Sep 2019 00:53:29 -0600 Subject: [PATCH] avoid wrapping in several futures --- libp2p/stream/bufferstream.nim | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libp2p/stream/bufferstream.nim b/libp2p/stream/bufferstream.nim index b15045e19..ee32fee3f 100644 --- a/libp2p/stream/bufferstream.nim +++ b/libp2p/stream/bufferstream.nim @@ -232,8 +232,8 @@ method readUntil*(s: BufferStream, method write*(s: BufferStream, pbytes: pointer, - nbytes: int) - {.async, gcsafe.} = + nbytes: int): Future[void] + {.gcsafe.} = ## Consume (discard) all bytes (n <= 0) or ``n`` bytes from read-only stream ## ``rstream``. ## @@ -244,8 +244,8 @@ method write*(s: BufferStream, method write*(s: BufferStream, msg: string, - msglen = -1) - {.async, gcsafe.} = + msglen = -1): Future[void] + {.gcsafe.} = ## Write string ``sbytes`` of length ``msglen`` to writer stream ``wstream``. ## ## String ``sbytes`` must not be zero-length. @@ -259,8 +259,8 @@ method write*(s: BufferStream, method write*(s: BufferStream, msg: seq[byte], - msglen = -1) - {.async, gcsafe.} = + msglen = -1): Future[void] + {.gcsafe.} = ## Write sequence of bytes ``sbytes`` of length ``msglen`` to writer ## stream ``wstream``. ##