Skip to content

Commit

Permalink
fix chronos v4 compat (#982)
Browse files Browse the repository at this point in the history
  • Loading branch information
arnetheduck authored and diegomrsantos committed Dec 13, 2023
1 parent 41649f0 commit d273195
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion libp2p/errors.nim
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ func toException*(e: string): ref LPError =
# sadly nim needs more love for hygienic templates
# so here goes the macro, its based on the proc/template version
# and uses quote do so it's quite readable
macro checkFutures*[T](futs: seq[Future[T]], exclude: untyped = []): untyped =
# TODO https://github.com/nim-lang/Nim/issues/22936
macro checkFutures*[F](futs: seq[F], exclude: untyped = []): untyped =
let nexclude = exclude.len
case nexclude
of 0:
Expand Down
2 changes: 1 addition & 1 deletion libp2p/transports/tcptransport.nim
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ method accept*(self: TcpTransport): Future[Connection] {.async, gcsafe.} =

try:
if self.acceptFuts.len <= 0:
self.acceptFuts = self.servers.mapIt(it.accept())
self.acceptFuts = self.servers.mapIt(Future[StreamTransport](it.accept()))

if self.acceptFuts.len <= 0:
return
Expand Down

0 comments on commit d273195

Please sign in to comment.