allocgate 2.0

This commit is contained in:
Robin Voetter
2022-12-03 02:35:40 +01:00
parent be59386118
commit a56d6e31a8
5 changed files with 15 additions and 15 deletions

View File

@@ -481,8 +481,8 @@ fn parseElement(parser: *Parser, alloc: Allocator, comptime kind: ElementKind) !
const element = try alloc.create(Element);
element.* = .{
.tag = try alloc.dupe(u8, tag),
.attributes = attributes.toOwnedSlice(),
.children = children.toOwnedSlice(),
.attributes = try attributes.toOwnedSlice(),
.children = try children.toOwnedSlice(),
};
return element;
}