mirror of https://github.com/lapce/lapce.git
Assert that settings update was successful
This commit is contained in:
parent
a2df2d72cc
commit
f2d72df453
|
@ -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<()> {
|
||||
|
|
|
@ -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) => {
|
||||
|
|
Loading…
Reference in New Issue