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) --- tests/src/world.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'tests/src/world.rs') diff --git a/tests/src/world.rs b/tests/src/world.rs index 86ee8da6..ad925a53 100644 --- a/tests/src/world.rs +++ b/tests/src/world.rs @@ -5,7 +5,6 @@ use std::io::Write; use std::path::{Path, PathBuf}; use std::sync::OnceLock; -use comemo::Prehashed; use once_cell::sync::Lazy; use parking_lot::Mutex; use typst::diag::{bail, FileError, FileResult, StrResult}; @@ -13,6 +12,7 @@ use typst::foundations::{func, Bytes, Datetime, NoneValue, Repr, Smart, Value}; use typst::layout::{Abs, Margin, PageElem}; use typst::syntax::{FileId, Source}; use typst::text::{Font, FontBook, TextElem, TextSize}; +use typst::utils::LazyHash; use typst::visualize::Color; use typst::{Library, World}; @@ -35,11 +35,11 @@ impl TestWorld { } impl World for TestWorld { - fn library(&self) -> &Prehashed { + fn library(&self) -> &LazyHash { &self.base.library } - fn book(&self) -> &Prehashed { + fn book(&self) -> &LazyHash { &self.base.book } @@ -81,8 +81,8 @@ impl TestWorld { /// Shared foundation of all test worlds. struct TestBase { - library: Prehashed, - book: Prehashed, + library: LazyHash, + book: LazyHash, fonts: Vec, slots: Mutex>, } @@ -95,8 +95,8 @@ impl Default for TestBase { .collect(); Self { - library: Prehashed::new(library()), - book: Prehashed::new(FontBook::from_fonts(&fonts)), + library: LazyHash::new(library()), + book: LazyHash::new(FontBook::from_fonts(&fonts)), fonts, slots: Mutex::new(HashMap::new()), } -- cgit v1.2.3