aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFeoramund <161657516+Feoramund@users.noreply.github.com>2024-08-19 02:03:41 -0400
committerLaytan <laytanlaats@hotmail.com>2024-08-28 19:53:20 +0200
commitda49f7eb4e31240f2d83260357a389c6b7a08873 (patch)
tree7dae7a34c2c8116ea8a8b16e104542c2dbe58598
parentd66486c17e55261d33b2a3ee9e7c6b68656a9ef2 (diff)
Make `bytes.reader_init` return an `io.Stream`
Makes the API like the other stream `init` procs.
-rw-r--r--core/bytes/reader.odin3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/bytes/reader.odin b/core/bytes/reader.odin
index 4b18345ba..a2e3294f0 100644
--- a/core/bytes/reader.odin
+++ b/core/bytes/reader.odin
@@ -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) {