Use LazyLock (#346)
This commit is contained in:
parent
5aa543a6c2
commit
f43d47d135
1 changed files with 2 additions and 2 deletions
|
@ -2,7 +2,7 @@ use comrak::{
|
||||||
nodes::{AstNode, NodeHeading, NodeValue},
|
nodes::{AstNode, NodeHeading, NodeValue},
|
||||||
Arena, ComrakOptions,
|
Arena, ComrakOptions,
|
||||||
};
|
};
|
||||||
use std::{fs, io, lazy::SyncLazy, path::Path};
|
use std::{fs, io, path::Path, sync::LazyLock};
|
||||||
|
|
||||||
pub struct Page<'a> {
|
pub struct Page<'a> {
|
||||||
pub title: Option<&'a AstNode<'a>>,
|
pub title: Option<&'a AstNode<'a>>,
|
||||||
|
@ -29,7 +29,7 @@ impl<'a> Page<'a> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub static COMRAK_OPTIONS: SyncLazy<ComrakOptions> = SyncLazy::new(|| {
|
pub static COMRAK_OPTIONS: LazyLock<ComrakOptions> = LazyLock::new(|| {
|
||||||
let mut options = ComrakOptions::default();
|
let mut options = ComrakOptions::default();
|
||||||
options.extension.header_ids = Some("".to_string());
|
options.extension.header_ids = Some("".to_string());
|
||||||
options.render.unsafe_ = true;
|
options.render.unsafe_ = true;
|
||||||
|
|
Loading…
Add table
Reference in a new issue