Fix unused import warnings

This commit is contained in:
Matt Brubeck 2016-05-25 07:16:02 -07:00
parent 550e304a21
commit ea21fdbd48
4 changed files with 9 additions and 7 deletions

View file

@ -51,7 +51,6 @@ use net_traits::bluetooth_thread::BluetoothMethodMsg;
use net_traits::image_cache_thread::ImageCacheThread; use net_traits::image_cache_thread::ImageCacheThread;
use net_traits::response::HttpsState; use net_traits::response::HttpsState;
use profile_traits::mem; use profile_traits::mem;
use std::any::Any;
use std::collections::HashMap; use std::collections::HashMap;
use std::sync::mpsc::{Sender, Receiver}; use std::sync::mpsc::{Sender, Receiver};
use url::Url; use url::Url;

View file

@ -30,6 +30,8 @@ serde = "0.7"
serde_macros = "0.7" serde_macros = "0.7"
smallvec = "0.1" smallvec = "0.1"
url = {version = "1.0.0", features = ["heap_size", "serde"]} 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" xdg = "2.0"
[target.'cfg(windows)'.dependencies] [target.'cfg(windows)'.dependencies]

View file

@ -6,27 +6,27 @@
//! For linux based platforms, it uses the XDG base directory spec but provides //! For linux based platforms, it uses the XDG base directory spec but provides
//! similar abstractions for non-linux platforms. //! similar abstractions for non-linux platforms.
extern crate xdg; #[cfg(any(target_os = "macos", target_os = "windows"))]
use std::env; use std::env;
use std::fs;
use std::path::PathBuf; 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> { pub fn default_config_dir() -> Option<PathBuf> {
let xdg_dirs = xdg::BaseDirectories::with_profile("servo", "default").unwrap(); let xdg_dirs = xdg::BaseDirectories::with_profile("servo", "default").unwrap();
let config_dir = xdg_dirs.get_config_home(); let config_dir = xdg_dirs.get_config_home();
Some(config_dir) 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> { pub fn default_data_dir() -> Option<PathBuf> {
let xdg_dirs = xdg::BaseDirectories::with_profile("servo", "default").unwrap(); let xdg_dirs = xdg::BaseDirectories::with_profile("servo", "default").unwrap();
let data_dir = xdg_dirs.get_data_home(); let data_dir = xdg_dirs.get_data_home();
Some(data_dir) 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> { pub fn default_cache_dir() -> Option<PathBuf> {
let xdg_dirs = xdg::BaseDirectories::with_profile("servo", "default").unwrap(); let xdg_dirs = xdg::BaseDirectories::with_profile("servo", "default").unwrap();
let cache_dir = xdg_dirs.get_cache_home(); let cache_dir = xdg_dirs.get_cache_home();

View file

@ -38,6 +38,7 @@ extern crate rustc_serialize;
extern crate serde; extern crate serde;
extern crate smallvec; extern crate smallvec;
extern crate url; extern crate url;
#[cfg(all(unix, not(target_os = "macos"), not(target_os = "ios")))]
extern crate xdg; extern crate xdg;
use std::sync::Arc; use std::sync::Arc;