html_collection: explicitely list switch cases

This commit is contained in:
Pierre Tachoire
2023-12-15 13:54:10 +01:00
parent 314d2dae80
commit bedac0a2c5

View File

@@ -19,14 +19,16 @@ const Matcher = union(enum) {
pub fn match(self: Matcher, node: *parser.Node) !bool {
switch (self) {
inline .matchTrue => return true,
inline else => |case| return case.match(node),
inline .matchByTagName => |case| return case.match(node),
inline .matchByClassName => |case| return case.match(node),
}
}
pub fn deinit(self: Matcher, alloc: std.mem.Allocator) void {
switch (self) {
.matchTrue => return,
inline else => |case| return case.deinit(alloc),
inline .matchTrue => return,
inline .matchByTagName => |case| return case.deinit(alloc),
inline .matchByClassName => |case| return case.deinit(alloc),
}
}
};