Skip to content
New issue

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

Support matches! with if guard #5547

Open
cynecx opened this issue Sep 21, 2022 · 1 comment · May be fixed by #5554
Open

Support matches! with if guard #5547

cynecx opened this issue Sep 21, 2022 · 1 comment · May be fixed by #5554

Comments

@cynecx
Copy link

cynecx commented Sep 21, 2022

rustfmt struggles with matches! and if guards.

fn test() {
    let a = matches!(something.very_very_very.long.even.more.fields, Some(very_long_field_name_name_to_check) if method(very_long_field_name));
}

rustfmt 1.5.1-nightly (c0941dfb 2022-08-21)

@ytmimi
Copy link
Contributor

ytmimi commented Sep 25, 2022

related to #4462

@ytmimi ytmimi linked a pull request Oct 1, 2022 that will close this issue
bors added a commit to rust-lang/rust-clippy that referenced this issue Nov 24, 2023
Nit re `matches!` formatting

I think formatting `matches!` with `if` guards is [still unsupported](rust-lang/rustfmt#5547), which is probably why this was missed.

changelog: none
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants