#How to get a std.io.Reader for a slice of bytes?
1 messages · Page 1 of 1 (latest)
std.io.FixedBufferStream
the usage is
var stream = std.io.fixedBufferStream(buf);
const reader = stream.reader();
I am getting some sort of type error:
src\ase.zig:478:40: error: expected type 'type', found 'fn (comptime type, comptime type, comptime anytype) type'
I tried using std.io.GenericReader as well for my parameter's type.
Same error.
Try anytype
wait... hold on.
This maybe some weird file system issue
Okay not quite, I just wasn't updating other lines where I was using Reader ...
Hmm, so why should this be anytype? I'd like to use a more concrete type for my reader parameter in a function.
Oh okay the compiler still ensures type safety. I'm too used to TypeScript's any type.