// A poly-fill for `lazy_cell`
// Replace with std::sync::LazyLock when https://github.com/rust-lang/rust/issues/109736 is stabilized.
// This isn't used on every platform, which can come up as dead code warnings.
#![allow(dead_code)]usestd::ops::Deref;usestd::sync::OnceLock;pub(crate)structLazy<T>{cell:OnceLock<T>,
init:fn()-> T,
}impl<T>Lazy<T>{pubconstfnnew(f:fn()-> T)->Self{Self{ cell:OnceLock::new(), init: f }}}impl<T> Deref forLazy<T>{typeTarget= T;#[inline]fnderef(&self)->&'_ T {self.cell.get_or_init(self.init)}}