prefer orelse return instead of orelse unreachable

This commit is contained in:
nikneym
2025-09-26 09:43:30 +03:00
parent 6912175e7e
commit f7b08a1160

View File

@@ -251,11 +251,11 @@ pub const Element = struct {
// None of the following can be null. // None of the following can be null.
const maybe_html = parser.nodeFirstChild(fragment_node); const maybe_html = parser.nodeFirstChild(fragment_node);
std.debug.assert(maybe_html != null); std.debug.assert(maybe_html != null);
const html = maybe_html.?; const html = maybe_html orelse return;
const maybe_body = parser.nodeLastChild(html); const maybe_body = parser.nodeLastChild(html);
std.debug.assert(maybe_body != null); std.debug.assert(maybe_body != null);
const body = maybe_body.?; const body = maybe_body orelse return;
const children = try parser.nodeGetChildNodes(body); const children = try parser.nodeGetChildNodes(body);