add -d:nimStrictMode in CI to keep code from regressing; fixes ConvFromXtoItselfNotNeeded, UnusedImport notes (#16764)
This commit is contained in:
parent
35e14998ec
commit
31bb67a309
20 changed files with 43 additions and 23 deletions
|
|
@ -1279,7 +1279,7 @@ else:
|
|||
var newList = newSeqOfCap[Callback](newLength)
|
||||
|
||||
var cb = curList[0]
|
||||
if not cb(fd.AsyncFD):
|
||||
if not cb(fd):
|
||||
newList.add(cb)
|
||||
|
||||
withData(p.selector, fd.int, adata) do:
|
||||
|
|
|
|||
|
|
@ -364,7 +364,10 @@ proc read*[T](future: Future[T] | FutureVar[T]): T =
|
|||
##
|
||||
## If the result of the future is an error then that error will be raised.
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
let fut = Future[T](future)
|
||||
when future is Future[T]:
|
||||
let fut = future
|
||||
else:
|
||||
let fut = Future[T](future)
|
||||
{.pop.}
|
||||
if fut.finished:
|
||||
if fut.error != nil:
|
||||
|
|
|
|||
|
|
@ -20,7 +20,9 @@ when defined(windows):
|
|||
import winlean
|
||||
from os import absolutePath
|
||||
else:
|
||||
import os, osproc
|
||||
import os
|
||||
when not defined(osx):
|
||||
import osproc
|
||||
|
||||
const osOpenCmd* =
|
||||
when defined(macos) or defined(macosx) or defined(windows): "open" else: "xdg-open" ## \
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ runnableExamples:
|
|||
|
||||
include "system/inclrtl"
|
||||
|
||||
when not defined(windows):
|
||||
when defined(linux):
|
||||
import posix
|
||||
|
||||
when defined(freebsd) or defined(macosx):
|
||||
|
|
|
|||
|
|
@ -88,7 +88,6 @@
|
|||
import std/private/since
|
||||
|
||||
import nativesockets, os, strutils, times, sets, options, std/monotimes
|
||||
from ssl_certs import scanSSLCertificates
|
||||
import ssl_config
|
||||
export nativesockets.Port, nativesockets.`$`, nativesockets.`==`
|
||||
export Domain, SockType, Protocol
|
||||
|
|
@ -101,6 +100,8 @@ when useWinVersion:
|
|||
|
||||
when defineSsl:
|
||||
import openssl
|
||||
when not defined(nimDisableCertificateValidation):
|
||||
from ssl_certs import scanSSLCertificates
|
||||
|
||||
# Note: The enumerations are mapped to Window's constants.
|
||||
|
||||
|
|
@ -670,7 +671,7 @@ when defineSsl:
|
|||
# That means we can assume that the next internal index is the length of
|
||||
# extra data indexes.
|
||||
for i in ctx.referencedData:
|
||||
GC_unref(getExtraData(ctx, i).RootRef)
|
||||
GC_unref(getExtraData(ctx, i))
|
||||
ctx.context.SSL_CTX_free()
|
||||
|
||||
proc `pskIdentityHint=`*(ctx: SslContext, hint: string) =
|
||||
|
|
|
|||
|
|
@ -1234,7 +1234,7 @@ elif not defined(useNimRtl):
|
|||
|
||||
when defined(macosx) or defined(freebsd) or defined(netbsd) or
|
||||
defined(openbsd) or defined(dragonfly):
|
||||
import kqueue, times
|
||||
import kqueue
|
||||
|
||||
proc waitForExit(p: Process, timeout: int = -1): int =
|
||||
if p.exitFlag:
|
||||
|
|
|
|||
|
|
@ -769,8 +769,6 @@ proc getch*(): char =
|
|||
discard fd.tcSetAttr(TCSADRAIN, addr oldMode)
|
||||
|
||||
when defined(windows):
|
||||
from unicode import toUTF8, Rune, runeLenAt
|
||||
|
||||
proc readPasswordFromStdin*(prompt: string, password: var string):
|
||||
bool {.tags: [ReadIOEffect, WriteIOEffect].} =
|
||||
## Reads a `password` from stdin without printing it. `password` must not
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue