This commit is contained in:
yuni 2024-06-17 02:03:19 +02:00
parent c8825fb99b
commit 877e664df9

View file

@ -483,16 +483,14 @@ impl Preferences {
pub fn save(&self) { pub fn save(&self) {
if let Some(path) = get_prefs_path() { if let Some(path) = get_prefs_path() {
match toml_edit::ser::to_document::<Preferences>(self) { match toml_edit::ser::to_document::<Preferences>(self) {
Ok(doc) => { Ok(doc) => match fs::write(path.clone(), doc.to_string()) {
match fs::write(path.clone(), doc.to_string()) { Ok(_) => {
Ok(_) => { info!("Saved preferences to {path}.");
info!("Saved preferences to {path}.");
}
Err(error) => {
error!("Error while writing preferences: {:?}", error);
}
} }
} Err(error) => {
error!("Error while writing preferences: {:?}", error);
}
},
Err(error) => { Err(error) => {
error!("Error while writing preferences: {:?}", error); error!("Error while writing preferences: {:?}", error);
} }