refactor: replace unsafe unreachable usage with @panic

This commit is contained in:
CJ van den Berg 2024-03-24 20:12:59 +01:00
parent 2d1fb680e8
commit 4b86579745
7 changed files with 17 additions and 15 deletions

View file

@ -272,7 +272,7 @@ const FilteredWalker = struct {
if (is_filtered_dir(base.name))
continue;
var new_dir = top.iter.dir.openDir(base.name, .{ .iterate = true }) catch |err| switch (err) {
error.NameTooLong => unreachable, // no path sep in base.name
error.NameTooLong => @panic("unexpected error.NameTooLong"), // no path sep in base.name
else => continue,
};
{