mirror of
https://github.com/launchbadge/sqlx.git
synced 2025-12-29 21:00:54 +00:00
fix: non snake case warning (#3454)
* fix: non-snake-case fields warning * cargo fmt
This commit is contained in:
parent
f69f370f25
commit
018ffe7e0d
@ -301,6 +301,7 @@ where
|
||||
|
||||
let mut record_tokens = quote! {
|
||||
#[derive(Debug)]
|
||||
#[allow(non_snake_case)]
|
||||
struct #record_name {
|
||||
#(#record_fields)*
|
||||
}
|
||||
|
||||
@ -143,15 +143,25 @@ pub fn quote_query_as<DB: DatabaseExt>(
|
||||
// binding to a `let` avoids confusing errors about
|
||||
// "try expression alternatives have incompatible types"
|
||||
// it doesn't seem to hurt inference in the other branches
|
||||
#[allow(non_snake_case)]
|
||||
let #var_name = row.try_get_unchecked::<#type_, _>(#i)?.into();
|
||||
},
|
||||
// type was overridden to be a wildcard so we fallback to the runtime check
|
||||
(true, ColumnType::Wildcard) => quote! ( let #var_name = row.try_get(#i)?; ),
|
||||
(true, ColumnType::Wildcard) => quote! (
|
||||
#[allow(non_snake_case)]
|
||||
let #var_name = row.try_get(#i)?;
|
||||
),
|
||||
(true, ColumnType::OptWildcard) => {
|
||||
quote! ( let #var_name = row.try_get::<::std::option::Option<_>, _>(#i)?; )
|
||||
quote! (
|
||||
#[allow(non_snake_case)]
|
||||
let #var_name = row.try_get::<::std::option::Option<_>, _>(#i)?;
|
||||
)
|
||||
}
|
||||
// macro is the `_unchecked!()` variant so this will die in decoding if it's wrong
|
||||
(false, _) => quote!( let #var_name = row.try_get_unchecked(#i)?; ),
|
||||
(false, _) => quote!(
|
||||
#[allow(non_snake_case)]
|
||||
let #var_name = row.try_get_unchecked(#i)?;
|
||||
),
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user