Rust Cheatsheet by @Mdht

https://twitter.com/mdhhht/status/1640192519769038848

Data Types

let arr: [i32; 4] = [1, 2, 3, 4];
let tup: (i32, f64, bool) = (500, 6.4, true);
use std::collections::HashMap;

let solar_distance = HashMap::from([
    ("Mercury", 0.4),
    ("Venus", 0.7),
    ("Earth", 1.0),
    ("Mars", 1.5), 
]);

Control Flow