Skip to content

Fix clippy::needless_continue lint in code generated by FromDeriveInput#429

Open
sbernauer wants to merge 1 commit intoTedDriggs:masterfrom
sbernauer:chore/needless-continue-lint
Open

Fix clippy::needless_continue lint in code generated by FromDeriveInput#429
sbernauer wants to merge 1 commit intoTedDriggs:masterfrom
sbernauer:chore/needless-continue-lint

Conversation

@sbernauer
Copy link
Copy Markdown

In the FromDeriveInput derive macro, in

quote! {
#(#names)|* => #push_command,
_ => continue,
}
a match statement similar to this is produced:

match foo {
    "bar" => do_something(),
    _ => continue,
}

After enabling the needless_continue lint (as part of pedantic lints) in our codebase, it complained about the match statement generated by darling. It suggests to "drop the continue expression".

I was able to quickly fix the lint, however I'm not sure if the continue is intentional preferred over {}. In which case I'm also happy to change this PR to add a #[expect(clippy::needless_continue)] to the generated code, just let me know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant