mirror of
https://github.com/launchbadge/sqlx.git
synced 2025-10-02 23:35:20 +00:00
Allow clippy::suspicious_else_formatting when expanding query arguments.
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.
This commit is contained in:
parent
c1e79d2675
commit
9d11c7a7f1
@ -74,6 +74,8 @@ pub fn quote_args<DB: DatabaseExt>(
|
||||
};
|
||||
|
||||
Ok(quote_spanned!(expr.span() =>
|
||||
#[allow(clippy::suspicious_else_formatting)]
|
||||
{
|
||||
// this shouldn't actually run
|
||||
if false {
|
||||
use sqlx::ty_match::{WrapSameExt as _, MatchBorrowExt as _};
|
||||
@ -92,6 +94,7 @@ pub fn quote_args<DB: DatabaseExt>(
|
||||
// this causes move-analysis to effectively ignore this block
|
||||
panic!();
|
||||
}
|
||||
}
|
||||
))
|
||||
})
|
||||
.collect::<crate::Result<TokenStream>>()?
|
||||
|
Loading…
x
Reference in New Issue
Block a user