参考
https://huangjj27.gitlab.io/posts/rust-mirror
https://doc.rust-lang.org/cargo/reference/source-replacement.html
https://lug.ustc.edu.cn/wiki/mirrors/help/rust-crates
https://github.com/rustcc/lernaean-deploy
如当前用户目录为/root 项目目录为/root/rust-test 则在 /root/.cargo 目录或 /root/rust-test/.cargo 目录 创建文件config 内容如下
[source.crates-io]
registry = "https://github.com/rust-lang/crates.io-index"
# 指定镜像
replace-with = 'sjtu'
# 清华大学
[source.tuna]
registry = "https://mirrors.tuna.tsinghua.edu.cn/git/crates.io-index.git"
# 中国科学技术大学
[source.ustc]
registry = "git://mirrors.ustc.edu.cn/crates.io-index"
# 上海交通大学
[source.sjtu]
registry = "https://mirrors.sjtug.sjtu.edu.cn/git/crates.io-index"
# rustcc社区
[source.rustcc]
registry = "https://code.aliyun.com/rustcc/crates.io-index.git"
挨个执行cargo build成功后即使用成功
————————————————
原文链接:https://blog.csdn.net/setlilei/article/details/106204105
如果文章或资源对您有帮助,欢迎打赏作者。一路走来,感谢有您!
txttool.com 说一段 esp56物联 查询128 IP查询