diff options
| author | Huon Wilson <dbau.pp+github@gmail.com> | 2013-11-28 23:52:11 +1100 |
|---|---|---|
| committer | Huon Wilson <dbau.pp+github@gmail.com> | 2013-12-04 22:35:53 +1100 |
| commit | 9d64e46013096997627da62ecc65225bc22682e8 (patch) | |
| tree | fa20c8fd1d653acff5f996253d16103dd61addd9 /src/compiletest | |
| parent | 9635c763ba5edc8c8ea2868b895548b52f640e5a (diff) | |
| download | rust-9d64e46013096997627da62ecc65225bc22682e8.tar.gz rust-9d64e46013096997627da62ecc65225bc22682e8.zip | |
std::str: remove from_utf8.
This function had type &[u8] -> ~str, i.e. it allocates a string internally, even though the non-allocating version that take &[u8] -> &str and ~[u8] -> ~str are all that is necessary in most circumstances.
Diffstat (limited to 'src/compiletest')
| -rw-r--r-- | src/compiletest/procsrv.rs | 9 | ||||
| -rw-r--r-- | src/compiletest/runtest.rs | 3 |
2 files changed, 5 insertions, 7 deletions
diff --git a/src/compiletest/procsrv.rs b/src/compiletest/procsrv.rs index 012d57da123..4f05247ada4 100644 --- a/src/compiletest/procsrv.rs +++ b/src/compiletest/procsrv.rs @@ -60,12 +60,12 @@ pub fn run(lib_path: &str, for input in input.iter() { process.input().write(input.as_bytes()); } - let output = process.finish_with_output(); + let run::ProcessOutput { status, output, error } = process.finish_with_output(); Result { - status: output.status, - out: str::from_utf8(output.output), - err: str::from_utf8(output.error) + status: status, + out: str::from_utf8_owned(output), + err: str::from_utf8_owned(error) } } @@ -90,4 +90,3 @@ pub fn run_background(lib_path: &str, return process; } - diff --git a/src/compiletest/runtest.rs b/src/compiletest/runtest.rs index 5f113d2950a..e91652365c3 100644 --- a/src/compiletest/runtest.rs +++ b/src/compiletest/runtest.rs @@ -298,7 +298,7 @@ fn run_debuginfo_test(config: &config, props: &TestProps, testfile: &Path) { let adb_arg = format!("export LD_LIBRARY_PATH={}; gdbserver :5039 {}/{}", config.adb_test_dir.clone(), config.adb_test_dir.clone(), - str::from_utf8(exe_file.filename().unwrap())).clone(); + str::from_utf8_slice(exe_file.filename().unwrap())); let mut process = procsrv::run_background("", config.adb_path.clone(), [~"shell",adb_arg.clone()],~[(~"",~"")], Some(~"")); @@ -1151,4 +1151,3 @@ fn run_codegen_test(config: &config, props: &TestProps, (base_lines as f64) / (clang_lines as f64), 0.001); } - |
