diff --git a/components/servo/Cargo.lock b/components/servo/Cargo.lock index 5f6e0da6de8..5f2d29cee62 100644 --- a/components/servo/Cargo.lock +++ b/components/servo/Cargo.lock @@ -2466,7 +2466,6 @@ dependencies = [ "lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)", "serde_macros 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/components/util/cache.rs b/components/style/cache.rs similarity index 98% rename from components/util/cache.rs rename to components/style/cache.rs index 63a2d403d4a..e15c99eea2c 100644 --- a/components/util/cache.rs +++ b/components/style/cache.rs @@ -2,6 +2,8 @@ * 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/. */ +//! Two simple cache data structures. + use rand; use rand::Rng; use std::hash::{Hash, Hasher, SipHasher}; diff --git a/components/style/lib.rs b/components/style/lib.rs index 6e45d9a9411..7fe5fe1bcca 100644 --- a/components/style/lib.rs +++ b/components/style/lib.rs @@ -72,6 +72,7 @@ extern crate util; pub mod animation; pub mod attr; pub mod bezier; +pub mod cache; pub mod context; pub mod custom_properties; pub mod data; diff --git a/components/style/matching.rs b/components/style/matching.rs index 5d4fa82b8ce..8b843844fbc 100644 --- a/components/style/matching.rs +++ b/components/style/matching.rs @@ -7,6 +7,7 @@ #![allow(unsafe_code)] use animation::{self, Animation}; +use cache::{LRUCache, SimpleHashCache}; use context::{StyleContext, SharedStyleContext}; use data::PrivateStyleData; use dom::{TElement, TNode, TRestyleDamage}; @@ -25,7 +26,6 @@ use std::slice::Iter; use std::sync::Arc; use string_cache::{Atom, Namespace}; use util::arc_ptr_eq; -use util::cache::{LRUCache, SimpleHashCache}; use util::opts; fn create_common_style_affecting_attributes_from_element(element: &E) diff --git a/components/util/Cargo.toml b/components/util/Cargo.toml index f5c87179cfc..3a9478a49b3 100644 --- a/components/util/Cargo.toml +++ b/components/util/Cargo.toml @@ -24,7 +24,6 @@ ipc-channel = {git = "https://github.com/servo/ipc-channel", optional = true} lazy_static = "0.2" log = "0.3.5" num_cpus = "0.2.2" -rand = "0.3" rustc-serialize = "0.3" serde = {version = "0.7.11", optional = true} serde_macros = {version = "0.7.11", optional = true} diff --git a/components/util/lib.rs b/components/util/lib.rs index 6ffa4a4a2b5..bcad9ea3705 100644 --- a/components/util/lib.rs +++ b/components/util/lib.rs @@ -20,7 +20,6 @@ extern crate getopts; #[allow(unused_extern_crates)] #[macro_use] extern crate lazy_static; #[macro_use] extern crate log; extern crate num_cpus; -extern crate rand; extern crate rustc_serialize; #[cfg(feature = "servo")] extern crate serde; extern crate url; @@ -30,7 +29,6 @@ extern crate xdg; use std::sync::Arc; pub mod basedir; -pub mod cache; pub mod geometry; #[cfg(feature = "servo")] #[allow(unsafe_code)] pub mod ipc; #[allow(unsafe_code)] pub mod opts; diff --git a/ports/cef/Cargo.lock b/ports/cef/Cargo.lock index 471c3a6eb6d..b8258ccb8df 100644 --- a/ports/cef/Cargo.lock +++ b/ports/cef/Cargo.lock @@ -2335,7 +2335,6 @@ dependencies = [ "lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)", "serde_macros 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/ports/geckolib/Cargo.lock b/ports/geckolib/Cargo.lock index 1bb5d71923d..bec14181271 100644 --- a/ports/geckolib/Cargo.lock +++ b/ports/geckolib/Cargo.lock @@ -573,7 +573,6 @@ dependencies = [ "lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)", "serde_macros 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/tests/unit/util/cache.rs b/tests/unit/style/cache.rs similarity index 98% rename from tests/unit/util/cache.rs rename to tests/unit/style/cache.rs index a938cf638ce..7456a87b55c 100644 --- a/tests/unit/util/cache.rs +++ b/tests/unit/style/cache.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use std::cell::Cell; -use util::cache::LRUCache; +use style::cache::LRUCache; #[test] fn test_lru_cache() { diff --git a/tests/unit/style/lib.rs b/tests/unit/style/lib.rs index fd725d79635..803dd7ce05e 100644 --- a/tests/unit/style/lib.rs +++ b/tests/unit/style/lib.rs @@ -18,6 +18,7 @@ extern crate url; extern crate util; mod attr; +mod cache; mod logical_geometry; mod media_queries; mod properties; diff --git a/tests/unit/util/lib.rs b/tests/unit/util/lib.rs index af5de45579d..1ad4e55d965 100644 --- a/tests/unit/util/lib.rs +++ b/tests/unit/util/lib.rs @@ -6,7 +6,6 @@ extern crate util; -mod cache; mod opts; mod prefs; mod thread;