Skip to content

Commit

Permalink
Fix forcecast
Browse files Browse the repository at this point in the history
  • Loading branch information
bwetherfield committed Nov 2, 2019
1 parent 59106b7 commit e6ec42a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/XMLCoder/Decoder/XMLKeyedDecodingContainer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,8 @@ extension XMLKeyedDecodingContainer {
// If we are looking at a coding key value intrinsic where the expected type is `String` and
// the value is empty, return `""`.
if strategy(key) != .attribute, elements.isEmpty, attributes.isEmpty, type == String.self,
key.stringValue == "value" || key.stringValue == "" {
return "" as! T
(key.stringValue == "value" || key.stringValue == ""), let emptyString = "" as? T {
return emptyString
}

switch strategy(key) {
Expand Down

0 comments on commit e6ec42a

Please sign in to comment.