mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-08 14:03:23 +00:00
remove unnecessary await (#24501)
There is already a when condition, so `await` is not needed to split the
function
(cherry picked from commit 6bbf9c3117)
This commit is contained in:
@@ -864,7 +864,7 @@ proc parseResponse(client: HttpClient | AsyncHttpClient,
|
||||
while true:
|
||||
linei = 0
|
||||
when client is HttpClient:
|
||||
line = await client.socket.recvLine(client.timeout)
|
||||
line = client.socket.recvLine(client.timeout)
|
||||
else:
|
||||
line = await client.socket.recvLine()
|
||||
if line == "":
|
||||
@@ -970,7 +970,7 @@ proc newConnection(client: HttpClient | AsyncHttpClient,
|
||||
else: nativesockets.Port(connectionUrl.port.parseInt)
|
||||
|
||||
when client is HttpClient:
|
||||
client.socket = await net.dial(connectionUrl.hostname, port)
|
||||
client.socket = net.dial(connectionUrl.hostname, port)
|
||||
elif client is AsyncHttpClient:
|
||||
client.socket = await asyncnet.dial(connectionUrl.hostname, port)
|
||||
else: {.fatal: "Unsupported client type".}
|
||||
|
||||
Reference in New Issue
Block a user