Skip to content

Commit

Permalink
Use container for encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
g-mark committed Jun 17, 2020
1 parent 12d3af4 commit 3230262
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/NullCodable/NullCodable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ extension NullCodable: Encodable where Wrapped: Encodable {
public func encode(to encoder: Encoder) throws {
var container = encoder.singleValueContainer()
switch wrappedValue {
case .some(let value): try value.encode(to: encoder)
case .some(let value): try container.encode(value)
case .none: try container.encodeNil()
}
}
Expand Down

0 comments on commit 3230262

Please sign in to comment.