mirror of
https://github.com/rust-lang/rustlings.git
synced 2026-01-08 19:59:19 +00:00
13 lines
367 B
Rust
13 lines
367 B
Rust
// variables5.rs
|
|
//
|
|
// Execute `rustlings hint variables5` or use the `hint` watch subcommand for a
|
|
// hint.
|
|
|
|
|
|
fn main() {
|
|
let mut number: Result<u8, &str> = Err("T-H-R-E-E"); // don't change this line
|
|
println!("Spell a Number : {:?}", number);
|
|
number = Ok(3); // don't rename this variable
|
|
println!("Number plus two is : {}", number.unwrap() + 2);
|
|
}
|