mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-30 12:37:49 +00:00
Fix deprecation warnings
This commit is contained in:
parent
c453d493fb
commit
5af66af015
6 changed files with 7 additions and 7 deletions
|
@ -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()
|
||||
|
|
|
@ -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",
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue