aboutsummaryrefslogtreecommitdiffstats
path: root/components/config_plugins/lib.rs
diff options
context:
space:
mode:
authorHayashi Mikihiro <34ttrweoewiwe28@gmail.com>2024-08-16 01:28:04 +0900
committerGitHub <noreply@github.com>2024-08-15 16:28:04 +0000
commit016ff5dfa67d05b5c5d1d3fc42bf9f4fbeb537c1 (patch)
tree7e960ab68898b88ef06808872d70a17e2eaeb8c8 /components/config_plugins/lib.rs
parentc01b733523085bb9365601c252b7b49154383631 (diff)
downloadservo-016ff5dfa67d05b5c5d1d3fc42bf9f4fbeb537c1.tar.gz
servo-016ff5dfa67d05b5c5d1d3fc42bf9f4fbeb537c1.zip
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>
Diffstat (limited to 'components/config_plugins/lib.rs')
-rw-r--r--components/config_plugins/lib.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/components/config_plugins/lib.rs b/components/config_plugins/lib.rs
index 7e7badc3d2d..d419310dd84 100644
--- a/components/config_plugins/lib.rs
+++ b/components/config_plugins/lib.rs
@@ -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
- };
- }
+ });
});
}