mirror of
https://github.com/uutils/coreutils
synced 2024-11-16 01:38:04 +00:00
into_string -> to_string
This commit is contained in:
parent
fd69e7fa4a
commit
b8a96da278
4 changed files with 8 additions and 8 deletions
4
src/env/env.rs
vendored
4
src/env/env.rs
vendored
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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| {
|
||||
|
|
|
@ -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]);
|
||||
|
|
Loading…
Reference in a new issue