From 44efc4e82174de1582069b5c61b27c9aee9cf130 Mon Sep 17 00:00:00 2001 From: Max B Date: Thu, 17 Nov 2022 13:02:00 +0100 Subject: [PATCH] Successfully fixed all bugs in the Variables section --- exercises/variables/variables1.rs | 4 ++-- exercises/variables/variables2.rs | 4 ++-- exercises/variables/variables3.rs | 4 ++-- exercises/variables/variables4.rs | 4 ++-- exercises/variables/variables5.rs | 4 ++-- exercises/variables/variables6.rs | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/exercises/variables/variables1.rs b/exercises/variables/variables1.rs index f4d182ac..14758e98 100644 --- a/exercises/variables/variables1.rs +++ b/exercises/variables/variables1.rs @@ -2,9 +2,9 @@ // Make me compile! // Execute `rustlings hint variables1` or use the `hint` watch subcommand for a hint. -// 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 641aeb8e..c1c5d260 100644 --- a/exercises/variables/variables2.rs +++ b/exercises/variables/variables2.rs @@ -1,10 +1,10 @@ // variables2.rs // Execute `rustlings hint variables2` or use the `hint` watch subcommand for a hint. -// I AM NOT DONE + fn main() { - let x; + let x = 19; if x == 10 { println!("x is ten!"); } else { diff --git a/exercises/variables/variables3.rs b/exercises/variables/variables3.rs index 819b1bc7..338c3b23 100644 --- a/exercises/variables/variables3.rs +++ b/exercises/variables/variables3.rs @@ -1,9 +1,9 @@ // variables3.rs // Execute `rustlings hint variables3` or use the `hint` watch subcommand for a hint. -// I AM NOT DONE + fn main() { - let x: i32; + let x: i32 = -25; println!("Number {}", x); } diff --git a/exercises/variables/variables4.rs b/exercises/variables/variables4.rs index 54491b0a..f64b56a2 100644 --- a/exercises/variables/variables4.rs +++ b/exercises/variables/variables4.rs @@ -1,10 +1,10 @@ // variables4.rs // Execute `rustlings hint variables4` or use the `hint` watch subcommand for 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); diff --git a/exercises/variables/variables5.rs b/exercises/variables/variables5.rs index 0e670d2a..ed9cb646 100644 --- a/exercises/variables/variables5.rs +++ b/exercises/variables/variables5.rs @@ -1,11 +1,11 @@ // variables5.rs // Execute `rustlings hint variables5` or use the `hint` watch subcommand for a hint. -// I AM NOT DONE + fn main() { let number = "T-H-R-E-E"; // don't change this line println!("Spell a Number : {}", number); - number = 3; // don't rename this variable + let mut number = 3; // don't rename this variable println!("Number plus two is : {}", number + 2); } diff --git a/exercises/variables/variables6.rs b/exercises/variables/variables6.rs index a8520122..e4dfa10e 100644 --- a/exercises/variables/variables6.rs +++ b/exercises/variables/variables6.rs @@ -1,9 +1,9 @@ // variables6.rs // Execute `rustlings hint variables6` or use the `hint` watch subcommand for a hint. -// I AM NOT DONE -const NUMBER = 3; + +const NUMBER: u8 = 3; fn main() { println!("Number {}", NUMBER); }