From 77b3c1c855b2aa2ea845be08788864bec5091fe4 Mon Sep 17 00:00:00 2001 From: ee7 <45465154+ee7@users.noreply.github.com> Date: Wed, 16 Aug 2023 19:00:01 +0200 Subject: [PATCH] completion: fix unused import warning And without duplicating the conditional to import strutils. --- src/completion/completion.nim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/completion/completion.nim b/src/completion/completion.nim index 29c7d8c8..fe5a7851 100644 --- a/src/completion/completion.nim +++ b/src/completion/completion.nim @@ -1,4 +1,4 @@ -import std/[os, strformat, strutils] +import std/[os, strformat] import pkg/supersnappy import ../cli @@ -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) =