diff --git a/help/_posts/1970-01-01-crates.io-index.git.md b/help/_posts/1970-01-01-crates.io-index.git.md index a745e2b..5e3429a 100644 --- a/help/_posts/1970-01-01-crates.io-index.git.md +++ b/help/_posts/1970-01-01-crates.io-index.git.md @@ -11,7 +11,7 @@ mirrorid: crates.io-index.git
- @@ -22,7 +22,7 @@ mirrorid: crates.io-index.git
- @@ -31,7 +31,7 @@ mirrorid: crates.io-index.git -编辑 `~/.cargo/config` 文件,添加以下内容: +编辑 `$CARGO_HOME/config` 文件,添加以下内容: @@ -53,5 +53,33 @@ registry = "{{http_protocol}}{{mirror}}" +注:`$CARGO_HOME`:在 Windows 系统默认为:`%USERPROFILE%\.cargo`,在类 Unix 系统默认为:`$HOME/.cargo` + +在 Linux 环境可以使用下面的命令完成: + + + +{% raw %} + +{% endraw %} + +

+ +
+
+
+
+ + 在可能的情况下推荐使用 [Rust crates.io 稀疏索引镜像](/help/crates.io-index) diff --git a/help/_posts/1970-01-01-gitlab-ce.md b/help/_posts/1970-01-01-gitlab-ce.md index a184f5d..e0be6f3 100644 --- a/help/_posts/1970-01-01-gitlab-ce.md +++ b/help/_posts/1970-01-01-gitlab-ce.md @@ -61,8 +61,7 @@ curl https://packages.gitlab.com/gpg.key 2> /dev/null | {{sudo}}apt-key add - &>
+ @@ -22,7 +22,7 @@ mirrorid: crates.io-index
- @@ -31,7 +31,7 @@ mirrorid: crates.io-index -编辑 `~/.cargo/config` 文件,添加以下内容: +编辑 `$CARGO_HOME/config` 文件,添加以下内容: @@ -55,6 +55,34 @@ registry = "sparse+{{http_protocol}}{{mirror}}/" 注:`sparse+` 表示在使用稀疏索引,链接末尾的 `/` 不能缺少。 +注:`$CARGO_HOME`:在 Windows 系统默认为:`%USERPROFILE%\.cargo`,在类 Unix 系统默认为:`$HOME/.cargo` + +在 Linux 环境可以使用下面的命令完成: + + + +{% raw %} + +{% endraw %} + +

+ +
+
+
+
+ + 截至目前,可以通过 `cargo +nightly -Z sparse-registry update` 使用稀疏索引。 cargo 1.68 版本开始支持稀疏索引:不再需要完整克隆 crates.io-index 仓库,可以加快获取包的速度。如果您的 cargo 版本大于等于 1.68,可以直接使用而不需要开启 nightly。