You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would expect that the unused_parens lint fire for the broken function, but it does not. Compare this to the works function, where it does. This can potentially show up when refactoring a function, e.g. if converting to the above from:
pubfnbroken(x:Option<()>) -> i32{match x {Some(()) => do_something_with(1),None => do_something_with(2),}}
This could arguably be a formatting issue, as some people might like to split things on multiple lines like:
=> (
some_long_expr
)
However, we don't do this for other cases where unused_parens is added. Take, for example:
if(
some_long_expr
){// ...}
This still triggers the unused_parens lint.
This is a particularly weird case because users will often separate out the match arm into a block if it gets long, e.g.:
=> {
some_long_expr
}
But not with parentheses. I think that for the case of parentheses, the precedent should go with removing them.
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
Minimal example:
I would expect that the
unused_parens
lint fire for thebroken
function, but it does not. Compare this to theworks
function, where it does. This can potentially show up when refactoring a function, e.g. if converting to the above from:This could arguably be a formatting issue, as some people might like to split things on multiple lines like:
However, we don't do this for other cases where
unused_parens
is added. Take, for example:This still triggers the
unused_parens
lint.This is a particularly weird case because users will often separate out the match arm into a block if it gets long, e.g.:
But not with parentheses. I think that for the case of parentheses, the precedent should go with removing them.
The text was updated successfully, but these errors were encountered: