computer-scienceangular-roadmapbackend-roadmapblockchain-roadmapdba-roadmapdeveloper-roadmapdevops-roadmapfrontend-roadmapgo-roadmaphactoberfestjava-roadmapjavascript-roadmapnodejs-roadmappython-roadmapqa-roadmapreact-roadmaproadmapstudy-planvue-roadmapweb3-roadmap
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
728 B
728 B
Variables, Constants, and Data Types
In Rust, variables are declared using the let
keyword. They are immutable by default, which means once a value is bound to a variable, it cannot be changed. If you want to make a variable mutable, the mut
keyword is used. So, if you wanted to declare a mutable variable x
and assign it the value 5
, you would write let mut x = 5;
. Variables can also be patterned. By default in Rust, variables are block-scoped. Rust also supports several types of variable attributes.
Learn more from the following links: