Hi,
first off, thank you for the great work! I have recently started to use this lib and I found that when serializing mappings, empty values are replaces by ~. For one of my projects I would like to generate files containing the ? notation instead (like in the unordered set example).
So for example, currently:
fn main() {
let mut hm = HashMap::new();
hm.insert("test", ());
let mut set = HashMap::new();
set.insert("mySet", hm);
println!("{}", serde_yaml::to_string(&set).unwrap());
}
gives:
---
mySet:
test: ~
Is there any option or simple solution to get this instead?
Just for reference, this seems to be a property of the underlying library, see this line.
And there also exists an open issue that is at least somewhat related to this.
Hi, first off, thank you for the great work! I have recently started to use this lib and I found that when serializing mappings, empty values are replaces by
~
. For one of my projects I would like to generate files containing the?
notation instead (like in the unordered set example).So for example, currently:
gives:
Is there any option or simple solution to get this instead?