Revert "Panic in debug if global settings can't be deserialized from defaults"

This reverts commit 7a051a0dcb.
This commit is contained in:
Antonio Scandurra 2023-06-26 16:03:19 +02:00
parent 00e37bc2a2
commit c5b3785be5

View File

@ -147,28 +147,25 @@ impl SettingsStore {
local_values: Vec::new(),
}));
let default_settings = setting_value
if let Some(default_settings) = setting_value
.deserialize_setting(&self.raw_default_settings)
.expect("can't deserialize default settings");
let mut user_values_stack = Vec::new();
if let Some(user_settings) = setting_value
.deserialize_setting(&self.raw_user_settings)
.log_err()
{
user_values_stack = vec![user_settings];
}
let mut user_values_stack = Vec::new();
#[cfg(debug_assertions)]
setting_value
.load_setting(&default_settings, &[], cx)
.expect("can't deserialize settings from defaults");
if let Some(user_settings) = setting_value
.deserialize_setting(&self.raw_user_settings)
.log_err()
{
user_values_stack = vec![user_settings];
}
if let Some(setting) = setting_value
.load_setting(&default_settings, &user_values_stack, cx)
.log_err()
{
setting_value.set_global_value(setting);
if let Some(setting) = setting_value
.load_setting(&default_settings, &user_values_stack, cx)
.log_err()
{
setting_value.set_global_value(setting);
}
}
}