diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2019-03-17 14:17:47 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2019-03-17 17:04:58 +0300 |
| commit | db74efce69711fcee03d3338afcbca67c27ceee8 (patch) | |
| tree | ab54b453943a292c250b890140d431e99091be5e /src/librustdoc/html | |
| parent | 7cf074a1e655ac07d04d045667278fa1a9970b93 (diff) | |
| download | rust-db74efce69711fcee03d3338afcbca67c27ceee8.tar.gz rust-db74efce69711fcee03d3338afcbca67c27ceee8.zip | |
Make meta-item API compatible with `LocalInternedString::get` soundness fix
Diffstat (limited to 'src/librustdoc/html')
| -rw-r--r-- | src/librustdoc/html/render.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index b3a816d17f5..d6850ed3bb9 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -562,23 +562,23 @@ pub fn run(mut krate: clean::Crate, // going to emit HTML if let Some(attrs) = krate.module.as_ref().map(|m| &m.attrs) { for attr in attrs.lists("doc") { - match (attr.ident_str(), attr.value_str()) { - (Some("html_favicon_url"), Some(s)) => { + match (attr.name_or_empty().get(), attr.value_str()) { + ("html_favicon_url", Some(s)) => { scx.layout.favicon = s.to_string(); } - (Some("html_logo_url"), Some(s)) => { + ("html_logo_url", Some(s)) => { scx.layout.logo = s.to_string(); } - (Some("html_playground_url"), Some(s)) => { + ("html_playground_url", Some(s)) => { markdown::PLAYGROUND.with(|slot| { let name = krate.name.clone(); *slot.borrow_mut() = Some((Some(name), s.to_string())); }); } - (Some("issue_tracker_base_url"), Some(s)) => { + ("issue_tracker_base_url", Some(s)) => { scx.issue_tracker_base_url = Some(s.to_string()); } - (Some("html_no_source"), None) if attr.is_word() => { + ("html_no_source", None) if attr.is_word() => { scx.include_sources = false; } _ => {} @@ -3749,7 +3749,7 @@ fn render_attributes(w: &mut fmt::Formatter<'_>, it: &clean::Item) -> fmt::Resul let mut attrs = String::new(); for attr in &it.attrs.other_attrs { - if !attr.ident_str().map_or(false, |name| ATTRIBUTE_WHITELIST.contains(&name)) { + if !ATTRIBUTE_WHITELIST.contains(&attr.name_or_empty().get()) { continue; } if let Some(s) = render_attribute(&attr.meta().unwrap()) { |
