1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-03-20 14:31:15 +02:00

Add TODO to indicate let-else example should be rewritten (#2562)

Fixes #2473.
This commit is contained in:
Dustin J. Mitchell 2025-01-19 01:47:33 -05:00 committed by GitHub
parent bcbe6b0876
commit f1ad41e2bc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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) {