Remove optional path argument when getting settings
This commit is contained in:
parent
1f0e79ee9d
commit
2d5f03e148
35 changed files with 84 additions and 113 deletions
|
@ -4,14 +4,7 @@ use assets::Assets;
|
|||
use fs::Fs;
|
||||
use futures::{channel::mpsc, StreamExt};
|
||||
use gpui::{executor::Background, AppContext, AssetSource};
|
||||
use std::{
|
||||
borrow::Cow,
|
||||
io::ErrorKind,
|
||||
path::{Path, PathBuf},
|
||||
str,
|
||||
sync::Arc,
|
||||
time::Duration,
|
||||
};
|
||||
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) {
|
||||
|
@ -20,8 +13,8 @@ pub fn register_setting<T: Setting>(cx: &mut AppContext) {
|
|||
});
|
||||
}
|
||||
|
||||
pub fn get_setting<'a, T: Setting>(path: Option<&Path>, cx: &'a AppContext) -> &'a T {
|
||||
cx.global::<SettingsStore>().get(path)
|
||||
pub fn get<'a, T: Setting>(cx: &'a AppContext) -> &'a T {
|
||||
cx.global::<SettingsStore>().get(None)
|
||||
}
|
||||
|
||||
pub fn default_settings() -> Cow<'static, str> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue