Skip to content

Commit

Permalink
deps: up-to-date
Browse files Browse the repository at this point in the history
  • Loading branch information
LinkChou committed Sep 2, 2024
1 parent 9480a2e commit 019ee02
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 12 deletions.
30 changes: 27 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,33 @@ lazy_static = {version = "1.4.0", registry = "sjtu"}




## 错误处理

以下是 crm 异常结束的情况对照表:
- 1:写入的镜像名称有误
- 2:写入的镜像地址有误
- 3:`config.json` 文件的 `dl` 字段值有误
- 4:命令无效
- 5:字段不存在(cargo的配置文件有误)
- 6:配置文件解析失败(格式有误或字段缺失)
- 7:要进行下载测试的镜像不存在
- 8:`REPLACE_WITH` 字段的值缺失
- 9:配置文件格式错误(字段值无法写入不是表的类型中)
- 10:属性名错误
- 11:不能删除内置镜像
- 12:要删除的镜像不存在
- 13:要进行连接测试的镜像不存在
- 14:解析配置文件失败
- 15:字段有误,请参考提示
- 16:文件的条目中缺少字段,请参考提示
- 17:字段有误,请参考提示
- 18:写入文件失败,请检查权限
- 19:传入的参数错误
- 20:配置文件冲突,需手动检查



## Others

### rust-library-chinese
Expand All @@ -190,9 +217,6 @@ lazy_static = {version = "1.4.0", registry = "sjtu"}
- [从 Github 访问](https://github.com/wtklbm/rust-library-i18n)
- [从 Gitee 访问](https://gitee.com/wtklbm/rust-library-chinese)




## LICENSE

MIT OR Apache-2.0
Expand Down
6 changes: 0 additions & 6 deletions src/cargo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,6 @@ impl CargoConfig {
let source: &mut Table = data[SOURCE].as_table_mut().unwrap();
if !source.contains_key(CRATES_IO) {
data[SOURCE][CRATES_IO] = table();
} else {
let crates_io = &source[CRATES_IO];
if crates_io.is_none() {
field_eprint(CRATES_IO, TABLE);
process::exit(7);
}
}
};
}
Expand Down
6 changes: 3 additions & 3 deletions src/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ impl Registry {
let urls = match name {
Some(name) => {
if self.rc.get(name).is_none() {
to_out(format!("测试失败,{} 镜像不存在", name));
process::exit(13);
to_out(format!("下载测试失败,{} 镜像不存在", name));
process::exit(7);
}

vec![(name.to_string(), self.to_download_url(name))]
Expand Down Expand Up @@ -260,7 +260,7 @@ impl Registry {
let urls = match name {
Some(name) => {
if self.rc.get(name).is_none() {
to_out(format!("测试失败,{} 镜像不存在", name));
to_out(format!("连接测试失败,{} 镜像不存在", name));
process::exit(13);
}

Expand Down

0 comments on commit 019ee02

Please sign in to comment.