api-macros: Replace if-then-panic with assert
This commit is contained in:
parent
bb581e9252
commit
a887dd7387
@ -123,9 +123,10 @@ impl Response {
|
|||||||
pub fn check(&self) -> syn::Result<()> {
|
pub fn check(&self) -> syn::Result<()> {
|
||||||
// TODO: highlight problematic fields
|
// TODO: highlight problematic fields
|
||||||
|
|
||||||
if !self.generics.params.is_empty() || self.generics.where_clause.is_some() {
|
assert!(
|
||||||
panic!("This macro doesn't support generic types");
|
self.generics.params.is_empty() && self.generics.where_clause.is_none(),
|
||||||
}
|
"This macro doesn't support generic types"
|
||||||
|
);
|
||||||
|
|
||||||
let newtype_body_fields = self
|
let newtype_body_fields = self
|
||||||
.fields
|
.fields
|
||||||
|
Loading…
x
Reference in New Issue
Block a user