diff --git a/crates/font-catalog/src/catalog.rs b/crates/font-catalog/src/catalog.rs index 1dd9f0f3f..a1325a56e 100644 --- a/crates/font-catalog/src/catalog.rs +++ b/crates/font-catalog/src/catalog.rs @@ -321,9 +321,12 @@ pub struct Catalog { loaded: Mutex>, /// The bytes of each file read, while a face of it is loaded. A file's own lock is held while it is read, so faces of /// one collection loading on several threads read it once and share the bytes. - files: Mutex>>>>>, + files: Mutex>, } +/// One file's shared bytes while any face of it is loaded, behind the lock held while the file is read. +type FileSlot = Arc>>>; + fn lock(m: &Mutex) -> MutexGuard<'_, T> { m.lock().unwrap_or_else(PoisonError::into_inner) }