render [] as empty string in AtomOrString::as_str() (#1193)

This commit is contained in:
Mark Thom
2022-01-10 20:46:00 -07:00
parent e3622e0860
commit 5f4e701461

View File

@@ -360,6 +360,7 @@ impl AtomOrString {
#[inline]
pub fn as_str(&self) -> &str {
match self {
AtomOrString::Atom(atom) if atom == &atom!("[]") => "",
AtomOrString::Atom(atom) => atom.as_str(),
AtomOrString::String(string) => string.as_str(),
}