Ben Chuanlong Du's Blog

It is never too late to learn.

Tips on Rust

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

Rust Blessed is an unofficial guide to the Rust ecosystem.


Please refer to Tips on rustup for installing Rust using rustup (the recommended way for most users), and Install a Standalone Version of Rust in Linux for installing a global standalone version of Rust.

Install a Newer Version of Rust via PPA on Ubuntu

sudo apt-add-repository ppa:ubuntu-mozilla-security/rust-updates
sudo apt-get update
sudo apt-get install rustc

For details of the PPA ubuntu-mozilla-security/rust-updates, please refer to PPA for preparing rust toolchain updates for Firefox .

Rust Toolchains

  • cargo: package manager for Rust

  • rustup: version manager for Rust

  • rustc: compiler for Rust

  • clippy

  • rustfmt

Conditional Compilation in Rust

Conditional compilation for debug/release


Key Concepts in Rust

Moves, copies and clones in Rust

General Tips and Traps

  1. Common newbie mistakes or bad practices Common Newbie Mistakes and Bad Practices in Rust: Bad Habits

  2. Iterator::for_each is preferred over a for loop; Range (..) is preferred over RangeInclusive (..=). For detailed discussions, please refer to Big performance problem with closed intervals looping #45222 , Performance difference among Range, RangeInclusive and reversed , Why is iterator so much faster? and Why does iteration over an inclusive range generate longer assembly in Rust? .

Pattern Matching in Rust

Please refer to Useful Rust Crates for detailed discussions.

Machine Learning

Please refer to Rust for Machine Learning for detailed discussions.

Parallel, Multithreading and Concurrency in Rust


is a concurrency permutation testing tool for Rust.


This project is the home for Sanitizers: AddressSanitizer, MemorySanitizer, ThreadSanitizer, LeakSanitizer, and more The actual code resides in the LLVM repository. Here we keep extended documentation, bugfixes and some helper code.

rayon A data parallelism library for Rust.

Rust GUI

Optimize Compiling of Rust Projects

Fast Rust Builds has a detailed discuss on how to optimize the compiling time of rust projects.

Cool Rust Projects

Good Blogging on Rust

Good Forums

Rust Magazine


Rust Language Cheat Sheet

How to learn modern Rust

Jon Gjengset's Video Tutorials (Medium to Advanced)

Rust on YouTube

Rust Crash Course | Rustlang