Closed
Description
if .. else
is sometimes used in lieu of the ternary operator in C, so it might be a good idea to preserve the original intention if the programmer wrote a short if .. else
expression in a single line.
A wild case found in rust-lang/rust#28988:
if align <= MIN_ALIGN { 0 } else { mallocx_align(align) }
was converted into:
if align <= MIN_ALIGN {
0
} else {
mallocx_align(align)
}
which looks a bit more verbose. Is this an intended behavior?
Hmm, well, looking at the code again, the latter also seems OK to me... Now I'm not sure which side I'm in. Maybe this should be exposed as a configuration option?
Metadata
Metadata
Assignees
Labels
No labels