From bedac0a2c5bcc46f4d04a9bec9b1bb2ad2d3e423 Mon Sep 17 00:00:00 2001 From: Pierre Tachoire Date: Fri, 15 Dec 2023 13:54:10 +0100 Subject: [PATCH] html_collection: explicitely list switch cases --- src/dom/html_collection.zig | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/dom/html_collection.zig b/src/dom/html_collection.zig index c51e4133..da4bf2f6 100644 --- a/src/dom/html_collection.zig +++ b/src/dom/html_collection.zig @@ -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), } } };