Skip to content

Commit

Permalink
completion: fix unused import warning
Browse files Browse the repository at this point in the history
And without duplicating the conditional to import strutils.
  • Loading branch information
ee7 committed Aug 16, 2023
1 parent 2c8aed3 commit 77b3c1c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/completion/completion.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import std/[os, strformat, strutils]
import std/[os, strformat]
import pkg/supersnappy
import ../cli

Expand All @@ -9,7 +9,9 @@ proc readCompletions: array[Shell, string] =
# When cross-compiling for Windows from Linux, replace the `\\` DirSep with `/`.
var path = completionsDir / &"configlet.{shell}"
when defined(windows) and defined(zig) and staticExec("uname") == "Linux":
path = path.replace('\\', '/')
for c in path.mitems:
if c == '\\':
c = '/'
result[shell] = staticRead(path).compress()

proc completion*(shellKind: Shell) =
Expand Down

0 comments on commit 77b3c1c

Please sign in to comment.