X-Git-Url: http://git.bitcoin.ninja/index.cgi?p=ldk-c-bindings;a=blobdiff_plain;f=c-bindings-gen%2Fsrc%2Ftypes.rs;h=c96a3b9a2fd51220057d89381c95e77e2f5d11a6;hp=b988a7b6d563a2b60003ee869d648b856b21db83;hb=881edcf972ef61892b191a16942f93e76e28f7f6;hpb=929b97a07daa8fc205b6b1795b597a8cde8bb346 diff --git a/c-bindings-gen/src/types.rs b/c-bindings-gen/src/types.rs index b988a7b..c96a3b9 100644 --- a/c-bindings-gen/src/types.rs +++ b/c-bindings-gen/src/types.rs @@ -227,12 +227,13 @@ impl<'a, 'p: 'a> GenericTypes<'a, 'p> { non_lifetimes_processed = true; if path != "std::ops::Deref" && path != "core::ops::Deref" { new_typed_generics.insert(&type_param.ident, Some(path)); - } else if trait_bound.path.segments.len() == 1 { + } else { // If we're templated on Deref, store // the reference type in `default_generics` which handles full // types and not just paths. if let syn::PathArguments::AngleBracketed(ref args) = trait_bound.path.segments[0].arguments { + assert_eq!(trait_bound.path.segments.len(), 1); for subargument in args.args.iter() { match subargument { syn::GenericArgument::Lifetime(_) => {},