rustdoc: Only include a stability span if needed.
This patch gets rid of the empty stability boxes in docs by only including the span that creates it when the item actually has a stability class.
Here are images of the issue on `std::process::Output`:
Before:
<img width="340" alt="before" src="https://cloud.githubusercontent.com/assets/122457/
22853638/
ff88d1b2-f010-11e6-90d6-
bf3d10e2fffa.png">
After:
<img width="333" alt="after" src="https://cloud.githubusercontent.com/assets/122457/
22853639/
06bfe7cc-f011-11e6-9892-
f0ea2cc6ec90.png">
This is my first non-trivial patch to Rust, so I'm sure some of my approach is not idiomatic. Let me know how you'd like me to adjust!
stab_docs = stab_docs,
docs = shorter(Some(&Markdown(doc_value).to_string())),
class = myitem.type_(),
- stab = myitem.stability_class(),
+ stab = myitem.stability_class().unwrap_or("".to_string()),
unsafety_flag = unsafety_flag,
href = item_path(myitem.type_(), myitem.name.as_ref().unwrap()),
+ title_type = myitem.type_(),
title = full_path(cx, myitem))?;
}
}