Skip to content

Commit d39e8a4

Browse files
committed
Fix Windows build hopefully
1 parent feb0630 commit d39e8a4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/SWBUtil/Path.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,14 @@ public struct Path: Serializable, Sendable {
7171
public static let pathSeparator = Character("\\")
7272
@inline(__always) public static var pathSeparatorUTF8: UInt8 { UInt8(ascii: "\\") }
7373
public static let pathEnvironmentSeparator = Character(";")
74-
@inline(__always) public static func isUTF8PathSeparator(_ char: UInt8) -> Bool {
74+
@inline(__always) public static func isUTF8PathSeparator(_ char: UInt8, separators: (some Collection<Character>)? = ([Character]?).none) -> Bool {
7575
guard let separators else {
7676
return char == pathSeparatorUTF8 || char == UInt8(ascii: "/")
7777
}
7878
// This is a bit inefficient, but separators should always be nil outside of tests
7979
return separators.contains(String(decoding: CollectionOfOne(char), as: UTF8.self))
8080
}
81-
public static func firstPathSeparatorIndex(in str: some StringProtocol, separators: (some Collection<Character>)?) -> String.Index? {
81+
@inline(__always) public static func firstPathSeparatorIndex(in str: some StringProtocol, separators: (some Collection<Character>)?) -> String.Index? {
8282
guard let separators else {
8383
return str.utf8.firstIndex(where: Path.isUTF8PathSeparator)
8484
}

0 commit comments

Comments
 (0)