summaryrefslogtreecommitdiff
path: root/drain.ha
blob: d2701081fec623bc40028be64b2e1c4ac16fdce1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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;
};