into_string -> to_string

This commit is contained in:
Michael Gehring 2015-01-08 14:02:19 +01:00
parent fd69e7fa4a
commit b8a96da278
4 changed files with 8 additions and 8 deletions

4
src/env/env.rs vendored
View file

@ -82,7 +82,7 @@ pub fn uumain(args: Vec<String>) -> int {
match (name, value) {
(Some(n), Some(v)) => {
opts.sets.push((n.into_string(), v.into_string()));
opts.sets.push((n.to_string(), v.to_string()));
}
_ => {
// read the program now
@ -154,7 +154,7 @@ pub fn uumain(args: Vec<String>) -> int {
match (name, value) {
(Some(n), Some(v)) => {
// yes
opts.sets.push((n.into_string(), v.into_string()));
opts.sets.push((n.to_string(), v.to_string()));
wait_cmd = true;
}
// no, its a program-like opt

View file

@ -172,7 +172,7 @@ fn fold_file<T: io::Reader>(file: BufferedReader<T>, bytes: bool, spaces: bool,
(slice, "", 0)
};
println!("{}", out);
(val.into_string(), ncount)
(val.to_string(), ncount)
};
output = val;
count = ncount;

View file

@ -81,10 +81,10 @@ fn tac(filenames: Vec<String>, before: bool, _: bool, separator: &str) {
let mut data = crash_if_err!(1, file.read_to_string());
if data.as_slice().ends_with("\n") {
// removes blank line that is inserted otherwise
let mut buf = data.into_string();
let mut buf = data.to_string();
let len = buf.len();
buf.truncate(len - 1);
data = buf.into_string();
data = buf.to_string();
}
let split_vec: Vec<&str> = data.as_slice().split_str(separator).collect();
let rev: String = split_vec.iter().rev().fold(String::new(), |mut a, &b| {

View file

@ -66,7 +66,7 @@ impl Uniq {
Some(i) => min(slice_start + i, len),
None => len
};
let sliced = line.as_slice().slice(slice_start, slice_stop).into_string();
let sliced = line.as_slice().slice(slice_start, slice_stop).to_string();
if self.ignore_case {
sliced.into_ascii_uppercase()
} else {
@ -157,8 +157,8 @@ pub fn uumain(args: Vec<String>) -> int {
println!("{} {}", NAME, VERSION);
} else {
let (in_file_name, out_file_name) = match matches.free.len() {
0 => ("-".into_string(), "-".into_string()),
1 => (matches.free[0].clone(), "-".into_string()),
0 => ("-".to_string(), "-".to_string()),
1 => (matches.free[0].clone(), "-".to_string()),
2 => (matches.free[0].clone(), matches.free[1].clone()),
_ => {
crash!(1, "Extra operand: {}", matches.free[2]);