From 2d32ac73b63c81ea2754916feb7758c042f4ed3d Mon Sep 17 00:00:00 2001 From: Laurenz Date: Mon, 13 May 2024 19:54:34 +0200 Subject: Replace all `Prehashed` with `LazyHash` (#4127) --- crates/typst-cli/src/world.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'crates/typst-cli/src') diff --git a/crates/typst-cli/src/world.rs b/crates/typst-cli/src/world.rs index 57aecd42..81fece2a 100644 --- a/crates/typst-cli/src/world.rs +++ b/crates/typst-cli/src/world.rs @@ -5,7 +5,6 @@ use std::sync::OnceLock; use std::{fmt, fs, io, mem}; use chrono::{DateTime, Datelike, FixedOffset, Local, Utc}; -use comemo::Prehashed; use ecow::{eco_format, EcoString}; use once_cell::sync::Lazy; use parking_lot::Mutex; @@ -13,6 +12,7 @@ use typst::diag::{FileError, FileResult}; use typst::foundations::{Bytes, Datetime, Dict, IntoValue}; use typst::syntax::{FileId, Source, VirtualPath}; use typst::text::{Font, FontBook}; +use typst::utils::LazyHash; use typst::{Library, World}; use typst_timing::{timed, TimingScope}; @@ -34,9 +34,9 @@ pub struct SystemWorld { /// The input path. main: FileId, /// Typst's standard library. - library: Prehashed, + library: LazyHash, /// Metadata about discovered fonts. - book: Prehashed, + book: LazyHash, /// Locations of and storage for lazily loaded fonts. fonts: Vec, /// Maps file ids to source files and buffers. @@ -114,8 +114,8 @@ impl SystemWorld { workdir: std::env::current_dir().ok(), root, main, - library: Prehashed::new(library), - book: Prehashed::new(searcher.book), + library: LazyHash::new(library), + book: LazyHash::new(searcher.book), fonts: searcher.fonts, slots: Mutex::new(HashMap::new()), now, @@ -170,11 +170,11 @@ impl SystemWorld { } impl World for SystemWorld { - fn library(&self) -> &Prehashed { + fn library(&self) -> &LazyHash { &self.library } - fn book(&self) -> &Prehashed { + fn book(&self) -> &LazyHash { &self.book } -- cgit v1.2.3