Let-else syntax feels underwhelming
โ Rust ๐ 2025-05-06 ๐ค surdeus ๐๏ธ 12I tried to switch from match to let-else for my error handling, but not having access to the value in the else block severely limits what you can do: I can't log the error, convert it, or match on it.
Things are a bit better with Option, since with None you don't have a value. Still, I try to stick with match for consistency, as alongside you would often have matches on Results, and being consistent is more important than saving a few keystrokes.
While let-else is occasionally useful, the feature often feels underwhelming.
Not saying it isn't useful for othersโjust sharing my thoughts.
I'd be interested to hear what others think.
19 posts - 9 participants
๐ท๏ธ rust_feed