servo: Merge #11382 - Fix unused crate warning in script_tests (from mbrubeck:warnings); r=nox
authorMatt Brubeck <mbrubeck@limpet.net>
Thu, 26 May 2016 01:43:21 -0500
changeset 338922 5872d371e9d4b76a2cff055695d75639245554f6
parent 338921 a40362d4df54c8c62e04acafc4d1bbf9ef0244c7
child 338923 5dd20a97a1ccdc7b3c6484d867b607abb51906cf
push id31307
push usergszorc@mozilla.com
push dateSat, 04 Feb 2017 00:59:06 +0000
treeherdermozilla-central@94079d43835f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnox
servo: Merge #11382 - Fix unused crate warning in script_tests (from mbrubeck:warnings); r=nox Source-Repo: https://github.com/servo/servo Source-Revision: 97e58e6cfe6624746a717e224a4be3e087a644a5
servo/components/script_traits/lib.rs
servo/components/servo/Cargo.lock
servo/components/util/Cargo.toml
servo/components/util/basedir.rs
servo/components/util/lib.rs
servo/tests/unit/script/Cargo.toml
servo/tests/unit/script/lib.rs
--- a/servo/components/script_traits/lib.rs
+++ b/servo/components/script_traits/lib.rs
@@ -46,17 +46,16 @@ use msg::constellation_msg::{NavigationD
 use msg::constellation_msg::{PipelineNamespaceId, SubpageId, WindowSizeData};
 use msg::constellation_msg::{WebDriverCommandMsg, WindowSizeType};
 use msg::webdriver_msg::WebDriverScriptCommand;
 use net_traits::ResourceThreads;
 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;
 use util::ipc::OptionalOpaqueIpcSender;
 
 pub use script_msg::{LayoutMsg, ScriptMsg, EventResult};
 
 /// The address of a node. Layout sends these back. They must be validated via
--- a/servo/components/servo/Cargo.lock
+++ b/servo/components/servo/Cargo.lock
@@ -1906,17 +1906,16 @@ dependencies = [
 [[package]]
 name = "script_tests"
 version = "0.0.1"
 dependencies = [
  "msg 0.0.1",
  "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]]
 name = "script_traits"
 version = "0.0.1"
 dependencies = [
  "app_units 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "canvas_traits 0.0.1",
--- a/servo/components/util/Cargo.toml
+++ b/servo/components/util/Cargo.toml
@@ -25,12 +25,14 @@ num_cpus = "0.2.2"
 num-traits = "0.1.32"
 plugins = {path = "../plugins"}
 rand = "0.3"
 rustc-serialize = "0.3"
 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]
 kernel32-sys = "0.2"
--- a/servo/components/util/basedir.rs
+++ b/servo/components/util/basedir.rs
@@ -1,37 +1,37 @@
 /* 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/. */
 
 //! Contains routines for retrieving default config directories.
 //! 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();
     Some(cache_dir)
 }
 
 #[cfg(target_os = "macos")]
 pub fn default_config_dir() -> Option<PathBuf> {
--- a/servo/components/util/lib.rs
+++ b/servo/components/util/lib.rs
@@ -33,16 +33,17 @@ extern crate libc;
 extern crate log;
 extern crate num_cpus;
 extern crate num_traits;
 extern crate rand;
 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;
 
 pub mod basedir;
 pub mod cache;
 #[allow(unsafe_code)]
 pub mod debug_utils;
--- a/servo/tests/unit/script/Cargo.toml
+++ b/servo/tests/unit/script/Cargo.toml
@@ -7,10 +7,9 @@ authors = ["The Servo Project Developers
 name = "script_tests"
 path = "lib.rs"
 doctest = false
 
 [dependencies]
 msg = {path = "../../../components/msg"}
 plugins = {path = "../../../components/plugins"}
 script = {path = "../../../components/script"}
-util = {path = "../../../components/util"}
 url = {version = "1.0.0", features = ["heap_size"]}
--- a/servo/tests/unit/script/lib.rs
+++ b/servo/tests/unit/script/lib.rs
@@ -3,17 +3,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #![feature(plugin)]
 #![plugin(plugins)]
 
 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;
 #[cfg(test)] mod textinput;
 #[cfg(test)] mod dom {
     mod bindings;
     mod blob;
     mod xmlhttprequest;