We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
From rust-lang/rust-clippy#4123 (comment):
F: FnMut(&ast::Block, Option<&ast::Label>), { if let ast::ExprKind::While(_, loop_block, label) - | ast::ExprKind::ForLoop(_, _, loop_block, label) - | ast::ExprKind::Loop(loop_block, label) - = &expr.node + | ast::ExprKind::ForLoop(_, _, loop_block, label) + | ast::ExprKind::Loop(loop_block, label) = &expr.node { func(loop_block, label.as_ref()); }
In this case,
&expr.node
Note that for multi-lined patterns of match's arm, rustfmt does not add indentation.
match some_value { ast::ExprKind::While(_, loop_block, label) | ast::ExprKind::ForLoop(_, _, loop_block, label) | ast::ExprKind::Loop(loop_block, label) = &expr.node => { // ... }
The text was updated successfully, but these errors were encountered:
I think that the pattern like multi-lined patterns of match's arm is good.
Sorry, something went wrong.
confirming I can reproduce this behavior with rustfmt 1.5.1-nightly (f2c31ba0 2022-07-19)
rustfmt 1.5.1-nightly (f2c31ba0 2022-07-19)
Input
fn foo(f: F) where F: FnMut(&ast::Block, Option<&ast::Label>), { if let ast::ExprKind::While(_, loop_block, label) | ast::ExprKind::ForLoop(_, _, loop_block, label) | ast::ExprKind::Loop(loop_block, label) = &expr.node { func(loop_block, label.as_ref()); } }
Output
No branches or pull requests
From rust-lang/rust-clippy#4123 (comment):
In this case,
&expr.node
) on the same line as the last clause, or put it on the next line?Note that for multi-lined patterns of match's arm, rustfmt does not add indentation.
The text was updated successfully, but these errors were encountered: