Skip to content

Commit

Permalink
Follow the convention of naming types as UpperCase
Browse files Browse the repository at this point in the history
  • Loading branch information
zah committed Jan 21, 2020
1 parent 6f9da4b commit 9b40199
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions json_rpc/router.nim
Original file line number Diff line number Diff line change
Expand Up @@ -227,15 +227,15 @@ macro rpc*(server: RpcRouter, path: string, body: untyped): untyped =
procBody = if body.kind == nnkStmtList: body else: body.body

if parameters.hasReturnType:
let returnType = parameters[0]
let ReturnType = parameters[0]

# delegate async proc allows return and setting of result as native type
result.add quote do:
proc `doMain`(`paramsIdent`: JsonNode): Future[`returnType`] {.async.} =
proc `doMain`(`paramsIdent`: JsonNode): Future[`ReturnType`] {.async.} =
`setup`
`procBody`

if returnType == ident"JsonNode":
if ReturnType == ident"JsonNode":
# `JsonNode` results don't need conversion
result.add quote do:
proc `procName`(`paramsIdent`: JsonNode): Future[JsonNode] {.async, gcsafe.} =
Expand Down

0 comments on commit 9b40199

Please sign in to comment.