Rust 开发笔记
rustup中国源:
使用rustup安装rust时:
$ # for bash
$ RUSTUP_DIST_SERVER=https://mirrors.tuna.tsinghua.edu.cn/rustup rustup install stable # for stable
$ # for fish
$ env RUSTUP_DIST_SERVER=https://mirrors.tuna.tsinghua.edu.cn/rustup rustup install stable # for stable
如果长期启用TUNA源:
$ # for bash
$ echo 'export RUSTUP_DIST_SERVER=https://mirrors.tuna.tsinghua.edu.cn/rustup' >> ~/.bash_profile
$ # for fish
$ echo 'set -x RUSTUP_DIST_SERVER https://mirrors.tuna.tsinghua.edu.cn/rustup' >> ~/.config/fish/config.fish
crates.io的镜像源:
- TUNA:
[registry] index = "git://mirrors.ustc.edu.cn/crates.io-index" # 或者 index = "http://mirrors.ustc.edu.cn/crates.io-index"
- 中科大
tee $HOME/.cargo/config <<-'EOF'
[source.crates-io]
registry = "https://github.com/rust-lang/crates.io-index"
replace-with = 'ustc'
[source.ustc]
registry = "git://mirrors.ustc.edu.cn/crates.io-index"
EOF
- 阿里云:
tee $HOME/.cargo/config <<-'EOF'
[source.crates-io]
replace-with = "rustcc"
[source.rustcc]
registry = "https://code.aliyun.com/rustcc/crates.io-index"
EOF