rustfmt
rustfmt copied to clipboard
Rustfmt add unwanted line wrap and indentation when formatting tuple method call
rustfmt 1.7.0-stable (82e1608d 2023-12-21) formats the tuple method call very weirdly when the tuple takes up several lines. It adds new line after ) and additional indent.
let x = (
"some-very-long-first-argument-of-the-tuple",
"second-argument",
)
.into();
This produces really weird artefacts in some codebases. For example, some axum code:
return (
StatusCode::CONFLICT,
Html(format!("email {email} is already taken")),
)
.into_response()
Expected formatting is the following:
let x = (
"some-very-long-first-argument-of-the-tuple",
"second-argument",
)
.into();
return (
StatusCode::CONFLICT,
Html(format!("email {email} is already taken")),
)
.into_response()