1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-30 12:37:49 +00:00

Merge pull request #403 from ebfe/deprecation

Fix deprecation warnings
This commit is contained in:
Alex Lyon 2014-09-27 14:54:33 -07:00
commit e4b5b8e19c
6 changed files with 7 additions and 7 deletions

View file

@ -92,7 +92,7 @@ fn strip_dir(fullname: &str) -> String {
if c == '/' || c == '\\' {
break;
}
name.push_char(c);
name.push(c);
}
name.as_slice().chars().rev().collect()

View file

@ -40,7 +40,7 @@ fn mkdelim(col: uint, opts: &getopts::Matches) -> String {
fn ensure_nl(line: String) -> String {
match line.as_slice().chars().last() {
Some('\n') => line,
_ => line.append("\n"),
_ => line + "\n",
}
}

View file

@ -201,7 +201,7 @@ fn fold_file<T: io::Reader>(file: BufferedReader<T>, bytes: bool, spaces: bool,
}
_ => count += 1
};
output.push_char(ch);
output.push(ch);
}
if count > 0 {
print!("{}", output);

View file

@ -179,7 +179,7 @@ fn nl<T: Reader> (reader: &mut BufferedReader<T>, settings: &Settings) {
for mut l in reader.lines().map(|r| r.unwrap()) {
// Sanitize the string. We want to print the newline ourselves.
if l.as_slice().chars().rev().next().unwrap() == '\n' {
l.pop_char();
l.pop();
}
// Next we iterate through the individual chars to see if this
// is one of the special lines starting a new "section" in the

View file

@ -141,7 +141,7 @@ fn shuf(input: Vec<String>, mode: Mode, repeat: bool, zero: bool, count: uint, o
let mut lines = vec!();
for line in file.lines() {
let mut line = crash_if_err!(1, line);
line.pop_char();
line.pop();
lines.push(line);
}
lines.into_iter()

View file

@ -196,7 +196,7 @@ fn str_prefix(i: uint, width: uint) -> String {
let div = num::pow(26 as uint, w);
let r = n / div;
n -= r * div;
c.push_char(char::from_u32((r as u32) + 97).unwrap());
c.push(char::from_u32((r as u32) + 97).unwrap());
}
c
}
@ -211,7 +211,7 @@ fn num_prefix(i: uint, width: uint) -> String {
let div = num::pow(10 as uint, w);
let r = n / div;
n -= r * div;
c.push_char(char::from_digit(r, 10).unwrap());
c.push(char::from_digit(r, 10).unwrap());
}
c
}