Use UpdateGlobal accessors in more places (#11925)

This PR updates a number of instances that were previously using
`cx.update_global` to use `UpdateGlobal::update_global` instead.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-05-16 13:30:04 -04:00 committed by GitHub
parent c1e291bc96
commit 13bbaf1e18
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 66 additions and 68 deletions

View file

@ -17,8 +17,7 @@ use futures::{
TryFutureExt as _, TryStreamExt,
};
use gpui::{
actions, AnyModel, AnyWeakModel, AppContext, AsyncAppContext, BorrowAppContext, Global, Model,
Task, WeakModel,
actions, AnyModel, AnyWeakModel, AppContext, AsyncAppContext, Global, Model, Task, WeakModel,
};
use http::{HttpClient, HttpClientWithUrl};
use lazy_static::lazy_static;
@ -29,7 +28,7 @@ use release_channel::{AppVersion, ReleaseChannel};
use rpc::proto::{AnyTypedEnvelope, EntityMessage, EnvelopedMessage, PeerId, RequestMessage};
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use settings::{Settings, SettingsSources, SettingsStore};
use settings::{Settings, SettingsSources};
use std::fmt;
use std::pin::Pin;
use std::{
@ -141,10 +140,8 @@ impl Settings for ProxySettings {
pub fn init_settings(cx: &mut AppContext) {
TelemetrySettings::register(cx);
cx.update_global(|store: &mut SettingsStore, cx| {
store.register_setting::<ClientSettings>(cx);
store.register_setting::<ProxySettings>(cx);
});
ClientSettings::register(cx);
ProxySettings::register(cx);
}
pub fn init(client: &Arc<Client>, cx: &mut AppContext) {