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
This commit is contained in:
Kyle Brown 2021-08-10 16:26:42 -07:00 • committed by GitHub
commit 31fc0f9718
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 5 deletions

View file

@ -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 =