From: Matt Corallo Date: Thu, 2 Jun 2022 20:40:54 +0000 (+0000) Subject: Move overly-specific check to an assertion where its relevant X-Git-Tag: v0.0.108.0^2~14 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=550e354c720271341c34c0dc02599cba5046d047;p=ldk-c-bindings Move overly-specific check to an assertion where its relevant --- diff --git a/c-bindings-gen/src/types.rs b/c-bindings-gen/src/types.rs index 5985521..16cc067 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(_) => {},