diff --git a/src/value/mod.rs b/src/value/mod.rs index 59f19ff..8a04ece 100644 --- a/src/value/mod.rs +++ b/src/value/mod.rs @@ -57,6 +57,7 @@ impl Display for Value { f, "{}", vals.iter() + .filter(|x| !x.is_null()) .map(std::string::ToString::to_string) .collect::>() .join(sep.as_str()), @@ -65,6 +66,7 @@ impl Display for Value { f, "[{}]", vals.iter() + .filter(|x| !x.is_null()) .map(std::string::ToString::to_string) .collect::>() .join(sep.as_str()), diff --git a/tests/list.rs b/tests/list.rs index f32c415..e9eb30e 100644 --- a/tests/list.rs +++ b/tests/list.rs @@ -164,3 +164,8 @@ test!( "a {\n color: [1,];\n}\n", "a {\n color: [1];\n}\n" ); +test!( + null_values_in_list_ommitted, + "a {\n color: 1, null, null;;\n}\n", + "a {\n color: 1;\n}\n" +);