mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-10 20:29:05 +00:00
Fix broken loading of auto_update
setting (#10301)
This PR fixes a panic when attempting to load the `auto_update` setting. This was leftover from #10296. I'm going to see if there's a better way we can handle these cases so they're more obviously correct. Release Notes: - N/A
This commit is contained in:
parent
7c5bc3c26f
commit
ee1642a50f
1 changed files with 13 additions and 8 deletions
|
@ -92,14 +92,19 @@ impl Settings for AutoUpdateSetting {
|
|||
type FileContent = AutoUpdateSettingOverride;
|
||||
|
||||
fn load(sources: SettingsSources<Self::FileContent>, _: &mut AppContext) -> Result<Self> {
|
||||
Ok(Self(
|
||||
sources
|
||||
.release_channel
|
||||
.or(sources.user)
|
||||
.unwrap_or(sources.default)
|
||||
.0
|
||||
.ok_or_else(Self::missing_default)?,
|
||||
))
|
||||
if let Some(release_channel_value) = sources.release_channel {
|
||||
if let Some(value) = release_channel_value.0 {
|
||||
return Ok(Self(value));
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(user_value) = sources.user {
|
||||
if let Some(value) = user_value.0 {
|
||||
return Ok(Self(value));
|
||||
}
|
||||
}
|
||||
|
||||
Ok(Self(sources.default.0.ok_or_else(Self::missing_default)?))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue