Skip to content

Commit 9af1dc8

Browse files
committed
Update Rust
1 parent 413d307 commit 9af1dc8

File tree

1 file changed

+43
-5
lines changed

1 file changed

+43
-5
lines changed

src/recipe/lang/Rust.c

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,21 @@
44
* File Authors : Aoran Zeng <[email protected]>
55
* Contributors : Nil Null <[email protected]>
66
* Created On : <2023-08-30>
7-
* Last Modified : <2024-09-04>
7+
* Last Modified : <2024-10-02>
88
* ------------------------------------------------------------*/
99

1010
static MirrorSite
1111
RsProxyCN = {"rsproxycn", "RsProxy.cn", "字节跳动基础架构Dev Infra", "https://rsproxy.cn/", NULL};
1212

1313
/**
14-
* @time 2024-09-04 更新
14+
* @update 2024-10-02
1515
* @note 以下都支持稀疏索引,我们换源时都将默认添加 `sparse+`
16+
* @note 链接末尾的 `/` 不能缺少
1617
*/
1718
static SourceInfo
1819
pl_rust_sources[] = {
19-
{&Upstream, NULL},
20+
{&Upstream, "https://index.crates.io/"}, // @help 是这个吗?
21+
{&MirrorZ, "https://mirrors.cernet.edu.cn/crates.io-index/"},
2022
{&Sjtug_Zhiyuan, "https://mirrors.sjtug.sjtu.edu.cn/crates.io-index/"},
2123
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/crates.io-index/"},
2224
{&Bfsu, "https://mirrors.bfsu.edu.cn/crates.io-index/"},
@@ -27,14 +29,21 @@ pl_rust_sources[] = {
2729
def_sources_n(pl_rust);
2830

2931

32+
/**
33+
* chsrc get rust
34+
*/
3035
void
3136
pl_rust_getsrc (char *option)
3237
{
3338
chsrc_view_file ("~/.cargo/config.toml");
3439
}
3540

41+
3642
/**
37-
* Rust 换源,参考:https://mirrors.tuna.tsinghua.edu.cn/help/crates.io-index/
43+
* @consult https://mirrors.tuna.tsinghua.edu.cn/help/crates.io-index/
44+
* @consult https://help.mirrors.cernet.edu.cn/crates.io-index
45+
*
46+
* chsrc set rust
3847
*/
3948
void
4049
pl_rust_setsrc (char *option)
@@ -53,4 +62,33 @@ pl_rust_setsrc (char *option)
5362
chsrc_conclude (&source, SetsrcType_Manual);
5463
}
5564

56-
def_target(pl_rust);
65+
66+
/**
67+
* chsrc reset rust
68+
*/
69+
void
70+
pl_rust_resetsrc (char *option)
71+
{
72+
pl_rust_setsrc (SetsrcType_Reset);
73+
}
74+
75+
76+
FeatInfo
77+
pl_rust_feat (char *option)
78+
{
79+
FeatInfo fi = {0};
80+
81+
fi.can_get = true;
82+
fi.can_reset = true;
83+
84+
fi.stcan_locally = CanSemi;
85+
fi.locally = "可以基于本项目换源吗?请帮助确认";
86+
fi.can_english = false;
87+
fi.can_user_define = true;
88+
89+
fi.note = NULL;
90+
return fi;
91+
}
92+
93+
94+
def_target_gsrf(pl_rust);

0 commit comments

Comments
 (0)