no need for val

This commit is contained in:
Kevin G Christiano 2020-01-24 12:43:38 -05:00
parent e5948e05e5
commit 7b8b2a059f
2 changed files with 1 additions and 3 deletions

View File

@ -33,7 +33,7 @@
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
options = try typeContainer.decodeIfPresent([String].self, forKey: .options) ?? []
options = try typeContainer.decode([String].self, forKey: .options)
}
public override func encode(to encoder: Encoder) throws {

View File

@ -19,7 +19,6 @@ class AccordionListItemModel: MoleculeContainerModel, ListItemModelProtocol {
private enum CodingKeys: String, CodingKey {
case moleculeName
case molecules
case molecule
case backgroundColor
case hideLineWhenExpanded
case hideArrow
@ -45,6 +44,5 @@ class AccordionListItemModel: MoleculeContainerModel, ListItemModelProtocol {
try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor)
try container.encodeIfPresent(hideLineWhenExpanded, forKey: .hideLineWhenExpanded)
try container.encodeIfPresent(line, forKey: .line)
try container.encodeModel(molecule, forKey: .molecule)
}
}