implement Writer for Vec<u8>
The trait has an obvious, sensible implementation directly on vectors so the MemWriter wrapper is unnecessary. This will halt the trend towards providing all of the vector methods on MemWriter along with eliminating the noise caused by conversions between the two types. It also provides the useful default Writer methods on Vec<u8>. After the type is removed and code has been migrated, it would make sense to add a new implementation of MemWriter with seeking support. The simple use cases can be covered with vectors alone, and ones with the need for seeks can use a new MemWriter implementation.
This commit is contained in:
@@ -33,7 +33,7 @@
|
||||
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
|
||||
html_root_url = "http://doc.rust-lang.org/nightly/")]
|
||||
|
||||
#![feature(asm, macro_rules, phase, globs)]
|
||||
#![feature(asm, macro_rules, phase, globs, slicing_syntax)]
|
||||
|
||||
extern crate getopts;
|
||||
extern crate regex;
|
||||
@@ -848,8 +848,6 @@ pub fn run_tests_console(opts: &TestOpts, tests: Vec<TestDescAndFn> ) -> io::IoR
|
||||
|
||||
#[test]
|
||||
fn should_sort_failures_before_printing_them() {
|
||||
use std::io::MemWriter;
|
||||
|
||||
let test_a = TestDesc {
|
||||
name: StaticTestName("a"),
|
||||
ignore: false,
|
||||
@@ -864,7 +862,7 @@ fn should_sort_failures_before_printing_them() {
|
||||
|
||||
let mut st = ConsoleTestState {
|
||||
log_out: None,
|
||||
out: Raw(MemWriter::new()),
|
||||
out: Raw(Vec::new()),
|
||||
use_color: false,
|
||||
total: 0u,
|
||||
passed: 0u,
|
||||
@@ -878,7 +876,7 @@ fn should_sort_failures_before_printing_them() {
|
||||
|
||||
st.write_failures().unwrap();
|
||||
let s = match st.out {
|
||||
Raw(ref m) => String::from_utf8_lossy(m.get_ref()),
|
||||
Raw(ref m) => String::from_utf8_lossy(m[]),
|
||||
Pretty(_) => unreachable!()
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user