Created
October 30, 2013 01:06
-
-
Save krdln/7225579 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::rt::io::Writer; | |
use std::rt::io::stdio::with_task_stdout; | |
struct MagicWriter(); | |
impl Writer for MagicWriter { | |
fn write(&mut self, buf: &[u8]) { | |
do with_task_stdout |o| { o.write(buf); } | |
} | |
fn flush(&mut self) { | |
do with_task_stdout |o| { o.flush(); } | |
} | |
} | |
fn stdout() -> MagicWriter { MagicWriter } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment