Skip to content

Instantly share code, notes, and snippets.

@caseywdunn
Last active February 1, 2023 22:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save caseywdunn/a9ee45ac080f5316692b0f177a656491 to your computer and use it in GitHub Desktop.
Save caseywdunn/a9ee45ac080f5316692b0f177a656491 to your computer and use it in GitHub Desktop.

Rust cheatsheet

Some notes as I learn Rust.

Learning the Rust language

Common development tasks

cargo clippy # Linting, identifies issues and fixes
cargo clippy --fix # Linting, identifies issues and applies fixes
cargo fmt # Apply suggested code formatting
cargo test # Run all tests
cargo build # Build debug binary in `target/debug`
cargo build --release # Build release binary in `target/release`. Can be 10x as fast as debug

Setting up VS Code

Data science

There are two primary options for data representation beyond built in data structures:

  • ndarray, the closest equivalent of numpy. Has some basic linear algebra.
  • nalgebra, for focused on linear algebra

Reading andwriating ndarray data to files - https://crates.io/crates/ndarray-csv

The primary plotting package is plotters. Some resources:

Embedded systems

https://github.com/rust-embedded/awesome-embedded-rust

https://docs.rust-embedded.org/book/intro/index.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment