mynote/rust/rust.md
2022-07-04 00:46:47 +08:00

38 lines
544 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 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
```