From 635a4cdcdcf726aab4b6f7dcb620ffdb33c5e367 Mon Sep 17 00:00:00 2001 From: Mara Bos Date: Mon, 14 Jan 2019 11:20:46 +0100 Subject: Also look in home directory for global config. --- src/config/config_type.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/config/config_type.rs b/src/config/config_type.rs index 665afded9da..9e58eac52a2 100644 --- a/src/config/config_type.rs +++ b/src/config/config_type.rs @@ -349,7 +349,14 @@ macro_rules! create_config { } } - // If none was found, check in the global configuration directory. + // If nothing was found, check in the home directory. + if let Some(home_dir) = dirs::home_dir() { + if let Some(path) = get_toml_path(&home_dir)? { + return Ok(Some(path)); + } + } + + // If none was found ther either, check in the user's configuration directory. if let Some(mut config_dir) = dirs::config_dir() { config_dir.push("rustfmt"); if let Some(path) = get_toml_path(&config_dir)? { -- cgit 1.4.1-3-g733a5