We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
if let
&&
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If we chain multiple if let blocks into a single one with &&, rustfmt fails to format or gives
rustfmt
error[internal]: left behind trailing whitespace
Example:
fn main() { let x = Some(10); let y = None; if let Some(x) = x && let Some(y) = y { println!("Hi"); } }
Version: 1.6.0-nightly (2023-07-27 500647f)
1.6.0-nightly (2023-07-27 500647f)
The text was updated successfully, but these errors were encountered:
This is because unstable feature let-chains is not formatted (WIP in #5203). Note a similar but different stable feature let-else can be formatted.
let-chains
let-else
You need to manually format it, and remove the trailing spaces
Sorry, something went wrong.
I thought it should be a WIP but couldn't remember the feature name :).
Duplicate of #5177
No branches or pull requests
If we chain multiple
if let
blocks into a single one with&&
,rustfmt
fails to format or givesExample:
Version:
1.6.0-nightly (2023-07-27 500647f)
The text was updated successfully, but these errors were encountered: