std.mem.Allocator: allow shrink to fail

closes #13535
This commit is contained in:
Andrew Kelley
2022-11-27 01:07:35 -07:00
parent deda6b5146
commit ceb0a632cf
57 changed files with 950 additions and 1279 deletions

View File

@@ -176,11 +176,11 @@ pub fn Reader(
error.EndOfStream => if (array_list.items.len == 0) {
return null;
} else {
return array_list.toOwnedSlice();
return try array_list.toOwnedSlice();
},
else => |e| return e,
};
return array_list.toOwnedSlice();
return try array_list.toOwnedSlice();
}
/// Reads from the stream until specified byte is found. If the buffer is not