Skip to content

Commit

Permalink
Merge pull request #53 from alirp88/master
Browse files Browse the repository at this point in the history
Remove characters because of deprecation
  • Loading branch information
tanner0101 authored Dec 6, 2017
2 parents 6c6eedb + a7ff377 commit 02a4730
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Sources/TLS/Certificates.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public enum Certificates {

extension Certificates {
public static var openbsd: Certificates {
let root = #file.characters
let root = #file.toCharacterSequence()
.split(separator: "/", omittingEmptySubsequences: false)
.dropLast(3)
.map { String($0) }
Expand Down Expand Up @@ -98,3 +98,15 @@ fileprivate func fileExists(_ path: String) -> Bool {
return access(baseAddress, R_OK) == 0
}
}

extension String {
#if swift(>=4.0)
internal func toCharacterSequence() -> String {
return self
}
#else
internal func toCharacterSequence() -> CharacterView {
return self.characters
}
#endif
}

0 comments on commit 02a4730

Please sign in to comment.