1
Fork 0

Include type in non-exhaustive message. Include new css in dark theme.

This commit is contained in:
David Wood 2018-06-27 23:07:42 +01:00
parent a074bd7334
commit 039709d34f
No known key found for this signature in database
GPG key ID: 01760B4F9F53F154
2 changed files with 6 additions and 4 deletions

View file

@ -2265,21 +2265,22 @@ fn document_stability(w: &mut fmt::Formatter, cx: &Context, item: &clean::Item)
fn document_non_exhaustive(w: &mut fmt::Formatter, item: &clean::Item) -> fmt::Result {
if item.non_exhaustive {
let name = item.type_();
write!(w, r##"
<div class='non-exhaustive'>
<div class='stab non-exhaustive'>
<details>
<summary>
<span class=microscope>🔬</span>
This type is marked as non exhaustive.
This {} is marked as non exhaustive.
</summary>
<p>
This type will require a wildcard arm in any match statements or constructors.
This {} will require a wildcard arm in any match statements or constructors.
</p>
</details>
</div>
</div>
"##)?;
"##, name, name)?;
}
Ok(())