Sometimes I prefer JSON/YAML with 4 space indentation instead of 2. Sometimes I want all YAML arrays to be indented relative to its dictionary field (which was what the old version of serde_yaml did). And sometimes I want array with only less than 5 small numbers to be in one line.
to_string_pretty doesn't provide any configuration parameter.