notes

Log | Files | Refs

rust.txt (681B)


      1 RUST
      2 
      3 Enable nightly (install toolchain):
      4 rustup toolchain install nightly
      5 
      6 Use nightly for one command:
      7 cargo +nightly run
      8 
      9 Use nightly for current directory (creates rust-toolchain.toml):
     10 rustup override set nightly
     11 
     12 Use nightly globally (default for all projects):
     13 rustup default nightly
     14 
     15 Revert directory override:
     16 rustup override unset
     17 
     18 Revert global default to stable:
     19 rustup default stable
     20 
     21 Build and run:
     22 cargo run
     23 
     24 Build with release profile:
     25 cargo build --release
     26 
     27 Add dependency:
     28 cargo add <crate_name>
     29 
     30 Run tests:
     31 cargo test
     32 
     33 Check for warnings/lints:
     34 cargo clippy
     35 
     36 Format code:
     37 cargo fmt --all
     38 
     39 Update dependencies:
     40 cargo update
     41 
     42 Profile memory/perf:
     43 cargo flamegraph