55 * Contributors : Mikachu2333 <[email protected] > 66 * |
77 * Created On : <2023-08-30>
8- * Last Modified : <2025-07-11 >
8+ * Last Modified : <2025-07-22 >
99 * ------------------------------------------------------------*/
1010
1111static SourceProvider_t pl_rust_cargo_upstream =
@@ -21,44 +21,33 @@ static SourceProvider_t pl_rust_cargo_upstream =
2121 *
2222 * @note 以下都支持稀疏索引,我们换源时都将默认添加 `sparse+`
2323 * @note 链接末尾的 `/` 不能缺少
24- *
25- * @note 2025-06-17: 经验证,南京大学、华中科大的镜像同步失败,实际情况下多数包都不可用
2624 */
2725static Source_t pl_rust_cargo_sources [] =
2826{
29- {& pl_rust_cargo_upstream , "https://github.com/rust-lang/crates.io-index/" ,
30- NULL },
27+ {& pl_rust_cargo_upstream , "https://github.com/rust-lang/crates.io-index/" , DelegateToUpstream },
28+
29+ {& MirrorZ , "https://mirrors.cernet.edu.cn/crates.io-index/" , DelegateToMirror },
30+ {& RsProxyCN , "https://rsproxy.cn/index/" , DelegateToMirror },
3131
32- {& MirrorZ , "https://mirrors.cernet.edu.cn/crates.io-index/" ,
33- NULL },
34- {& RsProxyCN , "https://rsproxy.cn/index/" ,
35- NULL },
3632 {& Ali , "https://mirrors.aliyun.com/crates.io-index/" ,
3733 "https://mirrors.aliyun.com/crates/api/v1/crates/windows/0.58.0/download" },
3834
39- {& Zju , "https://mirrors.zju.edu.cn/crates.io-index/" ,
40- NULL },
41-
42- // {&Nju, "https://mirror.nju.edu.cn/git/crates.io-index.git/",
43- // NULL},
35+ {& Zju , "https://mirrors.zju.edu.cn/crates.io-index/" , DelegateToMirror },
4436
45- { & Sjtug_Zhiyuan , "https://mirrors.sjtug.sjtu.edu.cn/crates.io-index/" ,
46- NULL },
37+ /* 注释原因: (2025-06-17) 镜像同步失败,多数包都不可用 */
38+ // {&Nju, "https://mirror.nju.edu.cn/git/crates.io-index.git/", DelegateToMirror },
4739
48- {& Tuna , "https://mirrors.tuna.tsinghua.edu.cn/crates.io-index/" ,
49- NULL },
50-
51- {& Bfsu , "https://mirrors.bfsu.edu.cn/crates.io-index/" ,
52- NULL },
40+ {& Sjtug_Zhiyuan , "https://mirrors.sjtug.sjtu.edu.cn/crates.io-index/" , DelegateToMirror },
41+ {& Tuna , "https://mirrors.tuna.tsinghua.edu.cn/crates.io-index/" , DelegateToMirror },
42+ {& Bfsu , "https://mirrors.bfsu.edu.cn/crates.io-index/" , DelegateToMirror },
5343
5444 {& Ustc , "https://mirrors.ustc.edu.cn/crates.io-index/" ,
5545 "https://crates-io.proxy.ustclug.org/api/v1/crates/windows/0.58.0/download" },
5646
57- // {&Hust, "https://mirrors.hust.edu.cn/crates.io-index/",
58- // NULL },
47+ /* 注释原因: (2025-06-17) 镜像同步失败,多数包都不可用 */
48+ // {&Hust, "https://mirrors.hust.edu.cn/crates.io-index/", DelegateToMirror },
5949
60- {& Cqu , "https://mirrors.cqu.edu.cn/crates.io-index/" ,
61- NULL }
50+ {& Cqu , "https://mirrors.cqu.edu.cn/crates.io-index/" , DelegateToMirror }
6251};
6352def_sources_n (pl_rust_cargo );
6453
@@ -84,19 +73,12 @@ pl_rust_cargo_setsrc (char *option)
8473{
8574 chsrc_yield_source_and_confirm (pl_rust_cargo );
8675
87- const char * file =
88- R "toml(
89- [source .crates - io ]
90- replace - with = 'mirror'
91-
92- [source .mirror ]
93- registry = "sparse+@url@"
94- )toml ";
76+ char * content = RAWSTR_pl_rust_cargo_config ;
9577
96- file = xy_str_gsub (file , "@url@" , source .url );
78+ content = xy_str_gsub (content , "@url@" , source .url );
9779
9880 chsrc_note2 (xy_strjoin (3 , "请手动写入以下内容到 " , xy_normalize_path ("~/.cargo/config.toml" ), " 文件中:" ));
99- println ( file );
81+ print ( content );
10082
10183 chsrc_determine_chgtype (ChgType_Auto );
10284 chsrc_conclude (& source );
0 commit comments