Skip to content

Commit

Permalink
Bool: Support init from y,n,yes,no any case, false,true added upperca…
Browse files Browse the repository at this point in the history
…se support
  • Loading branch information
JoeMatt committed Jan 31, 2019
1 parent a81b532 commit 05e3c2d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/XMLCoder/Auxiliaries/Box/BoolBox.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ struct BoolBox: Equatable {
}

init?(xmlString: String) {
switch xmlString {
case "false", "0": self.init(false)
case "true", "1": self.init(true)
switch xmlString.lowercased() {
case "false", "0", "n", "no": self.init(false)
case "true", "1", "y", "yes": self.init(true)
case _: return nil
}
}
Expand Down

0 comments on commit 05e3c2d

Please sign in to comment.