From 5af66af01557b0d28e49723b71777cb63ea02145 Mon Sep 17 00:00:00 2001 From: Michael Gehring Date: Sat, 27 Sep 2014 21:05:36 +0200 Subject: [PATCH] Fix deprecation warnings --- src/basename/basename.rs | 2 +- src/comm/comm.rs | 2 +- src/fold/fold.rs | 2 +- src/nl/nl.rs | 2 +- src/shuf/shuf.rs | 2 +- src/split/split.rs | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/basename/basename.rs b/src/basename/basename.rs index d15f9669b..ac698a977 100644 --- a/src/basename/basename.rs +++ b/src/basename/basename.rs @@ -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() diff --git a/src/comm/comm.rs b/src/comm/comm.rs index 9e94e0b42..98960e0c7 100644 --- a/src/comm/comm.rs +++ b/src/comm/comm.rs @@ -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", } } diff --git a/src/fold/fold.rs b/src/fold/fold.rs index 80e075192..f411d2a7c 100644 --- a/src/fold/fold.rs +++ b/src/fold/fold.rs @@ -201,7 +201,7 @@ fn fold_file(file: BufferedReader, bytes: bool, spaces: bool, } _ => count += 1 }; - output.push_char(ch); + output.push(ch); } if count > 0 { print!("{}", output); diff --git a/src/nl/nl.rs b/src/nl/nl.rs index 8e45bdae6..8d7b33a2e 100644 --- a/src/nl/nl.rs +++ b/src/nl/nl.rs @@ -179,7 +179,7 @@ fn nl (reader: &mut BufferedReader, 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 diff --git a/src/shuf/shuf.rs b/src/shuf/shuf.rs index 46a1213bc..4d5394be0 100644 --- a/src/shuf/shuf.rs +++ b/src/shuf/shuf.rs @@ -141,7 +141,7 @@ fn shuf(input: Vec, 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() diff --git a/src/split/split.rs b/src/split/split.rs index f40e23325..844ac2ef3 100644 --- a/src/split/split.rs +++ b/src/split/split.rs @@ -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 }