Skip to content

Commit 0a04617

Browse files
committed
0.15.1 release notes: fix std.compress.flate code snippet
`streamRemaining` is a method of `std.Io.Reader` (see https://ziglang.org/documentation/0.15.1/std/#std.Io.Reader.streamRemaining), not `std.compress.flate.Decompress`. FWIW, I encountered this error when I tried to use `std.compress.flate.Decompress` in combination with `streamRemaining` in my code. Here's the final code that works on Zig 0.15.2: https://github.com/kaitai-io/kaitai_struct_zig_runtime/blob/d0aee404b6f3a8584ce4df57c52ce0425dc2ab8e/src/root.zig#L519-L526
1 parent 414c98a commit 0a04617

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/download/0.15.1/release-notes.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1626,7 +1626,8 @@ <h1>0.15.1 Release Notes</h1>
16261626
const decompress_reader: *std.Io.Reader = &decompress.reader;{#endsyntax#}</pre>
16271627
<p>If <code>decompress_reader</code> will be piped entirely to a particular <code>*Writer</code>, then give it an empty buffer:</p>
16281628
<pre>{#syntax#}var decompress: std.compress.flate.Decompress = .init(reader, .zlib, &.{});
1629-
const n = try decompress.streamRemaining(writer);{#endsyntax#}</pre>
1629+
const decompress_reader: *std.Io.Reader = &decompress.reader;
1630+
const n = try decompress_reader.streamRemaining(writer);{#endsyntax#}</pre>
16301631
<p>Compression functionality was removed. Sorry, you will have to copy the
16311632
old code into your application, or use a third party package.</p>
16321633
<p>It will be nice to get deflate back into the Zig standard library, but

0 commit comments

Comments
 (0)