summary refs log tree commit diff stats
path: root/lib/pure
diff options
context:
space:
mode:
authorTimothee Cour <timothee.cour2@gmail.com>2021-03-23 00:28:53 -0700
committerGitHub <noreply@github.com>2021-03-23 08:28:53 +0100
commit4f9aaee1d9a30976e4ca9bff6fb428960a6b92b0 (patch)
tree10413f2918ba04ccdc5f5a6f84c72ab250674602 /lib/pure
parenta75c4b70e86705c98a4006aa8475a10a0ebf94ec (diff)
downloadNim-4f9aaee1d9a30976e4ca9bff6fb428960a6b92b0.tar.gz
remove redundant void return in stdlib (#17464)
Diffstat (limited to 'lib/pure')
-rw-r--r--lib/pure/concurrency/threadpool.nim4
-rw-r--r--lib/pure/coro.nim3
-rw-r--r--lib/pure/json.nim2
-rw-r--r--lib/pure/net.nim2
4 files changed, 5 insertions, 6 deletions
diff --git a/lib/pure/concurrency/threadpool.nim b/lib/pure/concurrency/threadpool.nim
index 905e668ce..9beb39522 100644
--- a/lib/pure/concurrency/threadpool.nim
+++ b/lib/pure/concurrency/threadpool.nim
@@ -451,14 +451,14 @@ proc preferSpawn*(): bool =
   ## <#spawnX.t>`_ instead.
   result = gSomeReady.counter > 0
 
-proc spawn*(call: sink typed): void {.magic: "Spawn".}
+proc spawn*(call: sink typed) {.magic: "Spawn".}
   ## Always spawns a new task, so that the `call` is never executed on
   ## the calling thread.
   ##
   ## `call` has to be a proc call `p(...)` where `p` is gcsafe and has a
   ## return type that is either `void` or compatible with `FlowVar[T]`.
 
-proc pinnedSpawn*(id: ThreadId; call: sink typed): void {.magic: "Spawn".}
+proc pinnedSpawn*(id: ThreadId; call: sink typed) {.magic: "Spawn".}
   ## Always spawns a new task on the worker thread with `id`, so that
   ## the `call` is **always** executed on the thread.
   ##
diff --git a/lib/pure/coro.nim b/lib/pure/coro.nim
index 21675928d..af8acf268 100644
--- a/lib/pure/coro.nim
+++ b/lib/pure/coro.nim
@@ -273,8 +273,7 @@ proc start*(c: proc(), stacksize: int = defaultStackSize): CoroutineRef {.discar
     coro = cast[CoroutinePtr](alloc0(sizeof(Coroutine)))
     coro.execContext = CreateFiberEx(stacksize, stacksize,
       FIBER_FLAG_FLOAT_SWITCH,
-      (proc(p: pointer): void {.stdcall.} = runCurrentTask()),
-      nil)
+      (proc(p: pointer) {.stdcall.} = runCurrentTask()), nil)
     coro.stack.size = stacksize
   else:
     coro = cast[CoroutinePtr](alloc0(sizeof(Coroutine) + stacksize))
diff --git a/lib/pure/json.nim b/lib/pure/json.nim
index 13cd3fb85..c09af32f3 100644
--- a/lib/pure/json.nim
+++ b/lib/pure/json.nim
@@ -1165,7 +1165,7 @@ when defined(nimFixedForwardGeneric):
   proc initFromJson[T: distinct](dst: var T; jsonNode: JsonNode; jsonPath: var string) =
     assignDistinctImpl(dst, jsonNode, jsonPath)
 
-  proc detectIncompatibleType(typeExpr, lineinfoNode: NimNode): void =
+  proc detectIncompatibleType(typeExpr, lineinfoNode: NimNode) =
     if typeExpr.kind == nnkTupleConstr:
       error("Use a named tuple instead of: " & typeExpr.repr, lineinfoNode)
 
diff --git a/lib/pure/net.nim b/lib/pure/net.nim
index 37e6e8f5a..b37782271 100644
--- a/lib/pure/net.nim
+++ b/lib/pure/net.nim
@@ -200,7 +200,7 @@ when defined(nimHasStyleChecks):
 
 proc socketError*(socket: Socket, err: int = -1, async = false,
                   lastError = (-1).OSErrorCode,
-                  flags: set[SocketFlag] = {}): void {.gcsafe.}
+                  flags: set[SocketFlag] = {}) {.gcsafe.}
 
 proc isDisconnectionError*(flags: set[SocketFlag],
     lastError: OSErrorCode): bool =