Last active
August 2, 2021 05:16
-
-
Save kaushalvivek/9f892892a189c53d3932c7285b850453 to your computer and use it in GitHub Desktop.
Rust Variables 1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let var = 5; // immutable variable, Rust guesses datatype | |
let varWithType:i32 = 5; // immutable variable, datatype specified | |
let mut mutableVar:i32 = 5; // mutable variable with datatype | |
let (varA, varB) = (10, 20); // Rust identifies patterns for variable assignment | |
const CONST_VAR:i32 = 9; // constant declaration, immutable, very fast, requires data-type specification |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment