mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-12-28 17:14:39 +00:00
benchmark: use newer bytes api to generate ascii
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user