do not print null values inside list
This commit is contained in:
parent
806dba12a3
commit
e5b7043480
@ -57,6 +57,7 @@ impl Display for Value {
|
||||
f,
|
||||
"{}",
|
||||
vals.iter()
|
||||
.filter(|x| !x.is_null())
|
||||
.map(std::string::ToString::to_string)
|
||||
.collect::<Vec<String>>()
|
||||
.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::<Vec<String>>()
|
||||
.join(sep.as_str()),
|
||||
|
@ -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"
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user