remove the ex*.rs files

This commit is contained in:
liv
2019-01-09 21:26:12 +01:00
parent ed89ada148
commit b90f642029
7 changed files with 0 additions and 114 deletions

View File

@@ -1,6 +0,0 @@
// ex1.rs
// Make me compile! :)
fn main() {
println();
}

View File

@@ -1,10 +0,0 @@
// ex2.rs
// Make me compile!
fn something() -> String {
"hi!"
}
fn main() {
println!("{}", something());
}

View File

@@ -1,10 +0,0 @@
// ex3.rs
// Make me compile!
struct Foo {
capacity: i32,
}
fn main() {
println!("{:?}", Foo { capacity: 3 });
}

View File

@@ -1,14 +0,0 @@
// ex4.rs
// Make me compile!
fn something() -> Result<i32, std::num::ParseIntError> {
let x:i32 = "3".parse();
Ok(x * 4)
}
fn main() {
match something() {
Ok(..) => println!("You win!"),
Err(e) => println!("Oh no something went wrong: {}", e),
}
}

View File

@@ -1,22 +0,0 @@
// ex5.rs
// Make me compile!
enum Reaction<'a> {
Sad(&'a str),
Happy(&'a str),
}
fn express(sentiment: Reaction) {
match sentiment {
Reaction::Sad(s) => println!(":( {}", s),
Reaction::Happy(s) => println!(":) {}", s),
}
}
fn main () {
let x = Reaction::Happy("It's a great day for Rust!");
express(x);
express(x);
let y = Reaction::Sad("This code doesn't compile yet.");
express(y);
}