ron-rs/ron

Is there a way to use to_string with struct names

Closed this issue · 3 comments

When using the ron::ser::to_string() function, the struct names option for the Serializer is set to false. Is there a way to run the same function but with struct names set to true? Since the output field of the Serializer struct is private, I was unable to rewrite the function in my own crate.

You can use ron::ser::to_string_pretty(value, ron::ser::PrettyConfig::new().struct_names(true))

I was looking for this but it wasn't in v0.7.0. I see this has been added recently. Thanks.

I'm glad I could help you :)