Skip to content

Commit

Permalink
Merge pull request Carthage#2256 from Carthage/deprecated-string-char…
Browse files Browse the repository at this point in the history
…acters

`String.characters` is now deprecated in Swift 4.0.2
  • Loading branch information
mdiep authored Nov 14, 2017
2 parents 7885fbb + 971da1b commit f3d43f3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Source/CarthageKit/FrameworkExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ extension String {
/// Strips off a trailing string, if present.
internal func stripping(suffix: String) -> String {
if hasSuffix(suffix) {
let end = characters.index(endIndex, offsetBy: -suffix.count)
let end = index(endIndex, offsetBy: -suffix.count)
return String(self[startIndex..<end])
} else {
return self
Expand Down
3 changes: 1 addition & 2 deletions Source/carthage/Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ internal func print<T>(_ object: T) {
extension String {
/// Split the string into substrings separated by the given separators.
internal func split(maxSplits: Int = .max, omittingEmptySubsequences: Bool = true, separators: [Character] = [ ",", " " ]) -> [String] {
return characters
.split(maxSplits: maxSplits, omittingEmptySubsequences: omittingEmptySubsequences, whereSeparator: separators.contains)
return split(maxSplits: maxSplits, omittingEmptySubsequences: omittingEmptySubsequences, whereSeparator: separators.contains)
.map(String.init)
}
}
Expand Down

0 comments on commit f3d43f3

Please sign in to comment.