mirror of
https://github.com/servo/servo.git
synced 2025-08-02 12:10:29 +01:00
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:
parent
c01b733523
commit
016ff5dfa6
12 changed files with 43 additions and 65 deletions
|
@ -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
|
||||
};
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue