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

@ -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();