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

Allow clippy::suspicious_else_formatting when expanding query arguments. #817

Conversation

o0Ignition0o
Copy link
Contributor

Expanding several query arguments in the query! macro creates several if false { ... } statements, which in turn trigger clippy's suspicious_else_formatting.

image

This commit allows the clippy lint so users won't be disturbed by it anymore.

Expanding several query arguments in the query! macro creates several if false { ... } statements, which in turn trigger clippy's suspicious_else_formatting (https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_else_formatting).
This commit allows the clippy lint so users won't be disturbed by it.
@o0Ignition0o o0Ignition0o marked this pull request as draft November 15, 2020 11:47
@o0Ignition0o o0Ignition0o marked this pull request as ready for review November 15, 2020 11:49
@mehcode mehcode requested a review from abonander November 16, 2020 02:27
@abonander
Copy link
Collaborator

abonander commented Nov 16, 2020

There's a few other annoying lints from clippy on the generated code. Perhaps we should just wrap all generated code in
#[allow(clippy::all)]

@o0Ignition0o
Copy link
Contributor Author

I'm pretty new to the codebase, but it seems to be the right spot to add #[allow(clippy::all)]

Please let me know if it isn't the case :)

@jplatte
Copy link
Contributor

jplatte commented Nov 17, 2020

Nice, been running into this as well. This should really be fixed in clippy (rust-lang/rust-clippy#6249), but disabling clippy for all macro-generated code probably is fine too.

@o0Ignition0o
Copy link
Contributor Author

Warning: Cache service responded with 429 during upload chunk.

I think we got rate limited ^^'

sqlx-macros/src/query/mod.rs Outdated Show resolved Hide resolved
@abonander abonander merged commit bfa5841 into launchbadge:master Nov 19, 2020
@o0Ignition0o o0Ignition0o deleted the igni/clippy_suspicious_else_formatting branch December 15, 2020 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants