summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorTimothee Cour <timothee.cour2@gmail.com>2020-03-13 12:42:41 -0700
committerGitHub <noreply@github.com>2020-03-13 20:42:41 +0100
commit6e0c06f50e0450522b32a1bad23a3d2a4e36e9f9 (patch)
tree99acceaabd5a5131343a0fa5305aff8b54c0e829 /lib
parent380a505507a6df9cbb1fe77b5b6251dc14894921 (diff)
downloadNim-6e0c06f50e0450522b32a1bad23a3d2a4e36e9f9.tar.gz
fix #13218: avoid some irrelevant warnings for nim doc,rst2html,--app:lib, + other fixes (#13550)
* fix #13218: avoid some irrelevant warnings for nim doc,rst2html
* suppress warnRedefinitionOfLabel for nim doc
* lots of fixes for UnusedImport warnings
Diffstat (limited to 'lib')
-rw-r--r--lib/impure/rdstdin.nim2
-rw-r--r--lib/pure/asyncdispatch.nim2
-rw-r--r--lib/pure/asynchttpserver.nim2
-rw-r--r--lib/pure/encodings.nim3
-rw-r--r--lib/pure/lenientops.nim2
-rw-r--r--lib/pure/selectors.nim3
-rw-r--r--lib/pure/strformat.nim2
7 files changed, 7 insertions, 9 deletions
diff --git a/lib/impure/rdstdin.nim b/lib/impure/rdstdin.nim
index b78c0d8cf..4c36afe6e 100644
--- a/lib/impure/rdstdin.nim
+++ b/lib/impure/rdstdin.nim
@@ -43,7 +43,7 @@ elif defined(genode):
     stdin.readLine(line)
 
 else:
-  import linenoise, termios
+  import linenoise
 
   proc readLineFromStdin*(prompt: string): TaintedString {.
                           tags: [ReadIOEffect, WriteIOEffect].} =
diff --git a/lib/pure/asyncdispatch.nim b/lib/pure/asyncdispatch.nim
index 5e4e3f699..35eb646c6 100644
--- a/lib/pure/asyncdispatch.nim
+++ b/lib/pure/asyncdispatch.nim
@@ -168,7 +168,7 @@
 
 include "system/inclrtl"
 
-import os, tables, strutils, times, heapqueue, lists, options, asyncstreams
+import os, tables, strutils, times, heapqueue, options, asyncstreams
 import options, math, std/monotimes
 import asyncfutures except callSoon
 
diff --git a/lib/pure/asynchttpserver.nim b/lib/pure/asynchttpserver.nim
index 186f0da41..c806d972a 100644
--- a/lib/pure/asynchttpserver.nim
+++ b/lib/pure/asynchttpserver.nim
@@ -30,7 +30,7 @@
 ##
 ##    waitFor server.serve(Port(8080), cb)
 
-import tables, asyncnet, asyncdispatch, parseutils, uri, strutils
+import asyncnet, asyncdispatch, parseutils, uri, strutils
 import httpcore
 
 export httpcore except parseHeader
diff --git a/lib/pure/encodings.nim b/lib/pure/encodings.nim
index e3be1764b..ff9c3889a 100644
--- a/lib/pure/encodings.nim
+++ b/lib/pure/encodings.nim
@@ -10,7 +10,7 @@
 ## Converts between different character encodings. On UNIX, this uses
 ## the `iconv`:idx: library, on Windows the Windows API.
 
-import os, parseutils, strutils
+import os
 
 when not defined(windows):
   type
@@ -28,6 +28,7 @@ type
                                         ## for encoding errors
 
 when defined(windows):
+  import parseutils, strutils
   proc eqEncodingNames(a, b: string): bool =
     var i = 0
     var j = 0
diff --git a/lib/pure/lenientops.nim b/lib/pure/lenientops.nim
index cdea780a2..f73df5e5f 100644
--- a/lib/pure/lenientops.nim
+++ b/lib/pure/lenientops.nim
@@ -24,8 +24,6 @@
 ## either casting to float or rounding to int might be preferred, and users
 ## should make an explicit choice.
 
-import typetraits
-
 proc `+`*[I: SomeInteger, F: SomeFloat](i: I, f: F): F {.noSideEffect, inline.} =
   F(i) + f
 proc `+`*[I: SomeInteger, F: SomeFloat](f: F, i: I): F {.noSideEffect, inline.} =
diff --git a/lib/pure/selectors.nim b/lib/pure/selectors.nim
index 0ab1e7754..743a92dd0 100644
--- a/lib/pure/selectors.nim
+++ b/lib/pure/selectors.nim
@@ -27,7 +27,7 @@
 ##
 ## TODO: ``/dev/poll``, ``event ports`` and filesystem events.
 
-import os, strutils, nativesockets
+import os, nativesockets
 
 const hasThreadSupport = compileOption("threads") and defined(threadsafe)
 
@@ -230,6 +230,7 @@ when defined(nimdoc):
     ## For *poll* and *select* selectors ``-1`` is returned.
 
 else:
+  import strutils
   when hasThreadSupport:
     import locks
 
diff --git a/lib/pure/strformat.nim b/lib/pure/strformat.nim
index bc0d4b069..838baaf02 100644
--- a/lib/pure/strformat.nim
+++ b/lib/pure/strformat.nim
@@ -744,8 +744,6 @@ when isMainModule:
   check &"{high(int64)}", "9223372036854775807"
   check &"{low(int64)}", "-9223372036854775808"
 
-  import json
-
   doAssert fmt"{'a'} {'b'}" == "a b"
 
   echo("All tests ok")