Move hashbrown behind no_std feature

This commit is contained in:
grovesNL 2023-08-09 10:19:24 -02:30
parent 0476d7cdbb
commit 14d0ceb81b
2 changed files with 8 additions and 3 deletions

View file

@ -3,10 +3,14 @@ use alloc::string::String;
use alloc::sync::Arc;
use alloc::vec::Vec;
use core::fmt;
use core::hash::BuildHasherDefault;
use core::ops::{Deref, DerefMut};
type HashMap<K, V> = hashbrown::HashMap<K, V, BuildHasherDefault<rustc_hash::FxHasher>>;
type BuildHasher = core::hash::BuildHasherDefault<rustc_hash::FxHasher>;
#[cfg(feature = "no_std")]
type HashMap<K, V> = hashbrown::HashMap<K, V, BuildHasher>;
#[cfg(not(feature = "no_std"))]
type HashMap<K, V> = std::collections::HashMap<K, V, BuildHasher>;
// re-export fontdb and rustybuzz
pub use fontdb;