From 14864ba9925b08e5ee20c67c311ec6ec4bf488d8 Mon Sep 17 00:00:00 2001 From: ge Date: Thu, 29 Jan 2026 04:09:33 +0300 Subject: [PATCH] examples: Remove io.string_reader --- examples/stream_input_and_output.v | 6 ++++-- examples/stream_output.v | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/examples/stream_input_and_output.v b/examples/stream_input_and_output.v index 340f429..faa0eb7 100644 --- a/examples/stream_input_and_output.v +++ b/examples/stream_input_and_output.v @@ -1,4 +1,4 @@ -import io.string_reader +import io import rand import runcmd import time @@ -20,7 +20,7 @@ fn main() { mut child_stdout := cmd.stdout()! // Prepare reader to store command output. - mut output := string_reader.StringReader.new(reader: child_stdout) + mut output := io.new_buffered_reader(reader: child_stdout) // Start stdout reading in a coroutine. // @@ -56,4 +56,6 @@ fn main() { // wait() will close the child stdout file desciptor by itself. cmd.wait()! + + println('Child state: ${cmd.state}') } diff --git a/examples/stream_output.v b/examples/stream_output.v index 428bbba..f842c5a 100644 --- a/examples/stream_output.v +++ b/examples/stream_output.v @@ -1,4 +1,4 @@ -import io.string_reader +import io import runcmd fn main() { @@ -14,7 +14,7 @@ fn main() { // Setup StringReader with stdout input. Note the cmd.stdout()! call, it // returns the io.Reader interface and reads child process stdout file descriptor. - mut reader := string_reader.StringReader.new(reader: cmd.stdout()!) + mut reader := io.new_buffered_reader(reader: cmd.stdout()!) // Read sdtout line by line until EOF. for {