Skip to content

Commit

Permalink
Merge pull request #152 from namolnad/allow-optionals-when-encoding
Browse files Browse the repository at this point in the history
Allow Optional values when encoding
  • Loading branch information
loganwright authored Feb 27, 2020
2 parents 537a44c + e73a0b8 commit 8df2c56
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/Leaf/LeafEncoder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ private final class SingleValueContainer: SingleValueEncodingContainer, _Contain
} else {
let encoder = _Encoder(codingPath: self.codingPath)
try value.encode(to: encoder)
self.data = encoder.container!.data!
self.data = encoder.container!.data
}
}
}
Expand Down Expand Up @@ -139,7 +139,7 @@ private final class KeyedContainer<Key>: KeyedEncodingContainerProtocol, _Contai
} else {
let encoder = _Encoder(codingPath: codingPath + [key])
try value.encode(to: encoder)
self.dictionary[key.stringValue] = encoder.container!.data!
self.dictionary[key.stringValue] = encoder.container!.data
}
}

Expand Down

0 comments on commit 8df2c56

Please sign in to comment.