diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2013-10-13 18:48:47 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2013-10-24 14:21:57 -0700 |
| commit | 61ed2cfb5516f76487509766b1054275f1340f70 (patch) | |
| tree | 815c604da80638dfc659220ee9f697b074954f47 /src/librustpkg/messages.rs | |
| parent | 4eb53360541baf3e6df36dc0f0766bc7c1c9f8be (diff) | |
| download | rust-61ed2cfb5516f76487509766b1054275f1340f70.tar.gz rust-61ed2cfb5516f76487509766b1054275f1340f70.zip | |
Remove even more of std::io
Big fish fried here:
extra::json
most of the compiler
extra::io_util removed
extra::fileinput removed
Fish left to fry
extra::ebml
Diffstat (limited to 'src/librustpkg/messages.rs')
| -rw-r--r-- | src/librustpkg/messages.rs | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/src/librustpkg/messages.rs b/src/librustpkg/messages.rs index 96c99a7a0f1..79c8ff794ab 100644 --- a/src/librustpkg/messages.rs +++ b/src/librustpkg/messages.rs @@ -9,31 +9,38 @@ // except according to those terms. use extra::term; -use std::io; +use std::rt::io; pub fn note(msg: &str) { - pretty_message(msg, "note: ", term::color::GREEN, io::stdout()) + pretty_message(msg, "note: ", term::color::GREEN, + @mut io::stdout() as @mut io::Writer) } pub fn warn(msg: &str) { - pretty_message(msg, "warning: ", term::color::YELLOW, io::stdout()) + pretty_message(msg, "warning: ", term::color::YELLOW, + @mut io::stdout() as @mut io::Writer) } pub fn error(msg: &str) { - pretty_message(msg, "error: ", term::color::RED, io::stdout()) + pretty_message(msg, "error: ", term::color::RED, + @mut io::stdout() as @mut io::Writer) } -fn pretty_message<'a>(msg: &'a str, prefix: &'a str, color: term::color::Color, out: @io::Writer) { +fn pretty_message<'a>(msg: &'a str, + prefix: &'a str, + color: term::color::Color, + out: @mut io::Writer) { let term = term::Terminal::new(out); match term { Ok(ref t) => { t.fg(color); - out.write_str(prefix); + out.write(prefix.as_bytes()); t.reset(); }, _ => { - out.write_str(prefix); + out.write(prefix.as_bytes()); } } - out.write_line(msg); + out.write(msg.as_bytes()); + out.write(['\n' as u8]); } |
