Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ struct KeyedOrderedPlistEncodingContainer<Key>: KeyedEncodingContainerProtocol w

private mutating func addChildElement(forKey key: Key) -> XMLElement {
// TODO: Add check for duplicate keys (should we throw an EncodingError?)
let childElement: XMLElement = .init()
let childElement = XMLElement(kind: .comment)
element.addChild(XMLElement(name: "key", stringValue: key.stringValue))
element.addChild(childElement)
return childElement
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ struct UnkeyedOrderedPlistEncodingContainer: UnkeyedEncodingContainer {
}

private mutating func addItemElement() -> XMLElement {
let itemElement: XMLElement = .init()
let itemElement = XMLElement(kind: .comment)
element.addChild(itemElement)
count += 1
return itemElement
Expand Down
2 changes: 1 addition & 1 deletion Sources/OrderedPlistEncoder/OrderedPlistEncoderImpl.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ struct OrderedPlistEncoderImpl: Encoder {

private(set) var element: XMLElement

init(element: XMLElement = .init(), codingPath: [any CodingKey] = []) {
init(element: XMLElement = XMLElement(kind: .comment), codingPath: [any CodingKey] = []) {
self.element = element
self.codingPath = codingPath
}
Expand Down