Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Fix broken loading of `auto_update` setting (#10301)

Marshall Bowersee1642a50f4e
diff --git a/crates/auto_update/src/auto_update.rs b/crates/auto_update/src/auto_update.rs
index 7ba1a55fb47..9e41d7248f0 100644
--- a/crates/auto_update/src/auto_update.rs
+++ b/crates/auto_update/src/auto_update.rs
@@ -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)?))
}
}