diff options
-rw-r--r-- | components/script_traits/lib.rs | 1 | ||||
-rw-r--r-- | components/servo/Cargo.lock | 1 | ||||
-rw-r--r-- | components/util/Cargo.toml | 2 | ||||
-rw-r--r-- | components/util/basedir.rs | 12 | ||||
-rw-r--r-- | components/util/lib.rs | 1 | ||||
-rw-r--r-- | tests/unit/script/Cargo.toml | 1 | ||||
-rw-r--r-- | tests/unit/script/lib.rs | 1 |
7 files changed, 9 insertions, 10 deletions
diff --git a/components/script_traits/lib.rs b/components/script_traits/lib.rs index ae860a92122..b68d24616bc 100644 --- a/components/script_traits/lib.rs +++ b/components/script_traits/lib.rs @@ -51,7 +51,6 @@ use net_traits::bluetooth_thread::BluetoothMethodMsg; use net_traits::image_cache_thread::ImageCacheThread; use net_traits::response::HttpsState; use profile_traits::mem; -use std::any::Any; use std::collections::HashMap; use std::sync::mpsc::{Sender, Receiver}; use url::Url; diff --git a/components/servo/Cargo.lock b/components/servo/Cargo.lock index 598cb1fc864..dd38ac82e8b 100644 --- a/components/servo/Cargo.lock +++ b/components/servo/Cargo.lock @@ -1911,7 +1911,6 @@ dependencies = [ "plugins 0.0.1", "script 0.0.1", "url 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "util 0.0.1", ] [[package]] diff --git a/components/util/Cargo.toml b/components/util/Cargo.toml index c8857fcfa2e..80ea5a45397 100644 --- a/components/util/Cargo.toml +++ b/components/util/Cargo.toml @@ -30,6 +30,8 @@ serde = "0.7" serde_macros = "0.7" smallvec = "0.1" url = {version = "1.0.0", features = ["heap_size", "serde"]} + +[target.'cfg(all(unix, not(target_os = "macos"), not(target_os = "ios")))'.dependencies] xdg = "2.0" [target.'cfg(windows)'.dependencies] diff --git a/components/util/basedir.rs b/components/util/basedir.rs index 3a91b5e1f66..733bcd69507 100644 --- a/components/util/basedir.rs +++ b/components/util/basedir.rs @@ -6,27 +6,27 @@ //! For linux based platforms, it uses the XDG base directory spec but provides //! similar abstractions for non-linux platforms. -extern crate xdg; - +#[cfg(any(target_os = "macos", target_os = "windows"))] use std::env; -use std::fs; use std::path::PathBuf; +#[cfg(all(unix, not(target_os = "macos"), not(target_os = "ios")))] +use xdg; -#[cfg(all(unix, not(target_os = "macos"), not(target_os = "ios"), not(target_os = "windows")))] +#[cfg(all(unix, not(target_os = "macos"), not(target_os = "ios")))] pub fn default_config_dir() -> Option<PathBuf> { let xdg_dirs = xdg::BaseDirectories::with_profile("servo", "default").unwrap(); let config_dir = xdg_dirs.get_config_home(); Some(config_dir) } -#[cfg(all(unix, not(target_os = "macos"), not(target_os = "ios"), not(target_os = "windows")))] +#[cfg(all(unix, not(target_os = "macos"), not(target_os = "ios")))] pub fn default_data_dir() -> Option<PathBuf> { let xdg_dirs = xdg::BaseDirectories::with_profile("servo", "default").unwrap(); let data_dir = xdg_dirs.get_data_home(); Some(data_dir) } -#[cfg(all(unix, not(target_os = "macos"), not(target_os = "ios"), not(target_os = "windows")))] +#[cfg(all(unix, not(target_os = "macos"), not(target_os = "ios")))] pub fn default_cache_dir() -> Option<PathBuf> { let xdg_dirs = xdg::BaseDirectories::with_profile("servo", "default").unwrap(); let cache_dir = xdg_dirs.get_cache_home(); diff --git a/components/util/lib.rs b/components/util/lib.rs index 680e5609da0..9407b18a87b 100644 --- a/components/util/lib.rs +++ b/components/util/lib.rs @@ -38,6 +38,7 @@ extern crate rustc_serialize; extern crate serde; extern crate smallvec; extern crate url; +#[cfg(all(unix, not(target_os = "macos"), not(target_os = "ios")))] extern crate xdg; use std::sync::Arc; diff --git a/tests/unit/script/Cargo.toml b/tests/unit/script/Cargo.toml index 171ffb6920e..a851b3666f1 100644 --- a/tests/unit/script/Cargo.toml +++ b/tests/unit/script/Cargo.toml @@ -12,5 +12,4 @@ doctest = false msg = {path = "../../../components/msg"} plugins = {path = "../../../components/plugins"} script = {path = "../../../components/script"} -util = {path = "../../../components/util"} url = {version = "1.0.0", features = ["heap_size"]} diff --git a/tests/unit/script/lib.rs b/tests/unit/script/lib.rs index 2dbbd16ea7a..cab595e0500 100644 --- a/tests/unit/script/lib.rs +++ b/tests/unit/script/lib.rs @@ -8,7 +8,6 @@ extern crate msg; extern crate script; extern crate url; -extern crate util; #[cfg(test)] mod origin; #[cfg(all(test, target_pointer_width = "64"))] mod size_of; |