Remove the io::Decorator trait

This is just an unnecessary trait that no one's ever going to parameterize over
and it's more useful to just define the methods directly on the types
themselves. The implementors of this type almost always don't want
inner_mut_ref() but they're forced to define it as well.
This commit is contained in:
Alex Crichton
2014-01-07 20:05:33 -08:00
parent 7613b15fdb
commit 6df57ec2e2
25 changed files with 145 additions and 247 deletions

View File

@@ -32,7 +32,6 @@ use std::cell::RefCell;
use std::char;
use std::str;
use std::io;
use std::io::Decorator;
use std::io::mem::MemWriter;
// The &mut ps is stored here to prevent recursive type.
@@ -2322,7 +2321,7 @@ pub fn print_string(s: &mut ps, st: &str, style: ast::StrStyle) {
// downcasts.
unsafe fn get_mem_writer(writer: &mut ~io::Writer) -> ~str {
let (_, wr): (uint, ~MemWriter) = cast::transmute_copy(writer);
let result = str::from_utf8_owned(wr.inner_ref().to_owned());
let result = str::from_utf8_owned(wr.get_ref().to_owned());
cast::forget(wr);
result
}