diff options
author | flywind <xzsflywind@gmail.com> | 2021-03-04 18:34:55 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-04 11:34:55 +0100 |
commit | 5670b848cb87d3a437699ecaf67db6a4b35e0626 (patch) | |
tree | f2a128032f053fb0bcbda5797c9b8c56f773b31b /lib/pure | |
parent | c180de60a8ac5459d1e553152132fcfc6cd2fe6f (diff) | |
download | Nim-5670b848cb87d3a437699ecaf67db6a4b35e0626.tar.gz |
use .. warning:: (#17226)
* remove unnecessary when statement * remove outdated codes * use warnings
Diffstat (limited to 'lib/pure')
-rw-r--r-- | lib/pure/algorithm.nim | 3 | ||||
-rw-r--r-- | lib/pure/asyncdispatch.nim | 6 | ||||
-rw-r--r-- | lib/pure/asyncnet.nim | 10 | ||||
-rw-r--r-- | lib/pure/httpclient.nim | 2 |
4 files changed, 10 insertions, 11 deletions
diff --git a/lib/pure/algorithm.nim b/lib/pure/algorithm.nim index 76ea58585..a32df65bb 100644 --- a/lib/pure/algorithm.nim +++ b/lib/pure/algorithm.nim @@ -563,7 +563,8 @@ proc product*[T](x: openArray[seq[T]]): seq[seq[T]] = ## Produces the Cartesian product of the array. ## Every element of the result is a combination of one element from each seq in `x`, ## with the ith element coming from `x[i]`. - ## Warning: complexity may explode. + ## + ## .. warning:: complexity may explode. runnableExamples: assert product(@[@[1], @[2]]) == @[@[1, 2]] assert product(@[@["A", "K"], @["Q"]]) == @[@["K", "Q"], @["A", "Q"]] diff --git a/lib/pure/asyncdispatch.nim b/lib/pure/asyncdispatch.nim index 264c12b18..c225f9b99 100644 --- a/lib/pure/asyncdispatch.nim +++ b/lib/pure/asyncdispatch.nim @@ -435,7 +435,7 @@ when defined(windows) or defined(nimdoc): ## read, or the socket has disconnected in which case the future will ## complete with a value of `""`. ## - ## **Warning**: The `Peek` socket flag is not supported on Windows. + ## .. warning:: The `Peek` socket flag is not supported on Windows. # Things to note: @@ -509,7 +509,7 @@ when defined(windows) or defined(nimdoc): ## has disconnected in which case the future will complete with a value of ## `0`. ## - ## **Warning**: The `Peek` socket flag is not supported on Windows. + ## .. warning:: The `Peek` socket flag is not supported on Windows. # Things to note: @@ -572,7 +572,7 @@ when defined(windows) or defined(nimdoc): ## Sends `size` bytes from `buf` to `socket`. The returned future ## will complete once all data has been sent. ## - ## **WARNING**: Use it with caution. If `buf` refers to GC'ed object, + ## .. warning:: Use it with caution. If `buf` refers to GC'ed object, ## you must use GC_ref/GC_unref calls to avoid early freeing of the buffer. verifyPresence(socket) var retFuture = newFuture[void]("send") diff --git a/lib/pure/asyncnet.nim b/lib/pure/asyncnet.nim index 7db8ce41e..f36c427de 100644 --- a/lib/pure/asyncnet.nim +++ b/lib/pure/asyncnet.nim @@ -517,10 +517,9 @@ proc recvLineInto*(socket: AsyncSocket, resString: FutureVar[string], ## The `maxLength` parameter determines the maximum amount of characters ## that can be read. `resString` will be truncated after that. ## - ## **Warning**: The `Peek` flag is not yet implemented. + ## .. warning:: The `Peek` flag is not yet implemented. ## - ## **Warning**: `recvLineInto` on unbuffered sockets assumes that the - ## protocol uses `\r\L` to delimit a new line. + ## .. warning:: `recvLineInto` on unbuffered sockets assumes that the protocol uses `\r\L` to delimit a new line. assert SocketFlag.Peek notin flags ## TODO: result = newFuture[void]("asyncnet.recvLineInto") @@ -611,10 +610,9 @@ proc recvLine*(socket: AsyncSocket, ## The `maxLength` parameter determines the maximum amount of characters ## that can be read. The result is truncated after that. ## - ## **Warning**: The `Peek` flag is not yet implemented. + ## .. warning:: The `Peek` flag is not yet implemented. ## - ## **Warning**: `recvLine` on unbuffered sockets assumes that the protocol - ## uses `\r\L` to delimit a new line. + ## .. warning:: `recvLine` on unbuffered sockets assumes that the protocol uses `\r\L` to delimit a new line. assert SocketFlag.Peek notin flags ## TODO: # TODO: Optimise this diff --git a/lib/pure/httpclient.nim b/lib/pure/httpclient.nim index 65e3dbd16..9c39cb53b 100644 --- a/lib/pure/httpclient.nim +++ b/lib/pure/httpclient.nim @@ -110,7 +110,7 @@ ## .. code-block:: Nim ## client.onProgressChanged = nil ## -## **Warning:** The `total` reported by httpclient may be 0 in some cases. +## .. warning:: The `total` reported by httpclient may be 0 in some cases. ## ## ## SSL/TLS support |