Rename settings::register_setting -> settings::register

This commit is contained in:
Max Brunsfeld 2023-05-17 15:06:11 -07:00
parent 2d5f03e148
commit 258723566f
12 changed files with 12 additions and 12 deletions

View File

@ -77,7 +77,7 @@ impl Setting for AutoUpdateSetting {
}
pub fn init(http_client: Arc<dyn HttpClient>, server_url: String, cx: &mut AppContext) {
settings::register_setting::<AutoUpdateSetting>(cx);
settings::register::<AutoUpdateSetting>(cx);
if let Some(version) = (*ZED_APP_VERSION).or_else(|| cx.platform().app_version().ok()) {
let auto_updater = cx.add_model(|cx| {

View File

@ -71,7 +71,7 @@ pub const CONNECTION_TIMEOUT: Duration = Duration::from_secs(5);
actions!(client, [SignIn, SignOut]);
pub fn init_settings(cx: &mut AppContext) {
settings::register_setting::<TelemetrySettings>(cx);
settings::register::<TelemetrySettings>(cx);
}
pub fn init(client: &Arc<Client>, cx: &mut AppContext) {

View File

@ -290,7 +290,7 @@ pub enum Direction {
}
pub fn init_settings(cx: &mut AppContext) {
settings::register_setting::<EditorSettings>(cx);
settings::register::<EditorSettings>(cx);
}
pub fn init(cx: &mut AppContext) {

View File

@ -47,7 +47,7 @@ impl settings::Setting for JournalSettings {
}
pub fn init(app_state: Arc<AppState>, cx: &mut AppContext) {
settings::register_setting::<JournalSettings>(cx);
settings::register::<JournalSettings>(cx);
cx.add_global_action(move |_: &NewJournalEntry, cx| new_journal_entry(app_state.clone(), cx));
}

View File

@ -9,7 +9,7 @@ use serde::{Deserialize, Serialize};
use std::{num::NonZeroU32, path::Path, sync::Arc};
pub fn init(cx: &mut AppContext) {
settings::register_setting::<AllLanguageSettings>(cx);
settings::register::<AllLanguageSettings>(cx);
}
pub fn language_settings<'a>(language: Option<&str>, cx: &'a AppContext) -> &'a LanguageSettings {

View File

@ -390,7 +390,7 @@ impl FormatTrigger {
impl Project {
pub fn init_settings(cx: &mut AppContext) {
settings::register_setting::<ProjectSettings>(cx);
settings::register::<ProjectSettings>(cx);
}
pub fn init(client: &Arc<Client>, cx: &mut AppContext) {

View File

@ -7,7 +7,7 @@ use gpui::{executor::Background, AppContext, AssetSource};
use std::{borrow::Cow, io::ErrorKind, path::PathBuf, str, sync::Arc, time::Duration};
use util::{paths, ResultExt};
pub fn register_setting<T: Setting>(cx: &mut AppContext) {
pub fn register<T: Setting>(cx: &mut AppContext) {
cx.update_global::<SettingsStore, _, _>(|store, cx| {
store.register_setting::<T>(cx);
});

View File

@ -116,7 +116,7 @@ impl EventListener for ZedListener {
}
pub fn init(cx: &mut AppContext) {
settings::register_setting::<TerminalSettings>(cx);
settings::register::<TerminalSettings>(cx);
}
#[derive(Deserialize)]

View File

@ -22,7 +22,7 @@ pub fn current(cx: &AppContext) -> Arc<Theme> {
pub fn init(source: impl AssetSource, cx: &mut AppContext) {
cx.set_global(ThemeRegistry::new(source, cx.font_cache().clone()));
settings::register_setting::<ThemeSettings>(cx);
settings::register::<ThemeSettings>(cx);
}
#[derive(Deserialize, Default)]

View File

@ -42,7 +42,7 @@ actions!(vim, [Tab, Enter]);
impl_actions!(vim, [Number, SwitchMode, PushOperator]);
pub fn init(cx: &mut AppContext) {
settings::register_setting::<VimModeSetting>(cx);
settings::register::<VimModeSetting>(cx);
editor_events::init(cx);
normal::init(cx);

View File

@ -20,7 +20,7 @@ pub use base_keymap_setting::BaseKeymap;
pub const FIRST_OPEN: &str = "first_open";
pub fn init(cx: &mut AppContext) {
settings::register_setting::<BaseKeymap>(cx);
settings::register::<BaseKeymap>(cx);
cx.add_action(|workspace: &mut Workspace, _: &Welcome, cx| {
let welcome_page = cx.add_view(|cx| WelcomePage::new(workspace, cx));

View File

@ -185,7 +185,7 @@ pub type WorkspaceId = i64;
impl_actions!(workspace, [ActivatePane]);
pub fn init_settings(cx: &mut AppContext) {
settings::register_setting::<WorkspaceSettings>(cx);
settings::register::<WorkspaceSettings>(cx);
}
pub fn init(app_state: Arc<AppState>, cx: &mut AppContext) {