38 lines
544 B
Markdown
38 lines
544 B
Markdown
# Rust
|
||
|
||
#### install
|
||
|
||
```bash
|
||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
||
rustup update
|
||
```
|
||
|
||
|
||
|
||
|
||
|
||
## expand
|
||
|
||
```bash
|
||
# just for mac
|
||
rustup toolchain install nightly-x86_64-apple-darwin
|
||
|
||
cargo +nightly install cargo-expand
|
||
|
||
|
||
```
|
||
|
||
## cargo target
|
||
|
||
cargo 编译保存地址,不保存到当前目录下,多个cargo包可以共用缓存
|
||
|
||
```bash
|
||
|
||
mkdir -p ~/.cache/cargo/
|
||
export CARGO_TARGET_DIR="$HOME/.cache/cargo"
|
||
|
||
# or
|
||
echo "[build]" > .cargo/config
|
||
echo "target-dir = \"$HOME/shared_rust_target\"" >> .cargo/config
|
||
```
|