working on rustlings

This commit is contained in:
Shymala Sidharth 2023-04-19 15:18:02 +12:00
parent 7f1754ecc5
commit e64fcacd66
7 changed files with 10 additions and 8 deletions

2
Cargo.lock generated
View File

@ -459,7 +459,7 @@ checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b"
[[package]] [[package]]
name = "rustlings" name = "rustlings"
version = "5.4.0" version = "5.4.1"
dependencies = [ dependencies = [
"argh", "argh",
"assert_cmd", "assert_cmd",

View File

@ -5,6 +5,6 @@
// I AM NOT DONE // I AM NOT DONE
fn main() { fn main() {
x = 5; let x = 5;
println!("x has the value {}", x); println!("x has the value {}", x);
} }

View File

@ -4,7 +4,7 @@
// I AM NOT DONE // I AM NOT DONE
fn main() { fn main() {
let x; let x: i32 = 20;
if x == 10 { if x == 10 {
println!("x is ten!"); println!("x is ten!");
} else { } else {

View File

@ -4,6 +4,7 @@
// I AM NOT DONE // I AM NOT DONE
fn main() { fn main() {
let x: i32; let x: i32 = 5;
println!("Number {}", x); let y: i32 = 10;
println!("Number {}", y);
} }

View File

@ -4,7 +4,7 @@
// I AM NOT DONE // I AM NOT DONE
fn main() { fn main() {
let x = 3; let mut x: i32 = 3;
println!("Number {}", x); println!("Number {}", x);
x = 5; // don't change this line x = 5; // don't change this line
println!("Number {}", x); println!("Number {}", x);

View File

@ -6,6 +6,6 @@
fn main() { fn main() {
let number = "T-H-R-E-E"; // don't change this line let number = "T-H-R-E-E"; // don't change this line
println!("Spell a Number : {}", number); 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); println!("Number plus two is : {}", number + 2);
} }

View File

@ -3,7 +3,8 @@
// I AM NOT DONE // I AM NOT DONE
const NUMBER = 3; const NUMBER: u32 = 3;
fn main() { fn main() {
println!("Number {}", NUMBER); println!("Number {}", NUMBER);
} }