mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-18 13:30:33 +00:00
remove un-needed {.push hint[ConvFromXtoItselfNotNeeded]: off.} in asyncfutures, asyncmacro (#17631)
This commit is contained in:
@@ -363,12 +363,10 @@ proc read*[T](future: Future[T] | FutureVar[T]): T =
|
||||
## this function will fail with a `ValueError` exception.
|
||||
##
|
||||
## If the result of the future is an error then that error will be raised.
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
when future is Future[T]:
|
||||
let fut = future
|
||||
else:
|
||||
let fut = Future[T](future)
|
||||
{.pop.}
|
||||
if fut.finished:
|
||||
if fut.error != nil:
|
||||
injectStacktrace(fut)
|
||||
|
||||
@@ -35,14 +35,11 @@ template createCb(retFutureSym, iteratorNameSym,
|
||||
|
||||
if next == nil:
|
||||
if not retFutureSym.finished:
|
||||
let msg = "Async procedure ($1) yielded `nil`, are you await'ing a " &
|
||||
"`nil` Future?"
|
||||
let msg = "Async procedure ($1) yielded `nil`, are you await'ing a `nil` Future?"
|
||||
raise newException(AssertionDefect, msg % strName)
|
||||
else:
|
||||
{.gcsafe.}:
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
next.addCallback cast[proc() {.closure, gcsafe.}](identName)
|
||||
{.pop.}
|
||||
except:
|
||||
futureVarCompletions
|
||||
if retFutureSym.finished:
|
||||
|
||||
Reference in New Issue
Block a user