From 45a04ce5fc07b60078eed7d40bb1295554b803a6 Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Sun, 22 Dec 2019 17:13:30 -0600 Subject: [PATCH] refactor ~ replace deprecated `trim_{left,right}...` with `trim_{start,end}...` - `trim_{start,end}{,_matches}` stabilized in rust v1.30.0 - `trim_{start,end}{,_matches}` deprecated (with compiler warnings) in rust v1.33.0 + requires MinSRV >= v1.30.0 * ref: https://github.com/rust-lang/rust/blob/master/RELEASES.md --- src/fmt/parasplit.rs | 2 +- src/pwd/pwd.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fmt/parasplit.rs b/src/fmt/parasplit.rs index 5ffe4593e..499b3b04a 100644 --- a/src/fmt/parasplit.rs +++ b/src/fmt/parasplit.rs @@ -436,7 +436,7 @@ impl<'a> ParaWords<'a> { fn create_words(&mut self) { if self.para.mail_header { // no extra spacing for mail headers; always exactly 1 space - // safe to trim_left on every line of a mail header, since the + // safe to trim_start on every line of a mail header, since the // first line is guaranteed not to have any spaces self.words.extend( self.para diff --git a/src/pwd/pwd.rs b/src/pwd/pwd.rs index e4658989d..c43fcf386 100644 --- a/src/pwd/pwd.rs +++ b/src/pwd/pwd.rs @@ -29,7 +29,7 @@ pub fn absolute_path(path: &Path) -> io::Result { path_buf .as_path() .to_string_lossy() - .trim_left_matches(r"\\?\"), + .trim_start_matches(r"\\?\"), ).to_path_buf(); Ok(path_buf)