rustdoc: get back missing crate-name when --playground-url is used
follow up PR #37763
This commit is contained in:
parent
b30022a1d3
commit
c1a6f17031
1 changed files with 8 additions and 0 deletions
|
@ -451,6 +451,14 @@ pub fn run(mut krate: clean::Crate,
|
||||||
css_file_extension: css_file_extension.clone(),
|
css_file_extension: css_file_extension.clone(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// If user passed in `--playground-url` arg, we fill in crate name here
|
||||||
|
markdown::PLAYGROUND.with(|slot| {
|
||||||
|
if slot.borrow().is_some() {
|
||||||
|
let url = slot.borrow().as_ref().unwrap().1.clone();
|
||||||
|
*slot.borrow_mut() = Some((Some(krate.name.clone()), url));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// Crawl the crate attributes looking for attributes which control how we're
|
// Crawl the crate attributes looking for attributes which control how we're
|
||||||
// going to emit HTML
|
// going to emit HTML
|
||||||
if let Some(attrs) = krate.module.as_ref().map(|m| &m.attrs) {
|
if let Some(attrs) = krate.module.as_ref().map(|m| &m.attrs) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue