Fix compilation without std feature

This commit is contained in:
Jeremy Soller 2024-06-05 08:19:34 -06:00
parent 39c4e3e02b
commit 89503b254f
No known key found for this signature in database
GPG key ID: D02FD439211AF56F

View file

@ -216,6 +216,8 @@ impl FontSystem {
pub fn cache_fonts(&mut self, mut ids: Vec<fontdb::ID>) { pub fn cache_fonts(&mut self, mut ids: Vec<fontdb::ID>) {
#[cfg(feature = "std")] #[cfg(feature = "std")]
use rayon::iter::{IntoParallelRefIterator, ParallelIterator}; use rayon::iter::{IntoParallelRefIterator, ParallelIterator};
#[cfg(feature = "std")]
{
ids = ids ids = ids
.into_iter() .into_iter()
.filter(|id| { .filter(|id| {
@ -228,6 +230,7 @@ impl FontSystem {
!contains !contains
}) })
.collect::<_>(); .collect::<_>();
}
#[cfg(feature = "std")] #[cfg(feature = "std")]
let fonts = ids.par_iter(); let fonts = ids.par_iter();