1
Fork 0

rustdoc: get back missing crate-name when --playground-url is used

follow up PR #37763
This commit is contained in:
Liigo Zhuang 2016-11-18 10:40:51 +08:00
parent b30022a1d3
commit c1a6f17031

View file

@ -451,6 +451,14 @@ pub fn run(mut krate: clean::Crate,
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
// going to emit HTML
if let Some(attrs) = krate.module.as_ref().map(|m| &m.attrs) {