Last active: 2 years ago
fn plus_one(target: Option<i32>) -> Option<i32> { target.map(|x| x + 1); target } fn main() { let my_num = Some(41); let my_num = plus_one(my_num); println!("My number: {:?}", my_num); }