From 1136e65f0dfbdc205281f52e9d8f34ede0436841 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Fri, 15 Jan 2016 13:11:30 +0100 Subject: [PATCH] Add flush function. --- src/common.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/common.rs b/src/common.rs index 78f9fbf64..7750d9ea5 100644 --- a/src/common.rs +++ b/src/common.rs @@ -34,3 +34,8 @@ macro_rules! xx { From::from(From::from($x)) } } + +pub fn flush(s: String) { + ::std::io::stdout().write(s.as_bytes()).unwrap(); + ::std::io::stdout().flush().unwrap(); +}