Skip to content

Commit

Permalink
Add TODO to indicate let-else example should be rewritten (#2562)
Browse files Browse the repository at this point in the history
Fixes #2473.
  • Loading branch information
djmitche authored Jan 19, 2025
1 parent bcbe6b0 commit f1ad41e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/pattern-matching/let-control-flow.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ off the end of the block).

```rust,editable
fn hex_or_die_trying(maybe_string: Option<String>) -> Result<u32, String> {
// TODO: The structure of this code is difficult to follow -- rewrite it with let-else!
if let Some(s) = maybe_string {
if let Some(first_byte_char) = s.chars().next() {
if let Some(digit) = first_byte_char.to_digit(16) {
Expand Down

0 comments on commit f1ad41e

Please sign in to comment.