From ff047c05bdd2825e9964875c6b29fa3bf4461a79 Mon Sep 17 00:00:00 2001 From: Meghan Denny Date: Sun, 31 May 2026 21:10:40 -0700 Subject: [PATCH] update to zig 0.15.2 --- README.md | 2 +- src/pipe.zig | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index c52a54656339d2d1e3697fc02b5d95e051f710d6..2e230ed2b2cc1bddc7de1b53ceeca56c1fc465d0 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ ![loc](https://sloc.xyz/github/nektro/zig-extras) [![license](https://img.shields.io/github/license/nektro/zig-extras.svg)](https://github.com/nektro/zig-extras/blob/master/LICENSE) [![nektro @ github sponsors](https://img.shields.io/badge/sponsors-nektro-purple?logo=github)](https://github.com/sponsors/nektro) -[![Zig](https://img.shields.io/badge/Zig-0.14-f7a41d)](https://ziglang.org/) +[![Zig](https://img.shields.io/badge/Zig-0.15-f7a41d)](https://ziglang.org/) [![Zigmod](https://img.shields.io/badge/Zigmod-latest-f7a41d)](https://github.com/nektro/zigmod) An assortment of random utility functions that aren't in std and don't deserve their own package. diff --git a/src/pipe.zig b/src/pipe.zig index 9380b4da5a088b970732d0885ffed865c11fbe22..c636c1514ee073f1e54017bb3bc109379d2a4d29 100644 --- a/src/pipe.zig +++ b/src/pipe.zig @@ -3,10 +3,12 @@ const string = []const u8; const extras = @import("./lib.zig"); pub fn pipe(reader_from: anytype, writer_to: anytype) !void { - var buf: [std.heap.page_size_min]u8 = undefined; - var fifo = std.fifo.LinearFifo(u8, .Slice).init(&buf); - defer fifo.deinit(); - try fifo.pump(reader_from, writer_to); + var buf: [4096]u8 = undefined; + while (true) { + const n = try reader_from.read(&buf); + if (n == 0) break; + try writer_to.writeAll(buf[0..n]); + } } test { -- 2.54.0