cleanup
This commit is contained in:
parent
c8825fb99b
commit
877e664df9
16
src/var.rs
16
src/var.rs
|
@ -483,16 +483,14 @@ impl Preferences {
|
|||
pub fn save(&self) {
|
||||
if let Some(path) = get_prefs_path() {
|
||||
match toml_edit::ser::to_document::<Preferences>(self) {
|
||||
Ok(doc) => {
|
||||
match fs::write(path.clone(), doc.to_string()) {
|
||||
Ok(_) => {
|
||||
info!("Saved preferences to {path}.");
|
||||
}
|
||||
Err(error) => {
|
||||
error!("Error while writing preferences: {:?}", error);
|
||||
}
|
||||
Ok(doc) => match fs::write(path.clone(), doc.to_string()) {
|
||||
Ok(_) => {
|
||||
info!("Saved preferences to {path}.");
|
||||
}
|
||||
}
|
||||
Err(error) => {
|
||||
error!("Error while writing preferences: {:?}", error);
|
||||
}
|
||||
},
|
||||
Err(error) => {
|
||||
error!("Error while writing preferences: {:?}", error);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue