mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-12-17 08:48:58 +00:00
html_collection: explicitely list switch cases
This commit is contained in:
@@ -19,14 +19,16 @@ const Matcher = union(enum) {
|
|||||||
pub fn match(self: Matcher, node: *parser.Node) !bool {
|
pub fn match(self: Matcher, node: *parser.Node) !bool {
|
||||||
switch (self) {
|
switch (self) {
|
||||||
inline .matchTrue => return true,
|
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 {
|
pub fn deinit(self: Matcher, alloc: std.mem.Allocator) void {
|
||||||
switch (self) {
|
switch (self) {
|
||||||
.matchTrue => return,
|
inline .matchTrue => return,
|
||||||
inline else => |case| return case.deinit(alloc),
|
inline .matchByTagName => |case| return case.deinit(alloc),
|
||||||
|
inline .matchByClassName => |case| return case.deinit(alloc),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user