[PATCH] Backport deprecation fixes from commit b7f030e
authorJosh Stone <jistone@redhat.com>
Fri, 1 Mar 2019 17:27:45 +0000 (09:27 -0800)
committerXimin Luo <infinity0@debian.org>
Sat, 18 May 2019 19:18:25 +0000 (20:18 +0100)
Gbp-Pq: Name u-0001-Backport-deprecation-fixes-from-commit-b7f030e.patch

src/tools/linkchecker/main.rs
src/tools/tidy/src/features.rs

index 59662be349dcb18885b9e95800eb9d829bee4518..2cf0fcfd34cd6b19f48d797d6549747fe61188bf 100644 (file)
@@ -78,7 +78,7 @@ impl FileEntry {
     fn parse_ids(&mut self, file: &Path, contents: &str, errors: &mut bool) {
         if self.ids.is_empty() {
             with_attrs_in_source(contents, " id", |fragment, i, _| {
-                let frag = fragment.trim_left_matches("#").to_owned();
+                let frag = fragment.trim_start_matches("#").to_owned();
                 let encoded = small_url_encode(&frag);
                 if !self.ids.insert(frag) {
                     *errors = true;
@@ -343,7 +343,7 @@ fn with_attrs_in_source<F: FnMut(&str, usize, &str)>(contents: &str, attr: &str,
                 Some(i) => i,
                 None => continue,
             };
-            if rest[..pos_equals].trim_left_matches(" ") != "" {
+            if rest[..pos_equals].trim_start_matches(" ") != "" {
                 continue;
             }
 
@@ -355,7 +355,7 @@ fn with_attrs_in_source<F: FnMut(&str, usize, &str)>(contents: &str, attr: &str,
             };
             let quote_delim = rest.as_bytes()[pos_quote] as char;
 
-            if rest[..pos_quote].trim_left_matches(" ") != "" {
+            if rest[..pos_quote].trim_start_matches(" ") != "" {
                 continue;
             }
             let rest = &rest[pos_quote + 1..];
index 2435a0cfd4e3892b968290c2ac647db4f9a7f908..bf2cfbf32fc7465ad4fba86a4419c4dfb94a5891 100644 (file)
@@ -188,7 +188,7 @@ pub fn collect_lang_features(base_src_path: &Path, bad: &mut bool) -> Features {
             }
 
             let mut parts = line.split(',');
-            let level = match parts.next().map(|l| l.trim().trim_left_matches('(')) {
+            let level = match parts.next().map(|l| l.trim().trim_start_matches('(')) {
                 Some("active") => Status::Unstable,
                 Some("removed") => Status::Removed,
                 Some("accepted") => Status::Stable,