benchmark: use newer bytes api to generate ascii

pull/9867/head
Jeffrey C. Ollie 2025-12-10 22:26:40 -06:00
parent 4a173052fb
commit 10bac6a5dd
No known key found for this signature in database
GPG Key ID: 1BB9EB7EA602265B
1 changed files with 3 additions and 1 deletions

View File

@ -36,10 +36,12 @@ pub fn run(_: *Ascii, writer: *std.Io.Writer, rand: std.Random) !void {
var gen: Bytes = .{
.rand = rand,
.alphabet = ascii,
.min_len = 1024,
.max_len = 1024,
};
while (true) {
gen.next(writer, 1024) catch |err| {
_ = gen.write(writer) catch |err| {
const Error = error{ WriteFailed, BrokenPipe } || @TypeOf(err);
switch (@as(Error, err)) {
error.BrokenPipe => return, // stdout closed