diff options
author | garhve <git@garhve.com> | 2022-12-22 18:03:28 +0800 |
---|---|---|
committer | garhve <git@garhve.com> | 2022-12-22 18:03:28 +0800 |
commit | 36920adbaa85bd1be5ad37d7a22212231179930f (patch) | |
tree | 4cdc0aaaff479b6f41b39d68e7ba49d53867b096 /rust/theBook/chapter-3-variables-and-mutability/variables | |
parent | b5aa889f7fced8ba2cc1698ae9696d7bd0ca8ab5 (diff) |
finish chapter 3
Diffstat (limited to 'rust/theBook/chapter-3-variables-and-mutability/variables')
-rw-r--r-- | rust/theBook/chapter-3-variables-and-mutability/variables/Cargo.toml | 8 | ||||
-rw-r--r-- | rust/theBook/chapter-3-variables-and-mutability/variables/src/main.rs | 7 |
2 files changed, 15 insertions, 0 deletions
diff --git a/rust/theBook/chapter-3-variables-and-mutability/variables/Cargo.toml b/rust/theBook/chapter-3-variables-and-mutability/variables/Cargo.toml new file mode 100644 index 0000000..f1cad76 --- /dev/null +++ b/rust/theBook/chapter-3-variables-and-mutability/variables/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "variables" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/rust/theBook/chapter-3-variables-and-mutability/variables/src/main.rs b/rust/theBook/chapter-3-variables-and-mutability/variables/src/main.rs new file mode 100644 index 0000000..ecaf28f --- /dev/null +++ b/rust/theBook/chapter-3-variables-and-mutability/variables/src/main.rs @@ -0,0 +1,7 @@ +fn main() { + let mut x = 5; + println!("The value of x = {x}"); + + x = 6; + println!("The value of x = {x}"); +} |