From: Matthias Krüger Date: Sat, 22 Aug 2020 00:09:20 +0000 (+0200) Subject: linkcheckr: fix clippy::redundant_static_lifetimes and clippy::single_char_pattern X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=d97c4703eb427be4209bc2bd4845fa6abafa3eb5;p=rust.git linkcheckr: fix clippy::redundant_static_lifetimes and clippy::single_char_pattern --- diff --git a/src/tools/linkchecker/main.rs b/src/tools/linkchecker/main.rs index 194318d7a59..b7ceba1e282 100644 --- a/src/tools/linkchecker/main.rs +++ b/src/tools/linkchecker/main.rs @@ -172,10 +172,10 @@ fn check(cache: &mut Cache, root: &Path, file: &Path, errors: &mut bool) -> Opti { return; } - let mut parts = url.splitn(2, "#"); + let mut parts = url.splitn(2, '#'); let url = parts.next().unwrap(); let fragment = parts.next(); - let mut parts = url.splitn(2, "?"); + let mut parts = url.splitn(2, '?'); let url = parts.next().unwrap(); // 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 } // These appear to be broken in mdbook right now? - if fragment.starts_with("-") { + if fragment.starts_with('-') { return; } @@ -324,7 +324,7 @@ fn load_file( } fn maybe_redirect(source: &str) -> Option { - const REDIRECT: &'static str = "

Redirecting to Redirecting to (contents: &str, attr: &str, }; let quote_delim = rest.as_bytes()[pos_quote] as char; - if rest[..pos_quote].trim_start_matches(" ") != "" { + if rest[..pos_quote].trim_start_matches(' ') != "" { continue; } let rest = &rest[pos_quote + 1..];