Replace lazy_static crate with std::sync::LazyLock in layout and config (#33065)

* replace in layout_thread_2020

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

* replace in layout_thread

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

* replace in layout

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

* replace in config

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

* replace in config_plugins

The macro of config_plugins require Send trait bounds

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

---------

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
This commit is contained in:
Hayashi Mikihiro 2024-08-16 01:28:04 +09:00 committed by GitHub
parent c01b733523
commit 016ff5dfa6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 43 additions and 65 deletions

View file

@ -195,16 +195,16 @@ impl fmt::Display for PrefError {
impl std::error::Error for PrefError {}
pub struct Accessor<P, V> {
pub getter: Box<dyn Fn(&P) -> V + Sync>,
pub getter: Box<dyn Fn(&P) -> V + Sync + Send>,
#[allow(clippy::type_complexity)]
pub setter: Box<dyn Fn(&mut P, V) + Sync>,
pub setter: Box<dyn Fn(&mut P, V) + Sync + Send>,
}
impl<P, V> Accessor<P, V> {
pub fn new<G, S>(getter: G, setter: S) -> Self
where
G: Fn(&P) -> V + Sync + 'static,
S: Fn(&mut P, V) + Sync + 'static,
G: Fn(&P) -> V + Sync + Send + 'static,
S: Fn(&mut P, V) + Sync + Send + 'static,
{
Accessor {
getter: Box::new(getter),