Throw error if query_map has any ref types

This commit is contained in:
Devin Ragotzy 2020-08-06 09:54:41 -04:00 committed by Jonas Platte
parent 588a6035f0
commit f67744bb4f

View File

@ -356,6 +356,14 @@ impl TryFrom<RawRequest> for Request {
));
}
// TODO when/if `&[(&str, &str)]` is supported remove this
if query_map_field.is_some() && !lifetimes.query.is_empty() {
return Err(syn::Error::new_spanned(
raw.request_kw,
"Lifetimes are not allowed for query_map fields",
));
}
Ok(Self { fields, lifetimes })
}
}