Source code

Revision control

Other Tools

1
/* This Source Code Form is subject to the terms of the Mozilla Public
2
* License, v. 2.0. If a copy of the MPL was not distributed with this
3
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
5
//! Reexports of hashglobe types in Gecko mode, and stdlib hashmap shims in Servo mode
6
//!
7
//! Can go away when the stdlib gets fallible collections
9
10
use fxhash;
11
12
#[cfg(feature = "gecko")]
13
pub use hashglobe::hash_map::HashMap;
14
#[cfg(feature = "gecko")]
15
pub use hashglobe::hash_set::HashSet;
16
17
#[cfg(feature = "servo")]
18
pub use hashglobe::fake::{HashMap, HashSet};
19
20
/// Appropriate reexports of hash_map types
21
pub mod map {
22
#[cfg(feature = "gecko")]
23
pub use hashglobe::hash_map::{Entry, Iter};
24
#[cfg(feature = "servo")]
25
pub use std::collections::hash_map::{Entry, Iter};
26
}
27
28
/// Hash map that uses the Fx hasher
29
pub type FxHashMap<K, V> = HashMap<K, V, fxhash::FxBuildHasher>;
30
/// Hash set that uses the Fx hasher
31
pub type FxHashSet<T> = HashSet<T, fxhash::FxBuildHasher>;