summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKyle Brown <kdb424@gmail.com>2021-08-10 16:26:42 -0700
committerGitHub <noreply@github.com>2021-08-11 01:26:42 +0200
commit31fc0f97187cef472cf113629a90c7aa126d3693 (patch)
tree0902ccb8d2ee1b601ef98c3d7f4835b18e44f8e9
parent8ce782d463b0bca091be5a34db190dc441c23ce4 (diff)
downloadNim-31fc0f97187cef472cf113629a90c7aa126d3693.tar.gz
Remove unused imports, and deprecated function usage (#18663)
* clean up imports and slice to remove delete

* revert buggy code

* Replace "delete" with setlen to remove depreciation warning
-rw-r--r--compiler/docgen.nim4
-rw-r--r--compiler/jsgen.nim2
-rw-r--r--tools/atlas/atlas.nim2
-rw-r--r--tools/atlas/packagesjson.nim1
4 files changed, 4 insertions, 5 deletions
diff --git a/compiler/docgen.nim b/compiler/docgen.nim
index 3bc01bbe6..d39a20aae 100644
--- a/compiler/docgen.nim
+++ b/compiler/docgen.nim
@@ -835,7 +835,7 @@ proc docstringSummary(rstText: string): string =
   result = rstText.substr(2).strip
   var pos = result.find('\L')
   if pos > 0:
-    result.delete(pos, result.len - 1)
+    result.setLen(pos - 1)
     result.add("…")
   if pos < maxDocstringChars:
     return
@@ -843,7 +843,7 @@ proc docstringSummary(rstText: string): string =
   pos = result.find({'.', ',', ':'})
   let last = result.len - 1
   if pos > 0 and pos < last:
-    result.delete(pos, last)
+    result.setLen(pos - 1)
     result.add("…")
 
 proc genDeprecationMsg(d: PDoc, n: PNode): string =
diff --git a/compiler/jsgen.nim b/compiler/jsgen.nim
index 85947535e..49a57b4a6 100644
--- a/compiler/jsgen.nim
+++ b/compiler/jsgen.nim
@@ -29,7 +29,7 @@ implements the required case distinction.
 
 
 import
-  ast, astalgo, trees, magicsys, options,
+  ast, trees, magicsys, options,
   nversion, msgs, idents, types,
   ropes, passes, ccgutils, wordrecg, renderer,
   cgmeth, lowerings, sighashes, modulegraphs, lineinfos, rodutils,
diff --git a/tools/atlas/atlas.nim b/tools/atlas/atlas.nim
index d0990c1f7..761ca5db8 100644
--- a/tools/atlas/atlas.nim
+++ b/tools/atlas/atlas.nim
@@ -9,7 +9,7 @@
 ## Simple tool to automate frequent workflows: Can "clone"
 ## a Nimble dependency and its dependencies recursively.
 
-import std/[parseopt, strutils, os, osproc, sequtils, unicode, tables, sets]
+import std/[parseopt, strutils, os, osproc, unicode, tables, sets]
 import parse_requires, osutils, packagesjson
 
 const
diff --git a/tools/atlas/packagesjson.nim b/tools/atlas/packagesjson.nim
index ed83ce85c..0b8599769 100644
--- a/tools/atlas/packagesjson.nim
+++ b/tools/atlas/packagesjson.nim
@@ -1,6 +1,5 @@
 
 import std / [json, os, sets, strutils]
-import osutils
 
 type
   Package* = ref object