@@ -2,7 +2,7 @@ use std::ffi::OsStr;
22use std::fs;
33use std::path::Path;
44
5−use lazycell::LazyCell;
5+use once_cell::unsync::OnceCell;
66
77use syntect::highlighting::{Theme, ThemeSet};
88use syntect::parsing::{SyntaxReference, SyntaxSet};
@@ -27,7 +27,7 @@ mod serialized_syntax_set;
2727
2828#[derive(Debug)]
2929pub struct HighlightingAssets {
30− syntax_set_cell: LazyCell<SyntaxSet>,
30+ syntax_set_cell: OnceCell<SyntaxSet>,
3131 serialized_syntax_set: SerializedSyntaxSet,
3232
3333 theme_set: ThemeSet,
@@ -49,7 +49,7 @@ pub(crate) const COMPRESS_THEMES: bool = true;
4949impl HighlightingAssets {
5050 fn new(serialized_syntax_set: SerializedSyntaxSet, theme_set: ThemeSet) -> Self {
5151 HighlightingAssets {
52− syntax_set_cell: LazyCell::new(),
52+ syntax_set_cell: OnceCell::new(),
5353 serialized_syntax_set,
5454 theme_set,
5555 fallback_theme: None,
@@ -80,7 +80,7 @@ impl HighlightingAssets {
8080
8181 fn get_syntax_set(&self) -> Result<&SyntaxSet> {
8282 self.syntax_set_cell
83− .try_borrow_with(|| self.serialized_syntax_set.deserialize())
83+ .get_or_try_init(|| self.serialized_syntax_set.deserialize())
8484 }
8585
8686 /// Use [Self::get_syntaxes] instead