diff options
author | Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> | 2024-08-16 01:28:04 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-15 16:28:04 +0000 |
commit | 016ff5dfa67d05b5c5d1d3fc42bf9f4fbeb537c1 (patch) | |
tree | 7e960ab68898b88ef06808872d70a17e2eaeb8c8 /components/layout/generated_content.rs | |
parent | c01b733523085bb9365601c252b7b49154383631 (diff) | |
download | servo-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/layout/generated_content.rs')
-rw-r--r-- | components/layout/generated_content.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/components/layout/generated_content.rs b/components/layout/generated_content.rs index 3a50024d522..9cadcbc8aa6 100644 --- a/components/layout/generated_content.rs +++ b/components/layout/generated_content.rs @@ -9,8 +9,8 @@ //! as possible. use std::collections::{HashMap, LinkedList}; +use std::sync::LazyLock; -use lazy_static::lazy_static; use script_layout_interface::wrapper_traits::PseudoElementType; use smallvec::SmallVec; use style::computed_values::list_style_type::T as ListStyleType; @@ -29,8 +29,8 @@ use crate::fragment::{ use crate::text::TextRunScanner; use crate::traversal::InorderFlowTraversal; -lazy_static! { - static ref INITIAL_QUOTES: style::ArcSlice<QuotePair> = style::ArcSlice::from_iter_leaked( +static INITIAL_QUOTES: LazyLock<style::ArcSlice<QuotePair>> = LazyLock::new(|| { + style::ArcSlice::from_iter_leaked( vec![ QuotePair { opening: "\u{201c}".to_owned().into(), @@ -41,9 +41,9 @@ lazy_static! { closing: "\u{2019}".to_owned().into(), }, ] - .into_iter() - ); -} + .into_iter(), + ) +}); // Decimal styles per CSS-COUNTER-STYLES § 6.1: static DECIMAL: [char; 10] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']; |