Skip to content

Commit

Permalink
Fix compilation without std feature
Browse files Browse the repository at this point in the history
  • Loading branch information
jackpot51 committed Jun 5, 2024
1 parent 39c4e3e commit 89503b2
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions src/font/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,18 +216,21 @@ impl FontSystem {
pub fn cache_fonts(&mut self, mut ids: Vec<fontdb::ID>) {
#[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();
Expand Down

0 comments on commit 89503b2

Please sign in to comment.