Skip to content

Commit

Permalink
Remove unused imports, and deprecated function usage (nim-lang#18663)
Browse files Browse the repository at this point in the history
* clean up imports and slice to remove delete

* revert buggy code

* Replace "delete" with setlen to remove depreciation warning
  • Loading branch information
kdb424 authored and PMunch committed Mar 28, 2022
1 parent d3b7812 commit 0953ce8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions compiler/docgen.nim
Original file line number Diff line number Diff line change
Expand Up @@ -835,15 +835,15 @@ 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
# Try to keep trimming at other natural boundaries.
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 =
Expand Down
2 changes: 1 addition & 1 deletion compiler/jsgen.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion tools/atlas/atlas.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion tools/atlas/packagesjson.nim
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

import std / [json, os, sets, strutils]
import osutils

type
Package* = ref object
Expand Down

0 comments on commit 0953ce8

Please sign in to comment.