From 2cb83fdd7ea4e76d4b1c830a97480521cc405625 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Fri, 28 Feb 2014 12:55:30 -0800 Subject: std: Switch stdout/stderr to buffered by default Similarly to #12422 which made stdin buffered by default, this commit makes the output streams also buffered by default. Now that buffered writers will flush their contents when they are dropped, I don't believe that there's no reason why the output shouldn't be buffered by default, which is what you want in 90% of cases. As with stdin, there are new stdout_raw() and stderr_raw() functions to get unbuffered streams to stdout/stderr. --- src/libtest/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/libtest') diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs index 3162fe02a0f..0e062003053 100644 --- a/src/libtest/lib.rs +++ b/src/libtest/lib.rs @@ -415,8 +415,8 @@ impl ConsoleTestState { Some(ref path) => Some(try!(File::create(path))), None => None }; - let out = match term::Terminal::new(io::stdout()) { - Err(_) => Raw(io::stdout()), + let out = match term::Terminal::new(io::stdio::stdout_raw()) { + Err(_) => Raw(io::stdio::stdout_raw()), Ok(t) => Pretty(t) }; Ok(ConsoleTestState { -- cgit 1.4.1-3-g733a5