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

@ -108,13 +108,12 @@ impl Build {
let num_prefs = self.path_map.len();
self.output.extend(quote! {
lazy_static::lazy_static! {
pub static ref #gen_accessors: std::collections::HashMap<String, #accessor_type> = {
pub static #gen_accessors: std::sync::LazyLock<std::collections::HashMap<String, #accessor_type>> =
std::sync::LazyLock::new(|| {
let mut map = std::collections::HashMap::with_capacity(#num_prefs);
#(#values)*
map
};
}
});
});
}