Skip to content

Commit f5ebfb5

Browse files
committed
Simplify String.prefix(…) call in CommandParser.swift.
Signed-off-by: Ross Goldberg <[email protected]>
1 parent 75194a4 commit f5ebfb5

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

Sources/ArgumentParser/Parsing/CommandParser.swift

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -465,12 +465,7 @@ extension CommandParser {
465465
let completingPrefix: String
466466
if let completingArgument = args.last {
467467
completingPrefix = String(
468-
completingArgument.prefix(
469-
upTo: completingArgument.index(
470-
completingArgument.startIndex,
471-
offsetBy: cursorIndexWithinCompletingArgument
472-
)
473-
)
468+
completingArgument.prefix(cursorIndexWithinCompletingArgument)
474469
)
475470
} else if cursorIndexWithinCompletingArgument == 0 {
476471
completingPrefix = ""

0 commit comments

Comments
 (0)