Skip to content

Commit

Permalink
Fix lowercasingFirstLetter was capitalized
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeMatt committed Feb 6, 2019
1 parent f5a8578 commit a110b83
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/XMLCoder/Auxiliaries/String+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ extension StringProtocol {

func lowercasingFirstLetter() -> Self {
// avoid lowercasing single letters (I), or capitalized multiples (AThing ! to aThing, leave as AThing)
guard count > 1, !(String(prefix(2)) == prefix(2).uppercased()) else {
guard count > 1, !(String(prefix(2)) == prefix(2).lowercased()) else {
return self
}
return Self(prefix(1).lowercased() + dropFirst())!
}

mutating func lowercaseFirstLetter() {
self = capitalizingFirstLetter()
self = lowercasingFirstLetter()
}
}

0 comments on commit a110b83

Please sign in to comment.