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

@ -966,7 +966,7 @@ pub fn load(self: *const Self, reader: anytype, size: usize) !Root {
return error.BufferUnderrun;
const final_read = try reader.read(buf);
if (final_read != 0)
unreachable;
@panic("unexpected data in final read");
var leaf_count: usize = 1;
for (0..buf.len) |i| {