From 89503b254fb6a2014d3712568054b32925ea9008 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Wed, 5 Jun 2024 08:19:34 -0600 Subject: [PATCH] Fix compilation without std feature --- src/font/system.rs | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/font/system.rs b/src/font/system.rs index 52fecf0887..5e8b65b0d1 100644 --- a/src/font/system.rs +++ b/src/font/system.rs @@ -216,18 +216,21 @@ impl FontSystem { pub fn cache_fonts(&mut self, mut ids: Vec) { #[cfg(feature = "std")] use rayon::iter::{IntoParallelRefIterator, ParallelIterator}; - ids = ids - .into_iter() - .filter(|id| { - let contains = self.font_cache.contains_key(id); - if !contains { - unsafe { - self.db.make_shared_face_data(*id); + #[cfg(feature = "std")] + { + ids = ids + .into_iter() + .filter(|id| { + let contains = self.font_cache.contains_key(id); + if !contains { + unsafe { + self.db.make_shared_face_data(*id); + } } - } - !contains - }) - .collect::<_>(); + !contains + }) + .collect::<_>(); + } #[cfg(feature = "std")] let fonts = ids.par_iter();