mirror of
https://github.com/BurntSushi/ripgrep.git
synced 2025-04-19 09:02:15 +02:00
ignore: permit use of env::home_dir
Upstream deprecated env::home_dir because of minor bugs in some corner cases. We should probably eventually migrate to a correct implementation in the `dirs` crate, but using the buggy version is just fine for now.
This commit is contained in:
parent
fca9709d94
commit
b64475aeac
@ -538,6 +538,10 @@ fn gitconfig_contents() -> Option<Vec<u8>> {
|
|||||||
///
|
///
|
||||||
/// Specifically, this respects XDG_CONFIG_HOME.
|
/// Specifically, this respects XDG_CONFIG_HOME.
|
||||||
fn excludes_file_default() -> Option<PathBuf> {
|
fn excludes_file_default() -> Option<PathBuf> {
|
||||||
|
// We're fine with using env::home_dir for now. Its bugs are, IMO, pretty
|
||||||
|
// minor corner cases. We should still probably eventually migrate to
|
||||||
|
// the `dirs` crate to get a proper implementation.
|
||||||
|
#![allow(deprecated)]
|
||||||
env::var_os("XDG_CONFIG_HOME")
|
env::var_os("XDG_CONFIG_HOME")
|
||||||
.and_then(|x| if x.is_empty() { None } else { Some(PathBuf::from(x)) })
|
.and_then(|x| if x.is_empty() { None } else { Some(PathBuf::from(x)) })
|
||||||
.or_else(|| env::home_dir().map(|p| p.join(".config")))
|
.or_else(|| env::home_dir().map(|p| p.join(".config")))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user