style fixes (#108)

This commit is contained in:
Jacek Sieka 2022-04-08 11:11:53 +02:00 committed by GitHub
parent 4a7a058843
commit 14d852e0d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 9 deletions

View File

@ -137,7 +137,7 @@ proc parseExt*[T: BChar](data: openArray[T], output: var seq[AppExt]): bool =
ext.params[^1].name = system.move(param.name)
ext.params[^1].value = system.move(param.value)
if lex.tok notin {tkSemCol, tkComma, tkEof}:
if lex.tok notin {tkSemcol, tkComma, tkEof}:
return false
output.setLen(output.len + 1)

View File

@ -149,12 +149,10 @@ proc handleTlsConnCb(
maxVersion = tlsHttpServer.maxVersion,
flags = tlsHttpServer.tlsFlags)
var stream: AsyncStream
try:
stream = AsyncStream(
let stream = AsyncStream(
reader: tlsStream.reader,
writer: tlsStream.writer)
try:
let httpServer = HttpServer(server)
let request = await httpServer.parseRequest(stream)
@ -164,9 +162,7 @@ proc handleTlsConnCb(
finally:
await stream.closeWait()
proc accept*(server: HttpServer): Future[HttpRequest]
{.async, raises: [Defect, HttpError].} =
proc accept*(server: HttpServer): Future[HttpRequest] {.async.} =
if not isNil(server.handler):
raise newException(HttpError,
"Callback already registered - cannot mix callback and accepts styles!")

View File

@ -153,7 +153,7 @@ proc handleClose*(
code = StatusFulfilled
reason = ""
case payload.len:
case payLoad.len:
of 0:
code = StatusNoStatus
of 1: