Skip to content

Commit

Permalink
Fix unused import warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrubeck committed May 25, 2016
1 parent 550e304 commit ea21fdb
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
1 change: 0 additions & 1 deletion components/script_traits/lib.rs
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions components/util/Cargo.toml
Expand Up @@ -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]
Expand Down
12 changes: 6 additions & 6 deletions components/util/basedir.rs
Expand Up @@ -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();
Expand Down
1 change: 1 addition & 0 deletions components/util/lib.rs
Expand Up @@ -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;
Expand Down

0 comments on commit ea21fdb

Please sign in to comment.