Skip to content
Merged
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
2 changes: 1 addition & 1 deletion Sources/XMLCoder/Auxiliaries/XMLCoderElement.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ struct XMLCoderElement: Equatable {
elements.append(element)
}

func transformToBoxTree() -> Box {
func transformToBoxTree() -> KeyedBox {
let attributes = KeyedStorage(self.attributes.map { attribute in
(key: attribute.key, value: StringBox(attribute.value) as SimpleBox)
})
Expand Down
2 changes: 1 addition & 1 deletion Sources/XMLCoder/Auxiliaries/XMLStackParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class XMLStackParser: NSObject {
errorContextLength length: UInt,
shouldProcessNamespaces: Bool,
trimValueWhitespaces: Bool
) throws -> Box {
) throws -> KeyedBox {
let parser = XMLStackParser(trimValueWhitespaces: trimValueWhitespaces)

let node = try parser.parse(
Expand Down
5 changes: 1 addition & 4 deletions Tests/XMLCoderTests/Minimal/BoxTreeTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@ class BoxTreeTests: XCTestCase {
attributes: []
)

guard let boxTree = root.transformToBoxTree() as? KeyedBox else {
XCTFail("boxtTree is not a KeyedBox")
return
}
let boxTree = root.transformToBoxTree()
let foo = boxTree.elements["foo"]
XCTAssertEqual(foo.count, 2)
}
Expand Down