diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2020-02-26 13:03:46 +0100 |
|---|---|---|
| committer | Matthias Krüger <matthias.krueger@famsik.de> | 2020-02-27 14:57:22 +0100 |
| commit | 7c84ba112429eb9bc0b99a6fe32a453c920a764c (patch) | |
| tree | 98a44856b3d3b0792b8c9726b34cbbb5a7f34c67 /src/librustdoc/html | |
| parent | a8437cf213ac1e950b6f5c691c4d2a29bf949bcd (diff) | |
| download | rust-7c84ba112429eb9bc0b99a6fe32a453c920a764c.tar.gz rust-7c84ba112429eb9bc0b99a6fe32a453c920a764c.zip | |
use char instead of &str for single char patterns
Diffstat (limited to 'src/librustdoc/html')
| -rw-r--r-- | src/librustdoc/html/markdown.rs | 2 | ||||
| -rw-r--r-- | src/librustdoc/html/render.rs | 2 | ||||
| -rw-r--r-- | src/librustdoc/html/render/cache.rs | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/src/librustdoc/html/markdown.rs b/src/librustdoc/html/markdown.rs index 56f7b07cfc8..ff6431640d3 100644 --- a/src/librustdoc/html/markdown.rs +++ b/src/librustdoc/html/markdown.rs @@ -707,7 +707,7 @@ impl LangString { x if x.starts_with("edition") => { data.edition = x[7..].parse::<Edition>().ok(); } - x if allow_error_code_check && x.starts_with("E") && x.len() == 5 => { + x if allow_error_code_check && x.starts_with('E') && x.len() == 5 => { if x[1..].parse::<u32>().is_ok() { data.error_codes.push(x.to_owned()); seen_rust_tags = !seen_other_tags || seen_rust_tags; diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index bda220d8806..59677b28245 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -86,7 +86,7 @@ pub type NameDoc = (String, Option<String>); crate fn ensure_trailing_slash(v: &str) -> impl fmt::Display + '_ { crate::html::format::display_fn(move |f| { - if !v.ends_with("/") && !v.is_empty() { write!(f, "{}/", v) } else { write!(f, "{}", v) } + if !v.ends_with('/') && !v.is_empty() { write!(f, "{}/", v) } else { write!(f, "{}", v) } }) } diff --git a/src/librustdoc/html/render/cache.rs b/src/librustdoc/html/render/cache.rs index 3acfb82fe78..e9ebccb7ec0 100644 --- a/src/librustdoc/html/render/cache.rs +++ b/src/librustdoc/html/render/cache.rs @@ -534,7 +534,7 @@ fn extern_location( if let Some(url) = extern_url { let mut url = url.to_string(); - if !url.ends_with("/") { + if !url.ends_with('/') { url.push('/'); } return Remote(url); @@ -548,7 +548,7 @@ fn extern_location( .filter_map(|a| a.value_str()) .map(|url| { let mut url = url.to_string(); - if !url.ends_with("/") { + if !url.ends_with('/') { url.push('/') } Remote(url) |
