From b19405348ee79506872a2209a4dac09a181cf652 Mon Sep 17 00:00:00 2001 From: Low Kian Seong Date: Sat, 10 Jul 2021 18:48:48 +0800 Subject: [PATCH] completed exer var 1,2,3 --- exercises/variables/variables1.rs | 4 +--- exercises/variables/variables2.rs | 4 +--- exercises/variables/variables3.rs | 4 +--- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/exercises/variables/variables1.rs b/exercises/variables/variables1.rs index 4a3af73c..db85e7e4 100644 --- a/exercises/variables/variables1.rs +++ b/exercises/variables/variables1.rs @@ -6,9 +6,7 @@ // even after you already figured it out. If you got everything working and // feel ready for the next exercise, remove the `I AM NOT DONE` comment below. -// I AM NOT DONE - fn main() { - x = 5; + let x = 5; println!("x has the value {}", x); } diff --git a/exercises/variables/variables2.rs b/exercises/variables/variables2.rs index 7774a8fb..81e78d53 100644 --- a/exercises/variables/variables2.rs +++ b/exercises/variables/variables2.rs @@ -1,10 +1,8 @@ // variables2.rs // Make me compile! Execute the command `rustlings hint variables2` if you want a hint :) -// I AM NOT DONE - fn main() { - let x; + let x:i32 = 10; if x == 10 { println!("Ten!"); } else { diff --git a/exercises/variables/variables3.rs b/exercises/variables/variables3.rs index 30ec48ff..7d84709d 100644 --- a/exercises/variables/variables3.rs +++ b/exercises/variables/variables3.rs @@ -1,10 +1,8 @@ // variables3.rs // Make me compile! Execute the command `rustlings hint variables3` if you want a hint :) -// I AM NOT DONE - fn main() { - let x = 3; + let mut x = 3; println!("Number {}", x); x = 5; // don't change this line println!("Number {}", x);