Closed as not planned
Description
I haven't found a self-contained example of this yet, but this commit demonstrates the problem: rustfmt changes
if let Ok(name) = str::from_utf8(name) && is_dyn_sym(name) {
let ptr = this.fn_ptr(FnVal::Other(DynSym::from_str(name)));
this.write_pointer(ptr, dest)?;
} else {
this.write_null(dest)?;
}
to
if let Ok(name) = str::from_utf8(name)
&& is_dyn_sym(name)
{
let ptr = this.fn_ptr(FnVal::Other(DynSym::from_str(name)));
this.write_pointer(ptr, dest)?;
} else {
this.write_null(dest)?;
}
Which looks worse due to splitting the if
over multiple lines, and which looks like a bug since in the original code, this line was actually shorter than the next one, so it is clearly below the threshold for breaking long lines. I've never seen normal if
behave like that, so it's probably something specific to if let
, maybe specific to let_chains
even.
This is a recent regression, until recently rustfmt didn't change our formatting here.
Metadata
Metadata
Assignees
Labels
No labels