{
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
}
// These appear to be broken in mdbook right now?
- if fragment.starts_with("-") {
+ if fragment.starts_with('-') {
return;
}
}
fn maybe_redirect(source: &str) -> Option<String> {
- const REDIRECT: &'static str = "<p>Redirecting to <a href=";
+ const REDIRECT: &str = "<p>Redirecting to <a href=";
let mut lines = source.lines();
let redirect_line = lines.nth(6)?;
// we can get away with using one pass.
let is_base = line[..j].ends_with("<base");
line = rest;
- let pos_equals = match rest.find("=") {
+ let pos_equals = match rest.find('=') {
Some(i) => i,
None => continue,
};
- if rest[..pos_equals].trim_start_matches(" ") != "" {
+ if rest[..pos_equals].trim_start_matches(' ') != "" {
continue;
}
};
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..];