aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout_thread_2020
diff options
context:
space:
mode:
Diffstat (limited to 'components/layout_thread_2020')
-rw-r--r--components/layout_thread_2020/Cargo.toml1
-rw-r--r--components/layout_thread_2020/lib.rs22
2 files changed, 9 insertions, 14 deletions
diff --git a/components/layout_thread_2020/Cargo.toml b/components/layout_thread_2020/Cargo.toml
index 8024c74e88d..3e6e80cce1c 100644
--- a/components/layout_thread_2020/Cargo.toml
+++ b/components/layout_thread_2020/Cargo.toml
@@ -21,7 +21,6 @@ fonts = { path = "../fonts" }
fonts_traits = { workspace = true }
ipc-channel = { workspace = true }
layout = { path = "../layout_2020", package = "layout_2020" }
-lazy_static = { workspace = true }
log = { workspace = true }
malloc_size_of = { workspace = true }
metrics = { path = "../metrics" }
diff --git a/components/layout_thread_2020/lib.rs b/components/layout_thread_2020/lib.rs
index 84ff7d2fbed..4038fa92952 100644
--- a/components/layout_thread_2020/lib.rs
+++ b/components/layout_thread_2020/lib.rs
@@ -13,7 +13,7 @@ use std::collections::HashMap;
use std::fmt::Debug;
use std::ops::{Deref, DerefMut};
use std::process;
-use std::sync::Arc;
+use std::sync::{Arc, LazyLock};
use app_units::Au;
use base::id::{BrowsingContextId, PipelineId};
@@ -35,7 +35,6 @@ use layout::query::{
};
use layout::traversal::RecalcStyle;
use layout::{layout_debug, BoxTree, FragmentTree};
-use lazy_static::lazy_static;
use log::{debug, error, warn};
use malloc_size_of::{MallocSizeOf, MallocSizeOfOps};
use metrics::{PaintTimeMetrics, ProfilerMetadataFactory};
@@ -1151,17 +1150,14 @@ fn get_ua_stylesheets() -> Result<UserAgentStylesheets, &'static str> {
})
}
-lazy_static! {
- static ref UA_STYLESHEETS: UserAgentStylesheets = {
- match get_ua_stylesheets() {
- Ok(stylesheets) => stylesheets,
- Err(filename) => {
- error!("Failed to load UA stylesheet {}!", filename);
- process::exit(1);
- },
- }
- };
-}
+static UA_STYLESHEETS: LazyLock<UserAgentStylesheets> =
+ LazyLock::new(|| match get_ua_stylesheets() {
+ Ok(stylesheets) => stylesheets,
+ Err(filename) => {
+ error!("Failed to load UA stylesheet {}!", filename);
+ process::exit(1);
+ },
+ });
struct RegisteredPainterImpl {
painter: Box<dyn Painter>,