1 |
From 55030c7543d8e877ec7a6b577a51422c38f01259 Mon Sep 17 00:00:00 2001 |
2 |
From: Josh Stone <jistone@redhat.com> |
3 |
Date: Fri, 1 Mar 2019 09:27:45 -0800 |
4 |
Subject: [PATCH] Backport deprecation fixes from commit b7f030e |
5 |
|
6 |
--- |
7 |
src/tools/linkchecker/main.rs | 6 +++--- |
8 |
src/tools/tidy/src/features.rs | 2 +- |
9 |
2 files changed, 4 insertions(+), 4 deletions(-) |
10 |
|
11 |
diff --git a/src/tools/linkchecker/main.rs b/src/tools/linkchecker/main.rs |
12 |
index 59662be349dc..2cf0fcfd34cd 100644 |
13 |
--- a/src/tools/linkchecker/main.rs |
14 |
+++ b/src/tools/linkchecker/main.rs |
15 |
@@ -78,7 +78,7 @@ impl FileEntry { |
16 |
fn parse_ids(&mut self, file: &Path, contents: &str, errors: &mut bool) { |
17 |
if self.ids.is_empty() { |
18 |
with_attrs_in_source(contents, " id", |fragment, i, _| { |
19 |
- let frag = fragment.trim_left_matches("#").to_owned(); |
20 |
+ let frag = fragment.trim_start_matches("#").to_owned(); |
21 |
let encoded = small_url_encode(&frag); |
22 |
if !self.ids.insert(frag) { |
23 |
*errors = true; |
24 |
@@ -343,7 +343,7 @@ fn with_attrs_in_source<F: FnMut(&str, usize, &str)>(contents: &str, attr: &str, |
25 |
Some(i) => i, |
26 |
None => continue, |
27 |
}; |
28 |
- if rest[..pos_equals].trim_left_matches(" ") != "" { |
29 |
+ if rest[..pos_equals].trim_start_matches(" ") != "" { |
30 |
continue; |
31 |
} |
32 |
|
33 |
@@ -355,7 +355,7 @@ fn with_attrs_in_source<F: FnMut(&str, usize, &str)>(contents: &str, attr: &str, |
34 |
}; |
35 |
let quote_delim = rest.as_bytes()[pos_quote] as char; |
36 |
|
37 |
- if rest[..pos_quote].trim_left_matches(" ") != "" { |
38 |
+ if rest[..pos_quote].trim_start_matches(" ") != "" { |
39 |
continue; |
40 |
} |
41 |
let rest = &rest[pos_quote + 1..]; |
42 |
diff --git a/src/tools/tidy/src/features.rs b/src/tools/tidy/src/features.rs |
43 |
index 2435a0cfd4e3..bf2cfbf32fc7 100644 |
44 |
--- a/src/tools/tidy/src/features.rs |
45 |
+++ b/src/tools/tidy/src/features.rs |
46 |
@@ -188,7 +188,7 @@ pub fn collect_lang_features(base_src_path: &Path, bad: &mut bool) -> Features { |
47 |
} |
48 |
|
49 |
let mut parts = line.split(','); |
50 |
- let level = match parts.next().map(|l| l.trim().trim_left_matches('(')) { |
51 |
+ let level = match parts.next().map(|l| l.trim().trim_start_matches('(')) { |
52 |
Some("active") => Status::Unstable, |
53 |
Some("removed") => Status::Removed, |
54 |
Some("accepted") => Status::Stable, |
55 |
-- |
56 |
2.20.1 |
57 |
|