X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=c-bindings-gen%2Fsrc%2Fmain.rs;fp=c-bindings-gen%2Fsrc%2Fmain.rs;h=961669448fa8b39884c49eec895bfb9d275f1664;hb=c725cd2feb22b9d9fae28f5c21238bf63e48d7aa;hp=1976160f84e4148f8cd086879605e784be407135;hpb=50b79596ea879102808034e44061a7e12e75209c;p=ldk-c-bindings diff --git a/c-bindings-gen/src/main.rs b/c-bindings-gen/src/main.rs index 1976160..9616694 100644 --- a/c-bindings-gen/src/main.rs +++ b/c-bindings-gen/src/main.rs @@ -482,13 +482,18 @@ fn writeln_trait<'a, 'b, W: std::io::Write>(w: &mut W, t: &'a syn::ItemTrait, ty &syn::TraitItem::Type(ref t) => { if t.default.is_some() || t.generics.lt_token.is_some() { unimplemented!(); } let mut bounds_iter = t.bounds.iter(); - match bounds_iter.next().unwrap() { - syn::TypeParamBound::Trait(tr) => { - writeln!(w, "\ttype {} = crate::{};", t.ident, $type_resolver.resolve_path(&tr.path, Some(&gen_types))).unwrap(); - }, - _ => unimplemented!(), + loop { + match bounds_iter.next().unwrap() { + syn::TypeParamBound::Trait(tr) => { + writeln!(w, "\ttype {} = crate::{};", t.ident, $type_resolver.resolve_path(&tr.path, Some(&gen_types))).unwrap(); + for bound in bounds_iter { + if let syn::TypeParamBound::Trait(_) = bound { unimplemented!(); } + } + break; + }, + syn::TypeParamBound::Lifetime(_) => {}, + } } - if bounds_iter.next().is_some() { unimplemented!(); } }, _ => unimplemented!(), }