From 42fbe4e178a86d235fbff434ca2ef01b1410cded Mon Sep 17 00:00:00 2001 From: "David E. Perez Negron R." Date: Wed, 25 Oct 2023 19:55:37 -0600 Subject: [PATCH] variables done --- exercises/variables/variables1.rs | 3 +-- exercises/variables/variables2.rs | 3 +-- exercises/variables/variables3.rs | 3 +-- exercises/variables/variables4.rs | 3 +-- exercises/variables/variables5.rs | 3 +-- exercises/variables/variables6.rs | 3 +-- 6 files changed, 6 insertions(+), 12 deletions(-) diff --git a/exercises/variables/variables1.rs b/exercises/variables/variables1.rs index b3e089a..469fd4e 100644 --- a/exercises/variables/variables1.rs +++ b/exercises/variables/variables1.rs @@ -5,9 +5,8 @@ // 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 e1c23ed..eb9a547 100644 --- a/exercises/variables/variables2.rs +++ b/exercises/variables/variables2.rs @@ -3,10 +3,9 @@ // Execute `rustlings hint variables2` or use the `hint` watch subcommand for a // hint. -// I AM NOT DONE fn main() { - let x; + let x: isize = 10; if x == 10 { println!("x is ten!"); } else { diff --git a/exercises/variables/variables3.rs b/exercises/variables/variables3.rs index 86bed41..c40cf3a 100644 --- a/exercises/variables/variables3.rs +++ b/exercises/variables/variables3.rs @@ -3,9 +3,8 @@ // 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 = 1; println!("Number {}", x); } diff --git a/exercises/variables/variables4.rs b/exercises/variables/variables4.rs index 5394f39..2d056da 100644 --- a/exercises/variables/variables4.rs +++ b/exercises/variables/variables4.rs @@ -3,10 +3,9 @@ // 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 a29b38b..2a312ac 100644 --- a/exercises/variables/variables5.rs +++ b/exercises/variables/variables5.rs @@ -3,11 +3,10 @@ // 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 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 853183b..8c71edf 100644 --- a/exercises/variables/variables6.rs +++ b/exercises/variables/variables6.rs @@ -3,9 +3,8 @@ // Execute `rustlings hint variables6` or use the `hint` watch subcommand for a // hint. -// I AM NOT DONE -const NUMBER = 3; +const NUMBER: isize = 3; fn main() { println!("Number {}", NUMBER); }