Skip to content

Commit 02a4730

Browse files
authored
Merge pull request vapor-community#53 from alirp88/master
Remove characters because of deprecation
2 parents 6c6eedb + a7ff377 commit 02a4730

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

Sources/TLS/Certificates.swift

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public enum Certificates {
5151

5252
extension Certificates {
5353
public static var openbsd: Certificates {
54-
let root = #file.characters
54+
let root = #file.toCharacterSequence()
5555
.split(separator: "/", omittingEmptySubsequences: false)
5656
.dropLast(3)
5757
.map { String($0) }
@@ -98,3 +98,15 @@ fileprivate func fileExists(_ path: String) -> Bool {
9898
return access(baseAddress, R_OK) == 0
9999
}
100100
}
101+
102+
extension String {
103+
#if swift(>=4.0)
104+
internal func toCharacterSequence() -> String {
105+
return self
106+
}
107+
#else
108+
internal func toCharacterSequence() -> CharacterView {
109+
return self.characters
110+
}
111+
#endif
112+
}

0 commit comments

Comments
 (0)