authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-05-31 21:10:40 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-05-31 21:10:40 -07:00
logff047c05bdd2825e9964875c6b29fa3bf4461a79
treeea98ddc2331a0a8cbc1112d4a175570f3be0a233
parent0cf756c80a4bc1b0459bc81bf8071891f12c3738
signaturebadge-check Signed by SSH key SHA256:4hHJbtBRU58AYXwjL7fkz2fnQHdiye8x1QpTCQ0sHNw

update to zig 0.15.2


2 files changed, 7 insertions(+), 5 deletions(-)

README.md+1-1
...@@ -3,7 +3,7 @@...@@ -3,7 +3,7 @@
3![loc](https://sloc.xyz/github/nektro/zig-extras)3![loc](https://sloc.xyz/github/nektro/zig-extras)
4[![license](https://img.shields.io/github/license/nektro/zig-extras.svg)](https://github.com/nektro/zig-extras/blob/master/LICENSE)4[![license](https://img.shields.io/github/license/nektro/zig-extras.svg)](https://github.com/nektro/zig-extras/blob/master/LICENSE)
5[![nektro @ github sponsors](https://img.shields.io/badge/sponsors-nektro-purple?logo=github)](https://github.com/sponsors/nektro)5[![nektro @ github sponsors](https://img.shields.io/badge/sponsors-nektro-purple?logo=github)](https://github.com/sponsors/nektro)
6[![Zig](https://img.shields.io/badge/Zig-0.14-f7a41d)](https://ziglang.org/)6[![Zig](https://img.shields.io/badge/Zig-0.15-f7a41d)](https://ziglang.org/)
7[![Zigmod](https://img.shields.io/badge/Zigmod-latest-f7a41d)](https://github.com/nektro/zigmod)7[![Zigmod](https://img.shields.io/badge/Zigmod-latest-f7a41d)](https://github.com/nektro/zigmod)
88
9An assortment of random utility functions that aren't in std and don't deserve their own package.9An assortment of random utility functions that aren't in std and don't deserve their own package.
src/pipe.zig+6-4
...@@ -3,10 +3,12 @@ const string = []const u8;...@@ -3,10 +3,12 @@ const string = []const u8;
3const extras = @import("./lib.zig");3const extras = @import("./lib.zig");
44
5pub fn pipe(reader_from: anytype, writer_to: anytype) !void {5pub fn pipe(reader_from: anytype, writer_to: anytype) !void {
6 var buf: [std.heap.page_size_min]u8 = undefined;6 var buf: [4096]u8 = undefined;
7 var fifo = std.fifo.LinearFifo(u8, .Slice).init(&buf);7 while (true) {
8 defer fifo.deinit();8 const n = try reader_from.read(&buf);
9 try fifo.pump(reader_from, writer_to);9 if (n == 0) break;
10 try writer_to.writeAll(buf[0..n]);
11 }
10}12}
1113
12test {14test {