From d314f3d8c1818215b65e6ac65a07b884ad7e33ba Mon Sep 17 00:00:00 2001 From: Agustin Velez Date: Tue, 9 Jan 2024 05:49:51 -0300 Subject: [PATCH] doc: add resources for variable and data types (#4948) Add links for variables and data types from The Book (Official docs) --- .../101-language-basics/100-syntax/101-variables.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/data/roadmaps/rust/content/101-language-basics/100-syntax/101-variables.md b/src/data/roadmaps/rust/content/101-language-basics/100-syntax/101-variables.md index b9bf02d58..837afda5b 100644 --- a/src/data/roadmaps/rust/content/101-language-basics/100-syntax/101-variables.md +++ b/src/data/roadmaps/rust/content/101-language-basics/100-syntax/101-variables.md @@ -1,3 +1,8 @@ # 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. \ No newline at end of file +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: + +- [Variables and Mutability](https://rust-book.cs.brown.edu/ch03-01-variables-and-mutability.html) +- [Data Types](https://rust-book.cs.brown.edu/ch03-02-data-types.html)