Skip to content

Commit 87aba96

Browse files
committed
Rename rust target to Cargo
1 parent 9fd619e commit 87aba96

File tree

4 files changed

+34
-19
lines changed

4 files changed

+34
-19
lines changed

src/chsrc-main.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@
4747
#include "recipe/lang/Lua.c"
4848
#include "recipe/lang/Go.c"
4949
#include "recipe/lang/Java.c"
50-
#include "recipe/lang/Rust.c"
50+
51+
#include "recipe/lang/Rust/common.h"
52+
#include "recipe/lang/Rust/rustup.c"
53+
#include "recipe/lang/Rust/Cargo.c"
5154

5255
#include "recipe/lang/Dart/Pub.c"
5356
#include "recipe/lang/Dart/Flutter.c"
Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,13 @@
77
* Last Modified : <2024-10-02>
88
* ------------------------------------------------------------*/
99

10-
static MirrorSite
11-
RsProxyCN = {"rsproxycn", "RsProxy.cn", "字节跳动基础架构Dev Infra", "https://rsproxy.cn/", NULL};
12-
1310
/**
1411
* @update 2024-10-02
1512
* @note 以下都支持稀疏索引,我们换源时都将默认添加 `sparse+`
1613
* @note 链接末尾的 `/` 不能缺少
1714
*/
1815
static SourceInfo
19-
pl_rust_sources[] = {
16+
pl_rust_cargo_sources[] = {
2017
{&Upstream, "https://index.crates.io/"}, // @help 是这个吗?
2118
{&MirrorZ, "https://mirrors.cernet.edu.cn/crates.io-index/"},
2219
{&Sjtug_Zhiyuan, "https://mirrors.sjtug.sjtu.edu.cn/crates.io-index/"},
@@ -26,14 +23,14 @@ pl_rust_sources[] = {
2623
{&RsProxyCN, "https://rsproxy.cn/index/"},
2724
{&Hust, "https://mirrors.hust.edu.cn/crates.io-index/"}
2825
};
29-
def_sources_n(pl_rust);
26+
def_sources_n(pl_rust_cargo);
3027

3128

3229
/**
33-
* chsrc get rust
30+
* chsrc get cargo
3431
*/
3532
void
36-
pl_rust_getsrc (char *option)
33+
pl_rust_cargo_getsrc (char *option)
3734
{
3835
chsrc_view_file ("~/.cargo/config.toml");
3936
}
@@ -43,12 +40,12 @@ pl_rust_getsrc (char *option)
4340
* @consult https://mirrors.tuna.tsinghua.edu.cn/help/crates.io-index/
4441
* @consult https://help.mirrors.cernet.edu.cn/crates.io-index
4542
*
46-
* chsrc set rust
43+
* chsrc set cargo
4744
*/
4845
void
49-
pl_rust_setsrc (char *option)
46+
pl_rust_cargo_setsrc (char *option)
5047
{
51-
chsrc_yield_source_and_confirm (pl_rust);
48+
chsrc_yield_source_and_confirm (pl_rust_cargo);
5249

5350
const char* file = xy_strjoin (3,
5451
"[source.crates-io]\n"
@@ -64,17 +61,17 @@ pl_rust_setsrc (char *option)
6461

6562

6663
/**
67-
* chsrc reset rust
64+
* chsrc reset cargo
6865
*/
6966
void
70-
pl_rust_resetsrc (char *option)
67+
pl_rust_cargo_resetsrc (char *option)
7168
{
72-
pl_rust_setsrc (SetsrcType_Reset);
69+
pl_rust_cargo_setsrc (SetsrcType_Reset);
7370
}
7471

7572

7673
FeatInfo
77-
pl_rust_feat (char *option)
74+
pl_rust_cargo_feat (char *option)
7875
{
7976
FeatInfo fi = {0};
8077

@@ -91,4 +88,4 @@ pl_rust_feat (char *option)
9188
}
9289

9390

94-
def_target_gsrf(pl_rust);
91+
def_target_gsrf(pl_rust_cargo);

src/recipe/lang/Rust/common.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/** ------------------------------------------------------------
2+
* SPDX-License-Identifier: GPL-3.0-or-later
3+
* -------------------------------------------------------------
4+
* File Authors : Aoran Zeng <[email protected]>
5+
* Contributors : Nil Null <[email protected]>
6+
* Created On : <2024-10-02>
7+
* Last Modified : <2024-10-02>
8+
* ------------------------------------------------------------*/
9+
10+
static MirrorSite
11+
RsProxyCN = {"rsproxycn", "RsProxy.cn", "字节跳动基础架构Dev Infra", "https://rsproxy.cn/", NULL};

src/recipe/menu.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Contributors : Nil Null <[email protected]>
66
* Created On : <2023-09-01>
77
* Major Revision : 1
8-
* Last Modified : <2024-09-29>
8+
* Last Modified : <2024-10-02>
99
* ------------------------------------------------------------*/
1010

1111
/* Begin Target Matrix */
@@ -29,7 +29,10 @@ static const char
2929
*pl_php [] = {"php", "composer", NULL, t(&pl_php_target)},
3030
*pl_lua [] = {"lua", "luarocks", NULL, t(&pl_lua_target)},
3131
*pl_go [] = {"go", "golang", "goproxy", NULL, t(&pl_go_target)} ,
32-
*pl_rust [] = {"rust", "cargo", "crate", "crates", NULL, t(&pl_rust_target)},
32+
33+
*pl_rust_cargo[] = {"rust", "cargo", "crate", "crates", NULL, t(&pl_rust_cargo_target)},
34+
*pl_rust_rustup[]= {"rustup", NULL, t(&pl_rust_rustup_target)},
35+
3336
*pl_java [] = {"java", "maven", "mvn", "gradle", NULL, t(&pl_java_target)},
3437
*pl_clojure[]= {"clojure","clojars","cloj", "lein", NULL, t(&pl_clojure_target)},
3538

@@ -50,7 +53,8 @@ static const char
5053
pl_nodejs_nvm,
5154
pl_perl, pl_php,
5255
pl_lua,
53-
pl_rust, pl_go,
56+
pl_rust_cargo, pl_rust_rustup,
57+
pl_go,
5458
/*pl_nuget,*/
5559
pl_java, pl_clojure,
5660
pl_dart, pl_dart_flutter,

0 commit comments

Comments
 (0)