diff options
Diffstat (limited to 'drain.ha')
-rw-r--r-- | drain.ha | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drain.ha b/drain.ha new file mode 100644 index 0000000..d270108 --- /dev/null +++ b/drain.ha @@ -0,0 +1,13 @@ +use io; +use os; +use fmt; + +fn drain_stdin() []u8 = { + const buf = match (io::drain(os::stdin)) { + case let buf: []u8 => + yield buf; + case let err: io::error => + fmt::fatalf("io::drain failed: {}", io::strerror(err)); + }; + return buf; +}; |