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

clippy incompatibility: possibly missing a comma #3072

Open
Dushistov opened this issue Sep 30, 2018 · 1 comment
Open

clippy incompatibility: possibly missing a comma #3072

Dushistov opened this issue Sep 30, 2018 · 1 comment

Comments

@Dushistov
Copy link

Dushistov commented Sep 30, 2018

See rust-lang/rust-clippy#3244 ,

the rustfmt from stable (nightly also) reformat such code

pub fn f(a: i16, b: f64) -> [f64; 3] {
    const C: f64 = 100.;
    [
        b,
        -b,
        match a {
            0x17 => 1.,
            0x18 => 2.,
            _ => 3.,
        } * C
            / 60.,
    ]
}

in the way that cause clippy to produce error

@ytmimi
Copy link
Contributor

ytmimi commented Jul 19, 2022

This was fixed on the clippy side by rust-lang/rust-clippy#3407, however as mentioned in this comment rust-lang/rust-clippy#3244 (comment) there might still be some work on the rustfmt side.

I can confirm that using rustfmt 1.5.1-nightly (a7bf0090 2022-07-17) the code from the original input is left unchanged.

@ytmimi ytmimi added the a-binop label Jul 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants