Only mention name if we have it?

This commit is contained in:
Andrew Voynov 2025-06-04 17:50:31 +03:00
parent 31af413b98
commit 31f25ed0fe
No known key found for this signature in database
GPG Key ID: 1BE92DD685700329

View File

@ -224,11 +224,14 @@ impl Show for Packed<BibliographyElem> {
let references = works
.references
.as_ref()
.ok_or_else(|| {
eco_format!(
"{:?} CSL style is not suitable for bibliographies",
self.style(styles).into_value()
)
.ok_or_else(|| match self.style(styles).source {
CslSource::Named(style) => eco_format!(
"CSL style `{}` is not suitable for bibliographies",
style.display_name()
),
CslSource::Normal(..) => {
eco_format!("CSL style is not suitable for bibliographies")
}
})
.at(span)?;