Make bytes.reader_init return an io.Stream

Makes the API like the other stream `init` procs.
This commit is contained in:
Feoramund
2024-08-19 02:03:41 -04:00
committed by Laytan
parent d66486c17e
commit da49f7eb4e

View File

@@ -9,10 +9,11 @@ Reader :: struct {
prev_rune: int, // previous reading index of rune or < 0
}
reader_init :: proc(r: ^Reader, s: []byte) {
reader_init :: proc(r: ^Reader, s: []byte) -> io.Stream {
r.s = s
r.i = 0
r.prev_rune = -1
return reader_to_stream(r)
}
reader_to_stream :: proc(r: ^Reader) -> (s: io.Stream) {