Warning
This post was published 59 days ago. The information described in this article may have changed.
I 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 match
es on Result
s, 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