diff --git a/src/bindgen/ir/function.rs b/src/bindgen/ir/function.rs index 09b9e837..96cd6d8e 100644 --- a/src/bindgen/ir/function.rs +++ b/src/bindgen/ir/function.rs @@ -49,10 +49,9 @@ impl Function { attrs: &[syn::Attribute], mod_cfg: Option<&Cfg>, ) -> Result { - if let Ok(GenericParams(generics)) = GenericParams::load(&sig.generics) { - if !generics.is_empty() { - return Err("Generic functions are not supported".to_owned()); - } + let GenericParams(generics) = GenericParams::load(&sig.generics)?; + if !generics.is_empty() { + return Err("Generic functions are not supported".to_owned()); } let mut args = sig.inputs.iter().try_skip_map(|x| x.as_argument())?;