Skip to content

Commit ff41abc

Browse files
committed
linkchecker: Update deprecated trim_left_matches usage
1 parent c14508f commit ff41abc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/tools/linkchecker/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ impl FileEntry {
7878
fn parse_ids(&mut self, file: &Path, contents: &str, errors: &mut bool) {
7979
if self.ids.is_empty() {
8080
with_attrs_in_source(contents, " id", |fragment, i, _| {
81-
let frag = fragment.trim_left_matches("#").to_owned();
81+
let frag = fragment.trim_start_matches("#").to_owned();
8282
let encoded = small_url_encode(&frag);
8383
if !self.ids.insert(frag) {
8484
*errors = true;
@@ -343,7 +343,7 @@ fn with_attrs_in_source<F: FnMut(&str, usize, &str)>(contents: &str, attr: &str,
343343
Some(i) => i,
344344
None => continue,
345345
};
346-
if rest[..pos_equals].trim_left_matches(" ") != "" {
346+
if rest[..pos_equals].trim_start_matches(" ") != "" {
347347
continue;
348348
}
349349

@@ -355,7 +355,7 @@ fn with_attrs_in_source<F: FnMut(&str, usize, &str)>(contents: &str, attr: &str,
355355
};
356356
let quote_delim = rest.as_bytes()[pos_quote] as char;
357357

358-
if rest[..pos_quote].trim_left_matches(" ") != "" {
358+
if rest[..pos_quote].trim_start_matches(" ") != "" {
359359
continue;
360360
}
361361
let rest = &rest[pos_quote + 1..];

0 commit comments

Comments
 (0)