mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 15:18:49 +00:00
Make bytes.reader_init return an io.Stream
Makes the API like the other stream `init` procs.
This commit is contained in:
@@ -9,10 +9,11 @@ Reader :: struct {
|
|||||||
prev_rune: int, // previous reading index of rune or < 0
|
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.s = s
|
||||||
r.i = 0
|
r.i = 0
|
||||||
r.prev_rune = -1
|
r.prev_rune = -1
|
||||||
|
return reader_to_stream(r)
|
||||||
}
|
}
|
||||||
|
|
||||||
reader_to_stream :: proc(r: ^Reader) -> (s: io.Stream) {
|
reader_to_stream :: proc(r: ^Reader) -> (s: io.Stream) {
|
||||||
|
|||||||
Reference in New Issue
Block a user