diff --git a/lapce-data/src/config.rs b/lapce-data/src/config.rs index 9b00ed7c..cd4f7954 100644 --- a/lapce-data/src/config.rs +++ b/lapce-data/src/config.rs @@ -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<()> { diff --git a/lapce-ui/src/tab.rs b/lapce-ui/src/tab.rs index 48cb480e..b689b94e 100644 --- a/lapce-ui/src/tab.rs +++ b/lapce-ui/src/tab.rs @@ -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) => {