zig icon indicating copy to clipboard operation
zig copied to clipboard

`std.ArrayList` implement `std.io.Reader` when generic over `u8`

Open nektro opened this issue 3 years ago • 1 comments

Zig Version

0.10.0-dev.2981+7090f0471

Steps to Reproduce

const std = @import("std");

test {
    const allocator = std.testing.allocator;
    var list = std.ArrayList(u8).init(allocator);
    _ = list.writer();
    _ = list.reader();
}

Expected Behavior

All 1 tests pass.

Actual Behavior

./test.zig:7:13: error: no member named 'reader' in struct 'std.array_list.ArrayListAligned(u8,null)'
    _ = list.reader();
            ^

nektro avatar Jul 18 '22 20:07 nektro

std.io.fixedBufferStream(list.items) may be a workaround in the meantime

nektro avatar Jul 18 '22 20:07 nektro