You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

11 lines
496 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# Cargo构建缓存
Cargo 使用了缓存的方式提升构建效率当构建时Cargo 会将已下载的依赖包放在 `CARGO_HOME` 目录下,下面一起来看看。
## Cargo Home
默认情况下Cargo Home 所在的目录是 `$HOME/.cargo/`,例如在 `macos` ,对应的目录是:
```shell
$ echo $HOME/.cargo/
/Users/sunfei/.cargo/
```
我们也可以通过修改 `CARGO_HOME` [环境变量](https://course.rs/cargo/reference/env.html)的方式来重新设定该目录的位置