From 816b8c44ab38f43d64d780d1a03779138afa8dec Mon Sep 17 00:00:00 2001 From: Sergio Benitez Date: Tue, 14 Jul 2020 00:43:48 -0700 Subject: [PATCH] Ignore 'snake_case' warnings for 'tmp' variables. --- core/codegen/src/bang/uri.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/codegen/src/bang/uri.rs b/core/codegen/src/bang/uri.rs index 3ea19a51..77cbda84 100644 --- a/core/codegen/src/bang/uri.rs +++ b/core/codegen/src/bang/uri.rs @@ -108,7 +108,7 @@ fn extract_exprs<'a>(internal: &'a InternalUriParams) -> Result<( fn add_binding(to: &mut Vec, ident: &Ident, ty: &Type, expr: &Expr, source: Source) { 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 { quote_spanned!(span => #uri_mod::FromUriParam<#uri_mod::Query, _>) } else { @@ -116,6 +116,7 @@ fn add_binding(to: &mut Vec, ident: &Ident, ty: &Type, expr: &Expr }; to.push(quote_spanned!(span => + #[allow(non_snake_case)] let #ident_tmp = #expr; let #ident = <#ty as #from_uri_param>::from_uri_param(#ident_tmp); ));