Remove `var ref` on `rpc` macro and just take ref

This commit is contained in:
coffeepots 2018-06-04 15:34:48 +01:00
parent db55114233
commit 6bfb4facc2
2 changed files with 2 additions and 2 deletions

View File

@ -44,7 +44,7 @@ proc hasReturnType(params: NimNode): bool =
if params != nil and params.len > 0 and params[0] != nil and params[0].kind != nnkEmpty:
result = true
macro rpc*(server: var RpcServer, path: string, body: untyped): untyped =
macro rpc*(server: RpcServer, path: string, body: untyped): untyped =
result = newStmtList()
let
parameters = body.findChild(it.kind == nnkFormalParams)

View File

@ -5,7 +5,7 @@ var srv = newRpcServer()
srv.address = "localhost"
srv.port = Port(8545)
proc makeProc(server: var RpcServer) =
proc makeProc(server: RpcServer) =
server.rpc("myProc") do(input: string, data: array[0..3, int]):
result = %("Hello " & input & " data: " & $data)