01.Rust部署
<h1>01.Rust部署</h1>
<h2>1、下载rustup-init</h2>
<p>官网地址:<a href="https://www.rust-lang.org/zh-CN/tools/install">https://www.rust-lang.org/zh-CN/tools/install</a></p>
<h2>2、安装rust</h2>
<p>1、运行rustup-init.exe安装很慢,设置国内清华镜像源</p>
<pre><code>$ENV:RUSTUP_DIST_SERVER='https://mirrors.ustc.edu.cn/rust-static'
$ENV:RUSTUP_UPDATE_ROOT='https://mirrors.ustc.edu.cn/rust-static/rustup'</code></pre>
<p>2、安装</p>
<pre><code>$ ./rustup-init.exe</code></pre>
<p>3、检查是否安装成功</p>
<pre><code>$ rustc -V
rustc 1.56.1 (59eed8a2a 2021-11-01)
$ cargo -V
cargo 1.57.0 (b2e52d7ca 2021-10-21)</code></pre>
<h1>2、配置Cargo国内镜像源</h1>
<p>1、在.cargo目录下创建配置文件config.toml</p>
<pre><code>$HOME/.cargo/config.toml</code></pre>
<p>2、cargo字节跳动源</p>
<pre><code>[source.crates-io]
replace-with = 'rsproxy-sparse'
[source.rsproxy]
registry = &quot;https://rsproxy.cn/crates.io-index&quot;
[source.rsproxy-sparse]
registry = &quot;sparse+https://rsproxy.cn/index/&quot;
[registries.rsproxy]
index = &quot;https://rsproxy.cn/crates.io-index&quot;
[net]
git-fetch-with-cli = true</code></pre>
<h1>3、下载安装Git</h1>
<pre><code>选择国内下载源,[阿里镜像链接] https://registry.npmmirror.com/binary.html?path=git-for-windows/
可选择最新版本,这里下载v2.42.0.windows.2/
选择安装包,这里下载Git-2.42.0.2-64-bit.exe</code></pre>