Use of let-else syntax. #3494
Ben-PH
started this conversation in
Code Style
Replies: 1 comment 3 replies
-
|
I find it so strange to don't have the two cases of a Result in two separate lines each case making his own work. I'm so used to read let [variable_name] that this look strange to me but it's interesting in case of complex code in one branch it avoid writing everything in the branch. I'm not fully convicted but I see some advantages |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
as of rust 1.65, let-else syntax has been stabalised. At times, this can make the code more readable:
conisider this function:
massa/massa-client/src/cmds.rs
Line 1435 in 61f7bb9
becomes
A PR clearing the
clippy::manual-let-elselints which make these recommendations can be found in #3499Beta Was this translation helpful? Give feedback.
All reactions