Bug 1393656 - Part 2: stylo: Add hash module for reexporting HashMap; r?emilio
MozReview-Commit-ID: 8gq04LlzDZI
new file mode 100644
--- /dev/null
+++ b/servo/components/style/hash.rs
@@ -0,0 +1,18 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+use fnv;
+
+#[cfg(feature = "gecko")]
+pub use hashglobe::hash_map::HashMap;
+#[cfg(feature = "gecko")]
+pub use hashglobe::hash_set::HashSet;
+
+
+#[cfg(feature = "servo")]
+pub use hashglobe::fake::{HashMap, HashSet};
+
+
+pub type FnvHashMap<K, V> = HashMap<K, V, fnv::FnvBuildHasher>;
+pub type FnvHashSet<T> = HashSet<T, fnv::FnvBuildHasher>;
--- a/servo/components/style/lib.rs
+++ b/servo/components/style/lib.rs
@@ -44,16 +44,17 @@ extern crate bit_vec;
#[macro_use]
extern crate bitflags;
#[allow(unused_extern_crates)] extern crate byteorder;
#[cfg(feature = "gecko")] #[macro_use] #[no_link] extern crate cfg_if;
#[macro_use] extern crate cssparser;
extern crate euclid;
extern crate fnv;
#[cfg(feature = "gecko")] #[macro_use] pub mod gecko_string_cache;
+extern crate hashglobe;
#[cfg(feature = "servo")] extern crate heapsize;
#[cfg(feature = "servo")] #[macro_use] extern crate heapsize_derive;
extern crate itertools;
extern crate itoa;
#[cfg(feature = "servo")] #[macro_use] extern crate html5ever;
#[macro_use]
extern crate lazy_static;
#[macro_use]
@@ -108,16 +109,17 @@ pub mod dom;
pub mod driver;
pub mod element_state;
#[cfg(feature = "servo")] mod encoding_support;
pub mod error_reporting;
pub mod font_face;
pub mod font_metrics;
#[cfg(feature = "gecko")] #[allow(unsafe_code)] pub mod gecko;
#[cfg(feature = "gecko")] #[allow(unsafe_code)] pub mod gecko_bindings;
+pub mod hash;
pub mod invalidation;
#[allow(missing_docs)] // TODO.
pub mod logical_geometry;
pub mod matching;
pub mod media_queries;
pub mod parallel;
pub mod parser;
pub mod rule_tree;