Assert that settings update was successful

This commit is contained in:
Dániel Buga 2022-03-19 09:24:47 +01:00
parent a2df2d72cc
commit f2d72df453
2 changed files with 3 additions and 2 deletions

View File

@ -376,7 +376,7 @@ pub fn update_file(key: &str, value: toml::Value) -> Option<()> {
let path = Self::settings_file()?;
std::fs::write(&path, toml::to_string(&main_table).ok()?.as_bytes()).ok()?;
None
Some(())
}
pub fn set_theme(&mut self, theme: &str, preview: bool) -> Option<()> {

View File

@ -532,7 +532,8 @@ fn event(
}
LapceUICommand::UpdateSettingsFile(key, value) => {
if let Ok(value) = toml::Value::deserialize(value) {
Config::update_file(key, value);
let update_result = Config::update_file(key, value);
debug_assert!(update_result.is_some());
}
}
LapceUICommand::OpenFileDiff(path, history) => {