I think that would be better, since it's already a member of
bufio::bufstream. The names should probably be changed to
bufio::std{in,out}_bufstream if this is kept though, since bufio isn't
a type.
Signed-off-by: Cormac Stephenson <c7s@kasku.net>
---
os/+freebsd/stdfd.ha | 2 ++os/+linux/stdfd.ha | 2 ++
2 files changed, 4 insertions(+)
diff --git a/os/+freebsd/stdfd.ha b/os/+freebsd/stdfd.ha
index 92ba939d..87659587 100644
--- a/os/+freebsd/stdfd.ha+++ b/os/+freebsd/stdfd.ha
@@ -4,11 +4,13 @@
use bufio;
use io;
+// The standard input, as a [[bufio::bufstream]]. This handle is buffered.export let stdin_bufio: bufio::bufstream = bufio::bufstream {
source = 0,
...
};
+// The standard output, as a [[bufio::bufstream]]. This handle is buffered.export let stdout_bufio: bufio::bufstream = bufio::bufstream {
source = 1,
...
diff --git a/os/+linux/stdfd.ha b/os/+linux/stdfd.ha
index 92ba939d..87659587 100644
--- a/os/+linux/stdfd.ha+++ b/os/+linux/stdfd.ha
@@ -4,11 +4,13 @@
use bufio;
use io;
+// The standard input, as a [[bufio::bufstream]]. This handle is buffered.export let stdin_bufio: bufio::bufstream = bufio::bufstream {
source = 0,
...
};
+// The standard output, as a [[bufio::bufstream]]. This handle is buffered.export let stdout_bufio: bufio::bufstream = bufio::bufstream {
source = 1,
...
--
2.36.0
I'm not sure about this solution. I was thinking that a better approach
might be to have bufio::flush accept any io::handle and flush it if
there's a buffered stream inside.