Skip to content

Commit

Permalink
linkchecker: Update deprecated trim_left_matches usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Xanewok committed Jan 19, 2019
1 parent c14508f commit ff41abc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/tools/linkchecker/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

Expand All @@ -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..];
Expand Down

0 comments on commit ff41abc

Please sign in to comment.