Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecated/moved functions in collections::str #15426

Merged
merged 8 commits into from
Jul 15, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/compiletest/procsrv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use std::str;
use std::io::process::{ProcessExit, Command, Process, ProcessOutput};
use std::dynamic_lib::DynamicLibrary;

Expand All @@ -25,7 +24,7 @@ fn add_target_env(cmd: &mut Command, lib_path: &str, aux_path: Option<&str>) {
// Add the new dylib search path var
let var = DynamicLibrary::envvar();
let newpath = DynamicLibrary::create_path(path.as_slice());
let newpath = str::from_utf8(newpath.as_slice()).unwrap().to_string();
let newpath = String::from_utf8(newpath).unwrap();
cmd.env(var.to_string(), newpath);
}

Expand Down Expand Up @@ -55,8 +54,8 @@ pub fn run(lib_path: &str,

Some(Result {
status: status,
out: str::from_utf8(output.as_slice()).unwrap().to_string(),
err: str::from_utf8(error.as_slice()).unwrap().to_string()
out: String::from_utf8(output).unwrap(),
err: String::from_utf8(error).unwrap()
})
},
Err(..) => None
Expand Down
16 changes: 8 additions & 8 deletions src/compiletest/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ fn run_pretty_test(config: &Config, props: &TestProps, testfile: &Path) {
match props.pp_exact { Some(_) => 1, None => 2 };

let src = File::open(testfile).read_to_end().unwrap();
let src = str::from_utf8(src.as_slice()).unwrap().to_string();
let src = String::from_utf8(src.clone()).unwrap();
let mut srcs = vec!(src);

let mut round = 0;
Expand All @@ -185,10 +185,10 @@ fn run_pretty_test(config: &Config, props: &TestProps, testfile: &Path) {
Some(ref file) => {
let filepath = testfile.dir_path().join(file);
let s = File::open(&filepath).read_to_end().unwrap();
str::from_utf8(s.as_slice()).unwrap().to_string()
}
None => { (*srcs.get(srcs.len() - 2u)).clone() }
};
String::from_utf8(s).unwrap()
}
None => { (*srcs.get(srcs.len() - 2u)).clone() }
};
let mut actual = (*srcs.get(srcs.len() - 1u)).clone();

if props.pp_exact.is_some() {
Expand Down Expand Up @@ -582,8 +582,8 @@ fn run_debuginfo_lldb_test(config: &Config, props: &TestProps, testfile: &Path)
process.wait_with_output().unwrap();

(status,
str::from_utf8(output.as_slice()).unwrap().to_string(),
str::from_utf8(error.as_slice()).unwrap().to_string())
String::from_utf8(output).unwrap(),
String::from_utf8(error).unwrap())
},
Err(e) => {
fatal(format!("Failed to setup Python process for \
Expand Down Expand Up @@ -813,7 +813,7 @@ fn check_expected_errors(expected_errors: Vec<errors::ExpectedError> ,
c
}
} ).collect();
str::from_chars(c.as_slice()).to_string()
String::from_chars(c.as_slice())
}

#[cfg(target_os = "win32")]
Expand Down
Loading