This repository has been archived on 2023-03-24. You can view files and clone it, but cannot push or open issues or pull requests.
rustlings-exercises-completed/ex6.rs

48 lines
395 B
Rust
Raw Normal View History

// 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;