Skip to content

Commit

Permalink
Merge pull request #1503 from FlorentCLMichel/master
Browse files Browse the repository at this point in the history
Add +1 to next_age
  • Loading branch information
marioidival authored Feb 10, 2022
2 parents cb578b1 + 3211811 commit a87a51a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/error/option_unwrap/question_mark.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function is being executed and return `None`.
fn next_birthday(current_age: Option<u8>) -> Option<String> {
// If `current_age` is `None`, this returns `None`.
// If `current_age` is `Some`, the inner `u8` gets assigned to `next_age`
let next_age: u8 = current_age?;
let next_age: u8 = current_age? + 1;
Some(format!("Next year I will be {}", next_age))
}
```
Expand Down

0 comments on commit a87a51a

Please sign in to comment.