3 ms·
With if-let you still need to "pass down" the variable. It would look like: let foo = if let Ok(f) = do_something() { f } else { // Do some error h
by kevincox 4y ago
With if-let you still need to "pass down" the variable. It would look like:
let foo = if let Ok(f) = do_something() {
f
} else {
// Do some error handling, maybe log a warning, maybe skip this item and continue...
};
It's similar to `let else` but you still need this extra `f` variable that isn't really adding clarity.
- deleted 4y ago[deleted]