From 84fda626780f43dc13ca06489058efbf019a8000 Mon Sep 17 00:00:00 2001 From: Sergio Benitez Date: Fri, 19 Mar 2021 18:04:28 -0700 Subject: [PATCH] Emit query parse code only when there's a query. --- core/codegen/src/attribute/route/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/codegen/src/attribute/route/mod.rs b/core/codegen/src/attribute/route/mod.rs index 509f84b0..535a99dc 100644 --- a/core/codegen/src/attribute/route/mod.rs +++ b/core/codegen/src/attribute/route/mod.rs @@ -24,6 +24,10 @@ impl Route { fn query_decls(route: &Route) -> Option { use devise::ext::{Split2, Split6}; + if route.query_params.is_empty() && route.query_guards().next().is_none() { + return None; + } + define_spanned_export!(Span::call_site() => __req, __data, _log, _form, Outcome, _Ok, _Err, _Some, _None );