From a1872a25012ab09b86bae2cffbc64458e3854c33 Mon Sep 17 00:00:00 2001 From: wtklbm Date: Wed, 22 Nov 2023 14:07:12 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=83=20docs:=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/utils.rs b/src/utils.rs index 3705ac8..fc98a91 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -34,7 +34,13 @@ pub fn cargo_home() -> PathBuf { pub fn cargo_config_path() -> PathBuf { let mut c = cargo_home(); + + // Cargo 还读取不带 `.toml` 扩展名的配置文件,例如 `~/.cargo/config` + // 如果该文件存在,Cargo 将首先使用不带扩展名的文件 + // https://doc.rust-lang.org/cargo/reference/config.html c.push(CONFIG); + + // Rust v1.39 版本中添加了对该 `.toml` 扩展的支持,并且是首选形式 if !c.exists() { c.set_file_name(CONFIG_TOML); }