From 611fbe2eef58833622cf6fa0d5ae6477bae4c123 Mon Sep 17 00:00:00 2001 From: Victor Porof Date: Fri, 3 Feb 2017 09:02:18 +0100 Subject: [PATCH] Properly print null edn values as "nil", to allow for isomorphic write/parse Signed-off-by: Victor Porof --- edn/src/types.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/edn/src/types.rs b/edn/src/types.rs index 3f7fc4f4..0042851c 100644 --- a/edn/src/types.rs +++ b/edn/src/types.rs @@ -50,7 +50,7 @@ impl Display for Value { // See https://github.com/mozilla/mentat/issues/232 fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result { match *self { - Nil => write!(f, "null"), + Nil => write!(f, "nil"), Boolean(v) => write!(f, "{}", v), Integer(v) => write!(f, "{}", v), BigInteger(ref v) => write!(f, "{}N", v), @@ -280,7 +280,7 @@ mod test { #[test] fn test_print_edn() { - assert_eq!("[ 1 2 ( 3.14 ) #{ 4N } { :foo/bar 42 } [ ] :five :six/seven eight nine/ten true false null ]", + assert_eq!("[ 1 2 ( 3.14 ) #{ 4N } { :foo/bar 42 } [ ] :five :six/seven eight nine/ten true false nil ]", Value::Vector(vec![ Value::Integer(1), Value::Integer(2),