Fix warning

This commit is contained in:
sharkdp 2020-05-19 14:01:00 +02:00
parent 4cafb28951
commit 3283a7b345

View file

@ -1,5 +1,4 @@
use std::borrow::Cow; use std::borrow::Cow;
use std::env;
use std::ffi::OsStr; use std::ffi::OsStr;
use std::fs::{FileType, Metadata}; use std::fs::{FileType, Metadata};
use std::io; use std::io;
@ -85,7 +84,7 @@ pub fn scan(path_vec: &[PathBuf], pattern: Arc<Regex>, config: Arc<Options>) ->
if config.read_global_ignore { if config.read_global_ignore {
#[cfg(target_os = "macos")] #[cfg(target_os = "macos")]
let config_dir_op = env::var_os("XDG_CONFIG_HOME") let config_dir_op = std::env::var_os("XDG_CONFIG_HOME")
.map(PathBuf::from) .map(PathBuf::from)
.filter(|p| p.is_absolute()) .filter(|p| p.is_absolute())
.or_else(|| dirs::home_dir().map(|d| d.join(".config"))); .or_else(|| dirs::home_dir().map(|d| d.join(".config")));