eframe: don't prettify presisted ron strings (#902)
What ultimately ends up stored into a file is the HashMap<String, String>, which when prettified only nets three (depending on the settings) lines of "string": "long prettified string that's really hard to read because of the extra indentation and literal \n characters that are all just on one single line". Not prettifying the values in the first place makes it somewhat easier to read and also saves a bit of space.
This commit is contained in:
parent
9d56bce592
commit
224d4d6d26
1 changed files with 1 additions and 4 deletions
|
@ -413,10 +413,7 @@ pub fn get_value<T: serde::de::DeserializeOwned>(storage: &dyn Storage, key: &st
|
|||
/// Serialize the given value as [RON](https://github.com/ron-rs/ron) and store with the given key.
|
||||
#[cfg(feature = "ron")]
|
||||
pub fn set_value<T: serde::Serialize>(storage: &mut dyn Storage, key: &str, value: &T) {
|
||||
storage.set_string(
|
||||
key,
|
||||
ron::ser::to_string_pretty(value, Default::default()).unwrap(),
|
||||
);
|
||||
storage.set_string(key, ron::ser::to_string(value).unwrap());
|
||||
}
|
||||
|
||||
/// [`Storage`] key used for app
|
||||
|
|
Loading…
Reference in a new issue