mirror of https://github.com/rwf2/Rocket.git
Ignore 'snake_case' warnings for 'tmp' variables.
This commit is contained in:
parent
a87e3ad9f5
commit
816b8c44ab
|
@ -108,7 +108,7 @@ fn extract_exprs<'a>(internal: &'a InternalUriParams) -> Result<(
|
||||||
|
|
||||||
fn add_binding(to: &mut Vec<TokenStream2>, ident: &Ident, ty: &Type, expr: &Expr, source: Source) {
|
fn add_binding(to: &mut Vec<TokenStream2>, ident: &Ident, ty: &Type, expr: &Expr, source: Source) {
|
||||||
let uri_mod = quote!(rocket::http::uri);
|
let uri_mod = quote!(rocket::http::uri);
|
||||||
let (span, ident_tmp) = (expr.span(), ident.prepend("tmp_"));
|
let (span, ident_tmp) = (expr.span(), ident.prepend("__tmp_"));
|
||||||
let from_uri_param = if source == Source::Query {
|
let from_uri_param = if source == Source::Query {
|
||||||
quote_spanned!(span => #uri_mod::FromUriParam<#uri_mod::Query, _>)
|
quote_spanned!(span => #uri_mod::FromUriParam<#uri_mod::Query, _>)
|
||||||
} else {
|
} else {
|
||||||
|
@ -116,6 +116,7 @@ fn add_binding(to: &mut Vec<TokenStream2>, ident: &Ident, ty: &Type, expr: &Expr
|
||||||
};
|
};
|
||||||
|
|
||||||
to.push(quote_spanned!(span =>
|
to.push(quote_spanned!(span =>
|
||||||
|
#[allow(non_snake_case)]
|
||||||
let #ident_tmp = #expr;
|
let #ident_tmp = #expr;
|
||||||
let #ident = <#ty as #from_uri_param>::from_uri_param(#ident_tmp);
|
let #ident = <#ty as #from_uri_param>::from_uri_param(#ident_tmp);
|
||||||
));
|
));
|
||||||
|
|
Loading…
Reference in New Issue