Skip to content

Commit d97c470

Browse files
committed
linkcheckr: fix clippy::redundant_static_lifetimes and clippy::single_char_pattern
1 parent 7c6362a commit d97c470

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/tools/linkchecker/main.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,10 @@ fn check(cache: &mut Cache, root: &Path, file: &Path, errors: &mut bool) -> Opti
172172
{
173173
return;
174174
}
175-
let mut parts = url.splitn(2, "#");
175+
let mut parts = url.splitn(2, '#');
176176
let url = parts.next().unwrap();
177177
let fragment = parts.next();
178-
let mut parts = url.splitn(2, "?");
178+
let mut parts = url.splitn(2, '?');
179179
let url = parts.next().unwrap();
180180

181181
// Once we've plucked out the URL, parse it using our base url and
@@ -258,7 +258,7 @@ fn check(cache: &mut Cache, root: &Path, file: &Path, errors: &mut bool) -> Opti
258258
}
259259

260260
// These appear to be broken in mdbook right now?
261-
if fragment.starts_with("-") {
261+
if fragment.starts_with('-') {
262262
return;
263263
}
264264

@@ -324,7 +324,7 @@ fn load_file(
324324
}
325325

326326
fn maybe_redirect(source: &str) -> Option<String> {
327-
const REDIRECT: &'static str = "<p>Redirecting to <a href=";
327+
const REDIRECT: &str = "<p>Redirecting to <a href=";
328328

329329
let mut lines = source.lines();
330330
let redirect_line = lines.nth(6)?;
@@ -345,11 +345,11 @@ fn with_attrs_in_source<F: FnMut(&str, usize, &str)>(contents: &str, attr: &str,
345345
// we can get away with using one pass.
346346
let is_base = line[..j].ends_with("<base");
347347
line = rest;
348-
let pos_equals = match rest.find("=") {
348+
let pos_equals = match rest.find('=') {
349349
Some(i) => i,
350350
None => continue,
351351
};
352-
if rest[..pos_equals].trim_start_matches(" ") != "" {
352+
if rest[..pos_equals].trim_start_matches(' ') != "" {
353353
continue;
354354
}
355355

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

364-
if rest[..pos_quote].trim_start_matches(" ") != "" {
364+
if rest[..pos_quote].trim_start_matches(' ') != "" {
365365
continue;
366366
}
367367
let rest = &rest[pos_quote + 1..];

0 commit comments

Comments
 (0)