font-catalog: name the per-file slot type (clippy type_complexity)

This commit is contained in:
aiongg
2026-11-23 03:06:37 +00:00
parent 67409c465f
commit de01d25a52
+4 -1
View File
@@ -321,9 +321,12 @@ pub struct Catalog {
loaded: Mutex<HashMap<String, FamilyLoad>>,
/// 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<HashMap<PathBuf, Arc<Mutex<Option<Weak<[u8]>>>>>>,
files: Mutex<HashMap<PathBuf, FileSlot>>,
}
/// One file's shared bytes while any face of it is loaded, behind the lock held while the file is read.
type FileSlot = Arc<Mutex<Option<Weak<[u8]>>>>;
fn lock<T>(m: &Mutex<T>) -> MutexGuard<'_, T> {
m.lock().unwrap_or_else(PoisonError::into_inner)
}