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) {
|
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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue