diff --git a/ex6.rs b/ex6.rs new file mode 100644 index 00000000..33e589d4 --- /dev/null +++ b/ex6.rs @@ -0,0 +1,47 @@ +// ex6.rs +// Make me compile! Scroll down for hints :) + +fn main() { + let robot_name = Some(String::from("Bors")); + + match robot_name { + Some(name) => println!("Found a name: {}", name), + None => (), + } + + println!("robot_name is: {:?}", robot_name); +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +// Hint: The following two statements are equivalent: +// let x = &y; +// let ref x = y;