]> Repositorios git - scryer-prolog.git/commitdiff
render [] as empty string in AtomOrString::as_str() (#1193)
authorMark Thom <[email protected]>
Tue, 11 Jan 2022 03:46:00 +0000 (20:46 -0700)
committerMark Thom <[email protected]>
Tue, 11 Jan 2022 03:46:00 +0000 (20:46 -0700)
src/forms.rs

index ce517a5f9e9a29f80855de751f1c53e80d177094..167b937ed1f4ba1ee3563695db8ceb507e873061 100644 (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(),
         }