diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/Cargo.toml | 1 | ||||
| -rw-r--r-- | docs/src/lib.rs | 8 |
2 files changed, 4 insertions, 5 deletions
diff --git a/docs/Cargo.toml b/docs/Cargo.toml index a24ee254..41a5645e 100644 --- a/docs/Cargo.toml +++ b/docs/Cargo.toml @@ -22,7 +22,6 @@ typst-dev-assets = { workspace = true } clap = { workspace = true, optional = true } ecow = { workspace = true } heck = { workspace = true } -once_cell = { workspace = true } pulldown-cmark = { workspace = true } serde = { workspace = true } serde_json = { workspace = true, optional = true } diff --git a/docs/src/lib.rs b/docs/src/lib.rs index 59fc1cbf..bc9b53c9 100644 --- a/docs/src/lib.rs +++ b/docs/src/lib.rs @@ -12,9 +12,9 @@ pub use self::model::*; use std::collections::HashSet; use ecow::{eco_format, EcoString}; -use once_cell::sync::Lazy; use serde::Deserialize; use serde_yaml as yaml; +use std::sync::LazyLock; use typst::diag::{bail, StrResult}; use typst::foundations::{ AutoValue, Bytes, CastInfo, Category, Func, Module, NoneValue, ParamInfo, Repr, @@ -37,7 +37,7 @@ macro_rules! load { }; } -static GROUPS: Lazy<Vec<GroupData>> = Lazy::new(|| { +static GROUPS: LazyLock<Vec<GroupData>> = LazyLock::new(|| { let mut groups: Vec<GroupData> = yaml::from_str(load!("reference/groups.yml")).unwrap(); for group in &mut groups { @@ -54,7 +54,7 @@ static GROUPS: Lazy<Vec<GroupData>> = Lazy::new(|| { groups }); -static LIBRARY: Lazy<LazyHash<Library>> = Lazy::new(|| { +static LIBRARY: LazyLock<LazyHash<Library>> = LazyLock::new(|| { let mut lib = Library::default(); let scope = lib.global.scope_mut(); @@ -74,7 +74,7 @@ static LIBRARY: Lazy<LazyHash<Library>> = Lazy::new(|| { LazyHash::new(lib) }); -static FONTS: Lazy<(LazyHash<FontBook>, Vec<Font>)> = Lazy::new(|| { +static FONTS: LazyLock<(LazyHash<FontBook>, Vec<Font>)> = LazyLock::new(|| { let fonts: Vec<_> = typst_assets::fonts() .chain(typst_dev_assets::fonts()) .flat_map(|data| Font::iter(Bytes::from_static(data))) |
