Skip to content

Commit

Permalink
Remove imported and not used: 'sequninit' [UnusedImport] warning
Browse files Browse the repository at this point in the history
This warning only happens with devel. The fix is to make sequninit.nim "used" when newSeqUninit is not needed.
  • Loading branch information
AngelEzquerra committed Mar 21, 2024
1 parent da297ef commit 5f82fe2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/arraymancer/private/sequninit.nim
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@

# from Nim https://github.com/nim-lang/Nim/pull/22739 on the stdlib provides a
# `newSeqUninit` for types supporting `supportsCopyMem`
when not declared(newSeqUninit):
when declared(newSeqUninit):
# Avoid an "imported and not used: 'sequninit' [UnusedImport]" warning
# when nim has a built-in newSeqUninit function (i.e. post nim 2.0.2)
{.used.}
else:
func newSeqUninit*[T](len: Natural): seq[T] {.inline.} =
## Creates an uninitialzed seq.
## Contrary to newSequnitialized in system.nim this works for any subtype T
Expand Down

0 comments on commit 5f82fe2

Please sign in to comment.