X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=c-bindings-gen%2Fsrc%2Fmain.rs;h=9f3727d0486992ba15e8f2d0b7ebfb3a6b8e3080;hb=3ddf30cda74b64d1e1fe3f57e06cbb5440f630e4;hp=ad2690ce8a0ff99ac6695b18ac0607451f143ead;hpb=5aaf753ce9c1b52d2b8ae46c93b0e57e7ac0f4fc;p=ldk-c-bindings diff --git a/c-bindings-gen/src/main.rs b/c-bindings-gen/src/main.rs index ad2690c..9f3727d 100644 --- a/c-bindings-gen/src/main.rs +++ b/c-bindings-gen/src/main.rs @@ -36,6 +36,7 @@ use blocks::*; const DEFAULT_IMPORTS: &'static str = " use alloc::str::FromStr; +use alloc::string::String; use core::ffi::c_void; use core::convert::Infallible; use bitcoin::hashes::Hash; @@ -533,8 +534,7 @@ fn writeln_trait<'a, 'b, W: std::io::Write>(w: &mut W, t: &'a syn::ItemTrait, ty 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(t) = bound { - // We only allow for `?Sized` here. - if let syn::TraitBoundModifier::Maybe(_) = t.modifier {} else { panic!(); } + // We only allow for `Sized` here. assert_eq!(t.path.segments.len(), 1); assert_eq!(format!("{}", t.path.segments[0].ident), "Sized"); }