rust-tips-and-tricks icon indicating copy to clipboard operation
rust-tips-and-tricks copied to clipboard

A Collection of Rust Tips and Tricks

Table of Contents

  • Unwrapping Multiple Options in Rust
  • Default Trait in Rust
  • Flatten an Option in Rust
  • Unwrap or Default in Rust
  • Drop Trait in Rust
  • HashMap Literals in Rust
  • Parsing JSON in Rust
  • Pattern Matching with Match in Rust
  • Using Nested Paths in Rust
  • Struct Update Syntax in Rust
  • Field Init Shorthand in Rust
  • Shadowing in Rust

Unwrapping Multiple Options in Rust

Source Code

Default Trait in Rust

Source Code

Flatten an Option in Rust

Source Code

Unwrap or Default in Rust

Source Code

Drop Trait in Rust

Source Code

HashMap Literals in Rust

Source Code

Parsing JSON in Rust

Source Code

Pattern Matching with Match in Rust

Source Code

Using Nested Paths in Rust

Source Code

Struct Update Syntax in Rust

Source Code

Field Init Shorthand in Rust

Source Code

Shadowing in Rust

Source Code