diff --git a/src/framework/struct.h b/src/framework/struct.h index 13bcaad..742e6aa 100644 --- a/src/framework/struct.h +++ b/src/framework/struct.h @@ -40,13 +40,16 @@ typedef SourceProvider_t MirrorSite_t; SourceProvider_t UpstreamProvider = { - /* 引入新的上游默认源时,请使下面第一行的前三个字段保持不变,只添加第四个字段 */ + /* 引入新的上游默认源时,请使下面第一行的前三个字段保持不变,只添加第四个字段,可使用 def_upstream 宏 */ "upstream", "Upstream", "上游默认源", NULL, - /* 引入新的上游默认源时,请完全修改下面这个结构体 */ + /* 引入新的上游默认源时,请完全修改下面这个结构体,可使用 def_need_measure_info 宏 */ {SKIP, "URL未知,邀您参与贡献!", "URL unknown, welcome to contribute!", NULL} -}, +}; -UserDefinedProvider = +#define def_upstream "upstream", "Upstream", "上游默认源" +#define def_need_measure_info {SKIP, "缺乏较大的下载对象,邀您参与贡献!", "Lack of large object URL, welcome to contribute!", NULL} + +SourceProvider_t UserDefinedProvider = { "user", "用户自定义", "用户自定义", NULL, {SKIP, "用户自定义源不测速", "SKIP for user-defined source", NULL} diff --git a/src/recipe/lang/Rust/Cargo.c b/src/recipe/lang/Rust/Cargo.c index 70f01fe..3d07beb 100644 --- a/src/recipe/lang/Rust/Cargo.c +++ b/src/recipe/lang/Rust/Cargo.c @@ -3,18 +3,25 @@ * ------------------------------------------------------------- * File Authors : Aoran Zeng * Contributors : Nil Null + * | * Created On : <2023-08-30> - * Last Modified : <2024-10-02> + * Last Modified : <2024-12-18> * ------------------------------------------------------------*/ +static SourceProvider_t pl_rust_cargo_upstream = +{ + def_upstream, "https://crates.io/", + def_need_measure_info +}; + /** - * @update 2024-10-02 + * @update 2024-12-18 * @note 以下都支持稀疏索引,我们换源时都将默认添加 `sparse+` * @note 链接末尾的 `/` 不能缺少 */ static Source_t pl_rust_cargo_sources[] = { - {&UpstreamProvider, "https://index.crates.io/"}, // @help 是这个吗? + {&pl_rust_cargo_upstream, "https://index.crates.io/"}, // @help 是这个吗? {&MirrorZ, "https://mirrors.cernet.edu.cn/crates.io-index/"}, {&Sjtug_Zhiyuan, "https://mirrors.sjtug.sjtu.edu.cn/crates.io-index/"}, {&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/crates.io-index/"},