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]]
name = "rustlings"
version = "5.4.0"
version = "5.4.1"
dependencies = [
"argh",
"assert_cmd",

View File

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

View File

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

View File

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

View File

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

View File

@ -6,6 +6,6 @@
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);
}

View File

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